-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
migrate statements list to new ui-kit #121
- Loading branch information
Showing
30 changed files
with
436 additions
and
391 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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
9 changes: 0 additions & 9 deletions
9
src/components/market/PriceChangeIndicator/PriceChangeIndicator.module.scss
This file was deleted.
Oops, something went wrong.
47 changes: 0 additions & 47 deletions
47
src/components/market/PriceChangeIndicator/PriceChangeIndicator.tsx
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
|
@@ -3,25 +3,38 @@ | |
* @copyright Yury Korotovskikh <[email protected]> | ||
*/ | ||
|
||
import { | ||
LinkedinIcon, | ||
TwitterIcon, | ||
GithubIcon, | ||
TelegramIcon, | ||
DiscordIcon, | ||
} from '@nilfoundation/ui-kit'; | ||
|
||
export const socialLinks = [ | ||
{ | ||
icon: 'twitter', | ||
url: 'https://twitter.com/nil_foundation', | ||
Component: TwitterIcon, | ||
}, | ||
{ | ||
icon: 'linkedin', | ||
url: 'https://www.linkedin.com/company/nil-foundation', | ||
Component: LinkedinIcon, | ||
}, | ||
{ | ||
icon: 'github', | ||
url: 'http://github.com/nilfoundation', | ||
Component: GithubIcon, | ||
}, | ||
{ | ||
icon: 'telegram', | ||
url: 'https://t.me/nilfoundation', | ||
Component: TelegramIcon, | ||
}, | ||
{ | ||
icon: 'discord', | ||
url: 'https://discord.gg/KmTAEjbmM3', | ||
Component: DiscordIcon, | ||
}, | ||
]; |
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
54 changes: 54 additions & 0 deletions
54
src/features/shared/components/PriceChangeIndicator/PriceChangeIndicator.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,54 @@ | ||
/** | ||
* @file React component. | ||
* @copyright Yury Korotovskikh <[email protected]> | ||
*/ | ||
|
||
import type { ReactElement } from 'react'; | ||
import { ArrowUpIcon, PRIMITIVE_COLORS } from '@nilfoundation/ui-kit'; | ||
import { useStyletron } from 'styletron-react'; | ||
import { globalStyles } from '@/styles/globalStyles'; | ||
import { styles as s } from './styles'; | ||
|
||
/** | ||
* Props. | ||
*/ | ||
type PriceChangeIndicatorProps = { | ||
change: number; | ||
toFixed?: number; | ||
plainColor?: boolean; | ||
}; | ||
|
||
/** | ||
* Trade history component. | ||
* | ||
* @param {PriceChangeIndicatorProps} props Props. | ||
* @returns React component. | ||
*/ | ||
export const PriceChangeIndicator = ({ | ||
change, | ||
toFixed = 4, | ||
plainColor, | ||
}: PriceChangeIndicatorProps): ReactElement => { | ||
const [css] = useStyletron(); | ||
const isGrow = !!change && change > 0; | ||
const computedClassName = plainColor | ||
? {} | ||
: isGrow | ||
? globalStyles.successText | ||
: globalStyles.dangerText; | ||
const computedIconColor = plainColor | ||
? undefined | ||
: isGrow | ||
? PRIMITIVE_COLORS.green300 | ||
: PRIMITIVE_COLORS.red300; | ||
|
||
return ( | ||
<div className={css({ ...computedClassName, ...s.container })}> | ||
<ArrowUpIcon | ||
color={computedIconColor} | ||
className={isGrow ? undefined : css(s.revertedIcon)} | ||
/> | ||
{`${Math.abs(change).toFixed(toFixed)}%`} | ||
</div> | ||
); | ||
}; |
20 changes: 20 additions & 0 deletions
20
src/features/shared/components/PriceChangeIndicator/styles.ts
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,20 @@ | ||
/** | ||
* @file Styles for PriceChangeIndicator component. | ||
*/ | ||
|
||
import type { StyleObject } from 'styletron-react'; | ||
|
||
const revertedIcon: StyleObject = { | ||
transform: 'rotate(180deg)', | ||
}; | ||
|
||
const container: StyleObject = { | ||
display: 'flex', | ||
alignItems: 'center', | ||
gap: '0.5rem', | ||
}; | ||
|
||
export const styles = { | ||
revertedIcon, | ||
container, | ||
}; |
Oops, something went wrong.