-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bar & Histogram & Formula & ComparativeFormula Widgets: Add a skeleton for loading state #674
Merged
Merged
Changes from 16 commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
893ad66
first approach to BarWidgetUI skeleton
vmilan 50a95a3
first approach to BarWidgetUI skeleton
vmilan a15c938
fine tunning of Skeleton
vmilan 6545811
histogram widget loading
vmilan 6fe5145
changelog and cleanup
vmilan bbd16fc
merge with master
vmilan e132075
merge with master
vmilan 63da47d
cleanup
vmilan f787ef7
FormulaWidgetUI skeleton
vmilan d282cdd
changelog update
vmilan 75a06ff
changelog update
vmilan 9c76bad
add types
vmilan 3f55481
adapt storybook to latest changes in design
vmilan 75ecf54
adding comparative formula
vmilan e9a8f07
minor fixes
vmilan 4456056
add missing const
vmilan 674ae05
change storybook intro text
vmilan File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import { Box, Skeleton } from '@mui/material'; | ||
import { SkeletonBarsGrid, SkeletonBarItem, SKELETON_HEIGHT } from '../SkeletonWidgets'; | ||
|
||
const BarSkeleton = ({ height }) => { | ||
return ( | ||
<> | ||
<Box mb={2}> | ||
<Skeleton width={48} height={8} /> | ||
</Box> | ||
|
||
<SkeletonBarsGrid style={{ height: height || SKELETON_HEIGHT }}> | ||
<SkeletonBarItem variant='rectangular' height='20%' /> | ||
<SkeletonBarItem variant='rectangular' height='40%' /> | ||
<SkeletonBarItem variant='rectangular' height='60%' /> | ||
<SkeletonBarItem variant='rectangular' height='20%' /> | ||
<SkeletonBarItem variant='rectangular' height='80%' /> | ||
</SkeletonBarsGrid> | ||
</> | ||
); | ||
}; | ||
|
||
export default BarSkeleton; |
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
7 changes: 7 additions & 0 deletions
7
packages/react-ui/src/widgets/FormulaWidgetUI/FormulaSkeleton.js
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,7 @@ | ||
import { Skeleton } from '@mui/material'; | ||
|
||
const FormulaSkeleton = () => { | ||
return <Skeleton height={24} width={120} />; | ||
}; | ||
|
||
export default FormulaSkeleton; |
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
33 changes: 33 additions & 0 deletions
33
packages/react-ui/src/widgets/HistogramWidgetUI/HistogramSkeleton.js
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,33 @@ | ||
import { Box, Skeleton } from '@mui/material'; | ||
import { | ||
SKELETON_HEIGHT, | ||
SkeletonGraphGrid, | ||
SkeletonThinBarItem | ||
} from '../SkeletonWidgets'; | ||
|
||
const HistogramSkeleton = ({ height }) => { | ||
return ( | ||
<> | ||
<Box mb={2}> | ||
<Skeleton width={48} height={8} /> | ||
</Box> | ||
|
||
<SkeletonGraphGrid style={{ height: height || SKELETON_HEIGHT }}> | ||
<SkeletonThinBarItem variant='rectangular' height='20%' /> | ||
<SkeletonThinBarItem variant='rectangular' height='40%' /> | ||
<SkeletonThinBarItem variant='rectangular' height='60%' /> | ||
<SkeletonThinBarItem variant='rectangular' height='20%' /> | ||
<SkeletonThinBarItem variant='rectangular' height='80%' /> | ||
<SkeletonThinBarItem variant='rectangular' height='50%' /> | ||
<SkeletonThinBarItem variant='rectangular' height='20%' /> | ||
<SkeletonThinBarItem variant='rectangular' height='40%' /> | ||
<SkeletonThinBarItem variant='rectangular' height='60%' /> | ||
<SkeletonThinBarItem variant='rectangular' height='20%' /> | ||
<SkeletonThinBarItem variant='rectangular' height='80%' /> | ||
<SkeletonThinBarItem variant='rectangular' height='50%' /> | ||
</SkeletonGraphGrid> | ||
</> | ||
); | ||
}; | ||
|
||
export default HistogramSkeleton; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
import { Skeleton, styled } from '@mui/material'; | ||
|
||
export const SKELETON_HEIGHT = 240; | ||
|
||
export const SkeletonBarsGrid = styled('div')(({ theme }) => ({ | ||
display: 'flex', | ||
alignItems: 'flex-end', | ||
justifyContent: 'space-between', | ||
width: '100%', | ||
position: 'relative', | ||
padding: theme.spacing(0, 2), | ||
|
||
// Linear grid effect | ||
'&::before': { | ||
content: '""', | ||
position: 'absolute', | ||
top: 0, | ||
right: 0, | ||
left: 0, | ||
bottom: 0, | ||
backgroundSize: theme.spacing(4, 4), | ||
backgroundImage: `linear-gradient(to bottom, ${theme.palette.grey[50]} 1px, transparent 1px)`, | ||
transform: 'scaleY(-1)' | ||
} | ||
})); | ||
|
||
export const SkeletonGraphGrid = styled('div')(({ theme }) => ({ | ||
display: 'flex', | ||
alignItems: 'flex-end', | ||
justifyContent: 'space-between', | ||
width: '100%', | ||
|
||
// Square grid effect | ||
backgroundImage: `linear-gradient(${theme.palette.grey[50]} 0.5px, transparent 0.5px, transparent calc(100% - 0.5px), ${theme.palette.grey[50]} calc(100% - 0.5px)), linear-gradient(90deg, ${theme.palette.grey[50]} 0.5px, transparent 0.5px, transparent calc(100% - 0.5px), ${theme.palette.grey[50]} calc(100% - 0.5px))`, | ||
backgroundSize: '8.33% 20%', | ||
border: `0.5px solid ${theme.palette.grey[50]}` | ||
})); | ||
|
||
export const SkeletonBarItem = styled(Skeleton)(({ theme }) => ({ | ||
flex: 1, | ||
maxWidth: theme.spacing(12), | ||
|
||
'& + &': { | ||
marginLeft: theme.spacing(1) | ||
} | ||
})); | ||
|
||
export const SkeletonThinBarItem = styled(Skeleton)(({ theme }) => ({ | ||
flex: 1, | ||
maxWidth: theme.spacing(8), | ||
|
||
'& + &': { | ||
marginLeft: '1px' | ||
} | ||
})); |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, good to know we have some basics in common