Skip to content

Commit

Permalink
[Issue-2014] Update responsive
Browse files Browse the repository at this point in the history
  • Loading branch information
lw-cdm committed Oct 20, 2023
1 parent 567f4be commit 1741ea2
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -443,15 +443,32 @@ const Component: React.FC<Props> = (props: Props) => {
});
}, [assetRegistry, chainStateMap, groupYieldPosition, poolInfoMap, sortSelection]);

const addMore = useCallback(() => {
navigate('/home/earning/overview');
}, [navigate]);

const renderWhenEmpty = useCallback(() => {
return (
<EmptyList
emptyMessage={t('Need message')}
emptyTitle={t('Need message')}
buttonProps={{
icon: (
<Icon
phosphorIcon={Vault}
size='sm'
weight='fill'
/>
),
onClick: addMore,
shape: 'circle',
size: 'xs',
children: t('Earn now')
}}
emptyMessage={t('Switch account, turn on networks or start earning to view pools')}
emptyTitle={t('No pools found')}
phosphorIcon={Vault}
/>
);
}, [t]);
}, [addMore, t]);

const handleCloseUnstake = useCallback(() => {
inactiveModal(TRANSACTION_YIELD_UNSTAKE_MODAL);
Expand All @@ -473,10 +490,6 @@ const Component: React.FC<Props> = (props: Props) => {
inactiveModal(TRANSACTION_YIELD_CLAIM_MODAL);
}, [inactiveModal]);

const addMore = useCallback(() => {
navigate('/home/earning/overview');
}, [navigate]);

useEffect(() => {
if (location.pathname.startsWith('/home/earning')) {
setTitle(t('Earning'));
Expand Down Expand Up @@ -748,6 +761,13 @@ const EarningManagement = styled(Component)<Props>(({ theme: { token } }: Props)
}
},

'.empty-list': {
position: 'absolute',
top: '50%',
left: '50%',
transform: 'translate(-50%, -50%)'
},

'.__body-area': {
overflow: 'auto',
flex: 1,
Expand Down Expand Up @@ -808,6 +828,11 @@ const EarningManagement = styled(Component)<Props>(({ theme: { token } }: Props)
paddingRight: token.size
},

'.empty-list': {
position: 'static',
transform: 'none'
},

'.__toolbar-area': {
position: 'sticky',
zIndex: 10,
Expand Down Expand Up @@ -846,13 +871,6 @@ const EarningManagement = styled(Component)<Props>(({ theme: { token } }: Props)
lineHeight: token.lineHeight
}
}
},

'.empty-list': {
position: 'absolute',
top: '50%',
left: '50%',
transform: 'translate(-50%, -50%)'
}
});
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -369,6 +369,11 @@ const EarningOverviewContent = styled(Component)<Props>(({ theme: { token } }: P
backgroundColor: token.colorBgDefault
},

'.empty-list': {
position: 'static',
transform: 'none'
},

'.search-container': {
paddingBottom: token.size,

Expand All @@ -389,6 +394,13 @@ const EarningOverviewContent = styled(Component)<Props>(({ theme: { token } }: P
'.__list-container': {
paddingBottom: token.paddingXS
}
},

'@media (max-width: 767px)': {
'.__list-container': {
display: 'flex',
flexDirection: 'column'
}
}
});
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -355,20 +355,22 @@ const EarningItem = styled(Component)<Props>(({ theme: { token } }: Props) => {
},

'.__item-line-1, .__item-line-2': {
'white-space': 'nowrap',
display: 'flex',
justifyContent: 'space-between',
gap: token.sizeSM
},

'.__item-line-1': {
'white-space': 'nowrap',
marginBottom: token.marginXXS
},

'.__item-rewards-label, .__item-total-staked-label': {
fontSize: token.fontSizeSM,
lineHeight: token.lineHeightSM,
color: token.colorTextLight4
color: token.colorTextLight4,
overflow: 'hidden',
textOverflow: 'ellipsis'
},

'.__item-name': {
Expand All @@ -377,7 +379,6 @@ const EarningItem = styled(Component)<Props>(({ theme: { token } }: Props) => {
color: token.colorTextLight1,
fontWeight: token.headingFontWeight,
overflow: 'hidden',
'white-space': 'nowrap',
textOverflow: 'ellipsis'
},

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@

import { Theme, ThemeProps } from '@subwallet/extension-koni-ui/types';
import { Button, ButtonProps, PageIcon } from '@subwallet/react-ui';
import CN from 'classnames';
import { IconProps } from 'phosphor-react';
import React from 'react';
import styled, { useTheme } from 'styled-components';
import CN from 'classnames';

interface Props extends ThemeProps {
phosphorIcon?: React.ForwardRefExoticComponent<IconProps & React.RefAttributes<SVGSVGElement>>,
Expand Down

0 comments on commit 1741ea2

Please sign in to comment.