Commit 704ad222 authored by Charles Bachmeier's avatar Charles Bachmeier Committed by GitHub

feat: add animation to search skeleton and typing state (#4598)

* fade when loading

* fade results between searches

* trending search loading skeleton

* adjust skeleton and cleanup

* remove unused style change

* eslint

* add trendingTokens to query and remove unnecessary returns

* move array map compatibility higher in the call hierarchy

* add feature flag to isLoading param
Co-authored-by: default avatarCharlie <charlie@uniswap.org>
parent cfee80ce
This diff is collapsed.
...@@ -175,13 +175,21 @@ export const TokenRow = ({ token, isHovered, setHoveredIndex, toggleOpen, index ...@@ -175,13 +175,21 @@ export const TokenRow = ({ token, isHovered, setHoveredIndex, toggleOpen, index
export const SkeletonRow = () => { export const SkeletonRow = () => {
return ( return (
<Box className={styles.searchBarDropdown}> <Row className={styles.suggestionRow}>
<Row className={styles.suggestionRow}> <Row width="full">
<Row> <Box className={styles.imageHolder} />
<Box className={styles.imageHolder} /> <Column gap="4" width="full">
<Box borderRadius="round" height="16" width="160" background="loading" /> <Row justifyContent="space-between">
</Row> <Box borderRadius="round" height="20" background="loading" style={{ width: '180px' }} />
<Box borderRadius="round" height="20" width="48" background="loading" />
</Row>
<Row justifyContent="space-between">
<Box borderRadius="round" height="16" width="120" background="loading" />
<Box borderRadius="round" height="16" width="48" background="loading" />
</Row>
</Column>
</Row> </Row>
</Box> </Row>
) )
} }
...@@ -24,6 +24,7 @@ const themeContractValues = { ...@@ -24,6 +24,7 @@ const themeContractValues = {
magicGradient: '', magicGradient: '',
placeholder: '', placeholder: '',
lightGrayButton: '', lightGrayButton: '',
loading: '',
// Opacities of black and white // Opacities of black and white
white95: '', white95: '',
...@@ -55,6 +56,7 @@ const dimensions = { ...@@ -55,6 +56,7 @@ const dimensions = {
'2': '2', '2': '2',
'4': '4px', '4': '4px',
'8': '8px', '8': '8px',
'12': '12px',
'16': '16px', '16': '16px',
'18': '18px', '18': '18px',
'20': '20px', '20': '20px',
...@@ -142,7 +144,6 @@ export const vars = createGlobalTheme(':root', { ...@@ -142,7 +144,6 @@ export const vars = createGlobalTheme(':root', {
transculent: '#7F7F7F', transculent: '#7F7F7F',
transparent: 'transparent', transparent: 'transparent',
none: 'none', none: 'none',
loading: '#7C85A24D',
// new uniswap colors: // new uniswap colors:
blue400: '#4C82FB', blue400: '#4C82FB',
...@@ -153,6 +154,7 @@ export const vars = createGlobalTheme(':root', { ...@@ -153,6 +154,7 @@ export const vars = createGlobalTheme(':root', {
green200: '#5CFE9D', green200: '#5CFE9D',
green400: '#1A9550', green400: '#1A9550',
grey900: '#0E111A', grey900: '#0E111A',
grey800: '#141B2B',
grey700: '#293249', grey700: '#293249',
grey500: '#5E6887', grey500: '#5E6887',
grey400: '#7C85A2', grey400: '#7C85A2',
...@@ -298,7 +300,7 @@ const layoutStyles = defineProperties({ ...@@ -298,7 +300,7 @@ const layoutStyles = defineProperties({
position: ['absolute', 'fixed', 'relative', 'sticky', 'static'], position: ['absolute', 'fixed', 'relative', 'sticky', 'static'],
objectFit: ['contain', 'cover'], objectFit: ['contain', 'cover'],
order: [0, 1], order: [0, 1],
opacity: ['auto', '0', '1'], opacity: ['auto', '0', '0.3', '0.5', '0.7', '1'],
} as const, } as const,
shorthands: { shorthands: {
paddingX: ['paddingLeft', 'paddingRight'], paddingX: ['paddingLeft', 'paddingRight'],
......
...@@ -22,6 +22,7 @@ export const darkTheme: Theme = { ...@@ -22,6 +22,7 @@ export const darkTheme: Theme = {
magicGradient: vars.color.blue400, magicGradient: vars.color.blue400,
placeholder: vars.color.grey400, placeholder: vars.color.grey400,
lightGrayButton: vars.color.grey700, lightGrayButton: vars.color.grey700,
loading: vars.color.grey800,
// Opacities of black and white // Opacities of black and white
white95: '#0E111AF2', white95: '#0E111AF2',
......
...@@ -22,6 +22,7 @@ export const lightTheme: Theme = { ...@@ -22,6 +22,7 @@ export const lightTheme: Theme = {
magicGradient: vars.color.pink400, magicGradient: vars.color.pink400,
placeholder: vars.color.grey300, placeholder: vars.color.grey300,
lightGrayButton: vars.color.grey100, lightGrayButton: vars.color.grey100,
loading: vars.color.grey50,
// Opacities of black and white // Opacities of black and white
white95: '#EDEFF7F2', white95: '#EDEFF7F2',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment