Skip to content

Commit

Permalink
migrate statements list to new ui-kit #121
Browse files Browse the repository at this point in the history
  • Loading branch information
ukorvl authored Sep 29, 2023
1 parent cbb6958 commit 24193ae
Show file tree
Hide file tree
Showing 30 changed files with 436 additions and 391 deletions.
9 changes: 0 additions & 9 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -84,15 +84,6 @@
rel="preconnect"
href="https://fonts.gstatic.com"
/>
<link
rel="preconnect"
href="https://kit.fontawesome.com"
/>
<script
defer
src="https://kit.fontawesome.com/9264f6e460.js"
crossorigin="anonymous"
></script>
<script
type="text/javascript"
src="/tomlParser.js"
Expand Down
12 changes: 6 additions & 6 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

29 changes: 0 additions & 29 deletions src/components/common/SocialLinks/SocialLinks.module.scss

This file was deleted.

52 changes: 0 additions & 52 deletions src/components/common/SocialLinks/SocialLinks.tsx

This file was deleted.

7 changes: 0 additions & 7 deletions src/components/common/SocialLinks/index.ts

This file was deleted.

1 change: 0 additions & 1 deletion src/components/common/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ export * from './FileUploader';
export * from './Table';
export * from './FullScreenView';
export * from './ClickableIcon';
export * from './SocialLinks';
export * from './Copyright';
export * from './Overlay';
export * from './ObjectAsPlainTextViewer';
Expand Down
2 changes: 1 addition & 1 deletion src/components/login/RegisterForm/RegisterForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import debounce from 'lodash/debounce';
import { useForm } from 'react-hook-form';
import { Path } from '@/features/routing';
import { socialLinks } from '@/constants';
import { SocialLinks } from '@/components';
import { SocialLinks } from '@/features/shared';
import type { RegisterData } from '@/models';
import { signUp, checkIsUsernameUnique } from '@/api';
import { getApiErrorMessage } from '@/utils';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ import { TradeOrderType } from '@/models';
import { socialLinks as links } from '@/constants';
import { getRuntimeConfigOrThrow } from '@/utils';
import { ProtectedContent } from '@/features/auth';
import { DashboardCard, SocialLinks } from '../../common';
import { SocialLinks } from '@/features/shared';
import { DashboardCard } from '../../common';
import { CreateRequestForm } from '../CreateRequestForm';
import { CreateOrdersTabs } from './CreateOrdersTabs';
import './CreateOrdersPanel.scss';
Expand Down

This file was deleted.

This file was deleted.

6 changes: 0 additions & 6 deletions src/components/market/PriceChangeIndicator/index.ts

This file was deleted.

1 change: 0 additions & 1 deletion src/components/market/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,5 @@ export * from './OrderManagementContextProvider';
export * from './CreateOrdersPanel';
export * from './TradeHistory';
export * from './ManageOrdersPanel';
export * from './PriceChangeIndicator';
export * from './StatementInfoPanel';
export * from './LastProofProducer';
13 changes: 13 additions & 0 deletions src/constants/common/socialLinks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
},
];
3 changes: 2 additions & 1 deletion src/features/shared/components/Footer/Footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@

import type { ReactElement } from 'react';
import { useStyletron } from 'styletron-react';
import { Copyright, SocialLinks } from '@/components';
import { Copyright } from '@/components';
import { socialLinks } from '@/constants';
import { styles as s } from './styles';
import { SocialLinks } from '../SocialLinks/SocialLinks';

/**
* Footer.
Expand Down
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 src/features/shared/components/PriceChangeIndicator/styles.ts
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,
};
Loading

0 comments on commit 24193ae

Please sign in to comment.