-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Assets page fixes & wallet button new design (#2536)
* Assets page fixes * Add new design for wallet menu * Redesign dialog * Readd select functionality * Modify wallet button * Fix total assets * Fix wallet title * Add skeleton loader * Add border radius * remove alias from storybook * Fix linter * Add alias back to btn * Hide skeleton
- Loading branch information
Showing
34 changed files
with
511 additions
and
385 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
71 changes: 71 additions & 0 deletions
71
centrifuge-app/src/components/Skeletons/LoanListSkeleton.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
import { Box, Grid } from '@centrifuge/fabric' | ||
import styled, { keyframes, useTheme } from 'styled-components' | ||
import { GRAY_COLOR_SKELETON, SkeletonTable } from './SkeletonTable' | ||
|
||
export const shimmer = keyframes` | ||
0% { | ||
background-position: -200% 0; | ||
} | ||
100% { | ||
background-position: 200% 0; | ||
} | ||
` | ||
|
||
export const ShimmerBlock = styled(Box)` | ||
background: linear-gradient( | ||
to right, | ||
${GRAY_COLOR_SKELETON} 0%, | ||
#e0e0e0 20%, | ||
${GRAY_COLOR_SKELETON} 40%, | ||
${GRAY_COLOR_SKELETON} 100% | ||
); | ||
background-size: 200% 100%; | ||
animation: ${shimmer} 1.5s infinite ease-in-out; | ||
` | ||
|
||
export const LoanListSkeleton = () => { | ||
const theme = useTheme() | ||
return ( | ||
<Box margin={2}> | ||
<Grid | ||
backgroundColor={theme.colors.backgroundSecondary} | ||
gridTemplateColumns={`repeat(6, 1fr)`} | ||
margin={2} | ||
borderRadius={10} | ||
border={`1px solid ${theme.colors.borderPrimary}`} | ||
py={1} | ||
> | ||
{Array(5) | ||
.fill(null) | ||
.map((item, index) => ( | ||
<ShimmerBlock key={`skeleton-loan-list-${index}`} margin={2} height={58} borderRadius={8} /> | ||
))} | ||
<Box | ||
alignSelf="center" | ||
height={36} | ||
backgroundColor={theme.colors.textGold} | ||
margin={2} | ||
borderRadius={4} | ||
ml={4} | ||
/> | ||
</Grid> | ||
|
||
<Box | ||
margin={2} | ||
paddingY={1} | ||
flexDirection="row" | ||
justifyContent="space-between" | ||
display="flex" | ||
alignItems="center" | ||
> | ||
<ShimmerBlock width={84} borderRadius="10px" height={12} /> | ||
<Grid gridTemplateColumns={['200px 138px']} gap={2}> | ||
<ShimmerBlock borderRadius="4px" height={36} /> | ||
<ShimmerBlock borderRadius="4px" height={36} /> | ||
</Grid> | ||
</Box> | ||
|
||
<SkeletonTable /> | ||
</Box> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
import { Box, Grid } from '@centrifuge/fabric' | ||
import styled, { keyframes, useTheme } from 'styled-components' | ||
|
||
export const shimmer = keyframes` | ||
0% { | ||
background-position: -200% 0; | ||
} | ||
100% { | ||
background-position: 200% 0; | ||
} | ||
` | ||
|
||
export const GRAY_COLOR_SKELETON = '#E9E9E9' | ||
|
||
export const ShimmerBlock = styled(Box)` | ||
height: 12px; | ||
width: 84px; | ||
border-radius: 10px; | ||
background: linear-gradient( | ||
to right, | ||
${GRAY_COLOR_SKELETON} 0%, | ||
#f0f0f0 20%, | ||
${GRAY_COLOR_SKELETON} 40%, | ||
${GRAY_COLOR_SKELETON} 100% | ||
); | ||
background-size: 200% 100%; | ||
animation: ${shimmer} 1.5s infinite ease-in-out; | ||
` | ||
|
||
export const RectangleBlock = styled(Box)` | ||
padding: 16px; | ||
` | ||
|
||
export const SkeletonTable = ({ rows = 12, columns = 9 }) => { | ||
const theme = useTheme() | ||
const gridTemplateColumns = `repeat(${columns}, 1fr)` | ||
|
||
return ( | ||
<Grid | ||
gridTemplateColumns={gridTemplateColumns} | ||
border={`1px solid ${theme.colors.borderPrimary}`} | ||
borderRadius="10px" | ||
margin={2} | ||
overflow="hidden" | ||
> | ||
{Array(rows * columns) | ||
.fill(null) | ||
.map((_, index) => { | ||
let borderRadius = '0px' | ||
if (index === 0) borderRadius = '10px 0 0 0' // Top-left corner | ||
if (index === columns - 1) borderRadius = '0 10px 0 0' // Top-right corner | ||
if (index === (rows - 1) * columns) borderRadius = '0 0 0 10px' // Bottom-left corner | ||
if (index === rows * columns - 1) borderRadius = '0 0 10px 0' // Bottom-right corner | ||
|
||
return ( | ||
<RectangleBlock | ||
key={index} | ||
backgroundColor={index < columns ? theme.colors.backgroundSecondary : theme.colors.backgroundPrimary} | ||
borderRadius={borderRadius} | ||
borderBottom={index < columns ? `1px solid ${theme.colors.borderPrimary}` : 'none'} | ||
> | ||
<ShimmerBlock backgroundColor={index < columns ? '#D9D9D9' : GRAY_COLOR_SKELETON} /> | ||
</RectangleBlock> | ||
) | ||
})} | ||
</Grid> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.