-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
25 changed files
with
441 additions
and
146 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions
1
packages/adena-extension/src/common/constants/resource.constant.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 |
---|---|---|
@@ -1,2 +1,3 @@ | ||
export const ADENA_TERMS_PAGE = 'https://adena.app/terms' as const; | ||
export const ADENA_DOCS_PAGE = 'https://docs.adena.app' as const; | ||
export const GNO_CLI_HELP_PAGE = 'https://docs.onbloc.xyz/docs/cli' as const; |
88 changes: 88 additions & 0 deletions
88
packages/adena-extension/src/components/atoms/rolling-number/index.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,88 @@ | ||
import { WebFontType } from '@styles/theme'; | ||
import React, { useEffect, useState } from 'react'; | ||
import styled, { css, FlattenSimpleInterpolation } from 'styled-components'; | ||
import { View } from '../base'; | ||
import { WebText } from '../web-text'; | ||
|
||
export const StyledWrapper = styled(View) <{ active: boolean, height?: number }>` | ||
width: fit-content; | ||
height: ${({ height }): string => height ? `${height}px` : '1em'}; | ||
flex-direction: column; | ||
overflow: hidden; | ||
@keyframes rolling-animation { | ||
from { | ||
transform: translate(0, 0); | ||
} | ||
to { | ||
transform: translate(0, -100%); | ||
} | ||
} | ||
${({ active }): FlattenSimpleInterpolation | string => active ? css` | ||
& > * { | ||
animation: rolling-animation 0.2s linear forwards; | ||
} | ||
` : ''} | ||
`; | ||
|
||
|
||
export interface RollingNumberProps { | ||
value: number; | ||
height?: number; | ||
type: WebFontType; | ||
color?: string; | ||
style?: React.CSSProperties; | ||
textCenter?: boolean; | ||
} | ||
|
||
const RollingNumber: React.FC<RollingNumberProps> = ({ | ||
height, | ||
value, | ||
type, | ||
color, | ||
style, | ||
textCenter, | ||
}) => { | ||
const [currentValue, setCurrentValue] = useState(value); | ||
const [animated, setAnimated] = useState(false); | ||
|
||
useEffect(() => { | ||
if (currentValue !== value) { | ||
setAnimated(true); | ||
} | ||
}, [value]); | ||
|
||
useEffect(() => { | ||
if (animated) { | ||
setTimeout(() => { | ||
setAnimated(false); | ||
setCurrentValue(value); | ||
}, 200); | ||
} | ||
}, [animated]); | ||
|
||
return ( | ||
<StyledWrapper active={animated} height={height}> | ||
<WebText | ||
type={type} | ||
color={color} | ||
style={style} | ||
textCenter={textCenter} | ||
> | ||
{currentValue} | ||
</WebText> | ||
<WebText | ||
type={type} | ||
color={color} | ||
style={style} | ||
textCenter={textCenter} | ||
> | ||
{value} | ||
</WebText> | ||
</StyledWrapper> | ||
); | ||
}; | ||
|
||
export default RollingNumber; |
24 changes: 24 additions & 0 deletions
24
packages/adena-extension/src/components/atoms/rolling-number/rolling-number.spec.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,24 @@ | ||
import React from 'react'; | ||
import { RecoilRoot } from 'recoil'; | ||
import { ThemeProvider } from 'styled-components'; | ||
import { render } from '@testing-library/react'; | ||
import theme from '@styles/theme'; | ||
import { GlobalWebStyle } from '@styles/global-style'; | ||
import RollingNumber from '.'; | ||
|
||
describe('RollingNumber Component', () => { | ||
it('RollingNumber render', () => { | ||
|
||
render( | ||
<RecoilRoot> | ||
<GlobalWebStyle /> | ||
<ThemeProvider theme={theme}> | ||
<RollingNumber | ||
type='body1' | ||
value={1} | ||
/> | ||
</ThemeProvider> | ||
</RecoilRoot>, | ||
); | ||
}); | ||
}); |
15 changes: 15 additions & 0 deletions
15
packages/adena-extension/src/components/atoms/rolling-number/rolling-number.stories.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,15 @@ | ||
import { Meta, StoryObj } from '@storybook/react'; | ||
import RollingNumber from '.'; | ||
|
||
export default { | ||
title: 'components/atoms/RollingNumber', | ||
component: RollingNumber, | ||
} as Meta<typeof RollingNumber>; | ||
|
||
export const Default: StoryObj<typeof RollingNumber> = { | ||
args: { | ||
value: 3, | ||
type: 'body6', | ||
color: '#FBC224', | ||
}, | ||
}; |
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
10 changes: 5 additions & 5 deletions
10
packages/adena-extension/src/components/atoms/web-text/index.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
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
35 changes: 35 additions & 0 deletions
35
packages/adena-extension/src/components/pages/web/loading-accounts/index.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,35 @@ | ||
import { ReactElement } from 'react'; | ||
import styled, { useTheme } from 'styled-components'; | ||
|
||
import AnimationLoadingAccount from '@assets/web/loading-account-idle.gif'; | ||
|
||
import { View, WebImg, WebText } from '@components/atoms'; | ||
|
||
const StyledContainer = styled(View)` | ||
row-gap: 24px; | ||
align-items: center; | ||
`; | ||
|
||
const StyledMessageBox = styled(View)` | ||
row-gap: 16px; | ||
`; | ||
|
||
const WebLoadingAccounts: React.FC = (): ReactElement => { | ||
const theme = useTheme(); | ||
|
||
return ( | ||
<StyledContainer> | ||
<WebImg src={AnimationLoadingAccount} height={120} /> | ||
<StyledMessageBox> | ||
<WebText type='headline2' textCenter> | ||
Loading Accounts | ||
</WebText> | ||
<WebText type='body6' color={theme.webNeutral._500} textCenter> | ||
We’re loading accounts. This will take a few seconds... | ||
</WebText> | ||
</StyledMessageBox> | ||
</StyledContainer> | ||
); | ||
}; | ||
|
||
export default WebLoadingAccounts; |
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.