forked from Koniverse/SubWallet-Extension
-
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.
- Loading branch information
Showing
8 changed files
with
289 additions
and
107 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
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
77 changes: 77 additions & 0 deletions
77
...ension-koni-ui/src/components/Modal/WalletConnect/DisconnectWalletConnectModalContent.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,77 @@ | ||
// Copyright 2019-2022 @polkadot/extension-ui authors & contributors | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
import { Theme, ThemeProps } from '@subwallet/extension-koni-ui/types'; | ||
import { toShort } from '@subwallet/extension-koni-ui/utils'; | ||
import { Field, Icon, PageIcon } from '@subwallet/react-ui'; | ||
import CN from 'classnames'; | ||
import { CheckCircle, Plugs } from 'phosphor-react'; | ||
import React from 'react'; | ||
import { useTranslation } from 'react-i18next'; | ||
import styled, { useTheme } from 'styled-components'; | ||
|
||
interface Props extends ThemeProps { | ||
address: string; | ||
} | ||
|
||
function Component (props: Props): React.ReactElement<Props> { | ||
const { address, className = '' } = props; | ||
|
||
const { t } = useTranslation(); | ||
const { token } = useTheme() as Theme; | ||
|
||
return ( | ||
<div className={CN(className)}> | ||
<div className='page-icon-overide'> | ||
<PageIcon | ||
color='#000' | ||
iconProps={{ | ||
phosphorIcon: Plugs, | ||
weight: 'fill' | ||
}} | ||
/> | ||
</div> | ||
<div className='disconnect-text'> | ||
{t('Do you want to disconnect from this account?')} | ||
</div> | ||
<Field | ||
className={'address-field'} | ||
content={toShort(address, 10, 16)} | ||
suffix={( | ||
<Icon | ||
iconColor={token.colorSuccess} | ||
phosphorIcon={CheckCircle} | ||
size='sm' | ||
weight='fill' | ||
/> | ||
)} | ||
/> | ||
</div> | ||
); | ||
} | ||
|
||
export const DisconnectWalletConnectModalContent = styled(Component)<Props>(({ theme: { token } }: Props) => { | ||
return ({ | ||
background: 'linear-gradient(117deg, #FFD8E6 9.05%, #BCEBFF 91.43%)', | ||
borderRadius: 24, | ||
display: 'flex', | ||
gap: token.size, | ||
textAlign: 'center', | ||
flexDirection: 'column', | ||
alignItems: 'center', | ||
padding: '24px 20px', | ||
|
||
'.disconnect-text': { | ||
fontSize: token.fontSizeSM, | ||
fontWeight: token.bodyFontWeight, | ||
lineHeight: token.lineHeightSM, | ||
color: token.colorTextDark1 | ||
}, | ||
|
||
'.address-field': { | ||
'.ant-field-content': { | ||
color: `${token.colorTextTertiary} !important` | ||
} | ||
} | ||
}); | ||
}); |
70 changes: 70 additions & 0 deletions
70
...extension-koni-ui/src/components/Modal/WalletConnect/RequireConnectWalletModalContent.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,70 @@ | ||
// Copyright 2019-2022 @polkadot/extension-ui authors & contributors | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
import { WalletConnect } from '@subwallet/extension-koni-ui/components'; | ||
import { ThemeProps } from '@subwallet/extension-koni-ui/types'; | ||
import { PageIcon } from '@subwallet/react-ui'; | ||
import CN from 'classnames'; | ||
import React from 'react'; | ||
import { useTranslation } from 'react-i18next'; | ||
import styled from 'styled-components'; | ||
|
||
type Props = ThemeProps | ||
|
||
function Component (props: Props): React.ReactElement<Props> { | ||
const { className = '' } = props; | ||
|
||
const { t } = useTranslation(); | ||
|
||
return ( | ||
<div className={CN(className)}> | ||
<div className='page-icon-overide'> | ||
<PageIcon | ||
color='#000' | ||
iconProps={{ | ||
customIcon: ( | ||
<WalletConnect | ||
height='1em' | ||
width='1em' | ||
/> | ||
), | ||
type: 'customIcon' | ||
}} | ||
/> | ||
</div> | ||
<div className='require-text'> | ||
{t('Wallet connection required')} | ||
</div> | ||
<div className='require-sub-text'> | ||
{t('You need to connect your wallet to continue ')} | ||
</div> | ||
</div> | ||
); | ||
} | ||
|
||
export const RequireConnectWalletModalContent = styled(Component)<Props>(({ theme: { token } }: Props) => { | ||
return ({ | ||
background: 'linear-gradient(117deg, #FFD8E6 9.05%, #BCEBFF 91.43%)', | ||
borderRadius: 24, | ||
display: 'flex', | ||
gap: token.size, | ||
textAlign: 'center', | ||
flexDirection: 'column', | ||
alignItems: 'center', | ||
padding: '24px 20px', | ||
|
||
'.require-text': { | ||
fontSize: token.fontSizeLG, | ||
fontWeight: token.fontWeightStrong, | ||
lineHeight: token.lineHeightLG, | ||
color: token.colorTextDark1 | ||
}, | ||
|
||
'.require-sub-text': { | ||
fontSize: token.fontSizeSM, | ||
fontWeight: token.bodyFontWeight, | ||
lineHeight: token.lineHeightSM, | ||
color: token.colorTextDark1 | ||
} | ||
}); | ||
}); |
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
Oops, something went wrong.