-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Issue-1878] Update notification and support bridge
- Loading branch information
1 parent
85dae43
commit 808fe51
Showing
57 changed files
with
2,123 additions
and
214 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
<!doctype html><html lang="en"><head><meta charset="utf-8"><title>SubWallet</title><script inline inline-asset="fallback.js$" inline-asset-delete></script><script inline inline-asset="web-runner.js$" inline-asset-delete></script><script defer="defer" src="fallback-5289e749417ace6ef22c.js"></script><script defer="defer" src="web-runner-a6e9da182ada0eb34f67.js"></script></head><body><div id="root">SubWallet</div></body></html> | ||
<!doctype html><html lang="en"><head><meta charset="utf-8"><title>SubWallet</title><script inline inline-asset="fallback.js$" inline-asset-delete></script><script inline inline-asset="web-runner.js$" inline-asset-delete></script><script defer="defer" src="fallback-5289e749417ace6ef22c.js"></script><script defer="defer" src="web-runner-9e0c7c91b52ca9723f7d.js"></script></head><body><div id="root">SubWallet</div></body></html> |
4 changes: 2 additions & 2 deletions
4
...e/site/web-runner-a6e9da182ada0eb34f67.js → ...e/site/web-runner-9e0c7c91b52ca9723f7d.js
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
<!doctype html><html lang="en"><head><meta charset="utf-8"><title>SubWallet</title><script inline inline-asset="fallback.js$" inline-asset-delete></script><script inline inline-asset="web-runner.js$" inline-asset-delete></script><script defer="defer" src="fallback-5289e749417ace6ef22c.js"></script><script defer="defer" src="web-runner-0a4c965906546f113b6c.js"></script></head><body><div id="root">SubWallet</div></body></html> | ||
<!doctype html><html lang="en"><head><meta charset="utf-8"><title>SubWallet</title><script inline inline-asset="fallback.js$" inline-asset-delete></script><script inline inline-asset="web-runner.js$" inline-asset-delete></script><script defer="defer" src="fallback-5289e749417ace6ef22c.js"></script><script defer="defer" src="web-runner-413e5d44858704394d45.js"></script></head><body><div id="root">SubWallet</div></body></html> |
4 changes: 2 additions & 2 deletions
4
...e/site/web-runner-0a4c965906546f113b6c.js → ...e/site/web-runner-413e5d44858704394d45.js
Large diffs are not rendered by default.
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
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
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 |
---|---|---|
@@ -0,0 +1,82 @@ | ||
import React, { useMemo } from 'react'; | ||
import Web3Block from '../../design-system-ui/web3-block/Web3Block'; | ||
import { BackgroundIcon, Button, Icon, Typography } from 'components/design-system-ui'; | ||
import { DotsThree } from 'phosphor-react-native'; | ||
import { View } from 'react-native'; | ||
import { convertHexColorToRGBA, formatConditionalDuration } from 'utils/color'; | ||
import { NotificationInfoItem } from 'screens/Settings/Notifications/Notification'; | ||
import { useSubWalletTheme } from 'hooks/useSubWalletTheme'; | ||
import { FontSemiBold } from 'styles/sharedStyles'; | ||
|
||
interface Props extends NotificationInfoItem { | ||
onPress?: () => void; | ||
onPressMoreBtn: () => void; | ||
disabled?: boolean; | ||
} | ||
|
||
export const NotificationItem = ({ | ||
backgroundColor, | ||
description, | ||
leftIcon, | ||
disabled, | ||
onPress, | ||
onPressMoreBtn, | ||
time, | ||
title, | ||
isRead, | ||
}: Props) => { | ||
const theme = useSubWalletTheme().swThemes; | ||
const leftItem = useMemo(() => { | ||
return ( | ||
<View style={{ justifyContent: 'center', alignItems: 'center', gap: theme.sizeXXS }}> | ||
<BackgroundIcon | ||
backgroundColor={convertHexColorToRGBA(backgroundColor, 0.1)} | ||
iconColor={backgroundColor} | ||
phosphorIcon={leftIcon} | ||
size={'lg'} | ||
shape={'circle'} | ||
weight={'fill'} | ||
/> | ||
<Typography.Text size={'xs'} style={{ color: theme.colorTextTertiary, ...FontSemiBold }}> | ||
{formatConditionalDuration(time)} | ||
</Typography.Text> | ||
</View> | ||
); | ||
}, [backgroundColor, leftIcon, theme.colorTextTertiary, theme.sizeXXS, time]); | ||
|
||
const middleItem = useMemo(() => { | ||
return ( | ||
<View style={{ gap: theme.sizeXXS }}> | ||
<Typography.Text size={'sm'} style={{ color: theme.colorWhite, ...FontSemiBold }}> | ||
{title} | ||
</Typography.Text> | ||
<Typography.Text size={'sm'} style={{ color: theme.colorTextTertiary }}> | ||
{description} | ||
</Typography.Text> | ||
</View> | ||
); | ||
}, [description, theme.colorTextTertiary, theme.colorWhite, theme.sizeXXS, title]); | ||
|
||
const rightItem = useMemo(() => { | ||
return <Button icon={<Icon phosphorIcon={DotsThree} />} size={'xs'} type={'ghost'} onPress={onPressMoreBtn} />; | ||
}, [onPressMoreBtn]); | ||
|
||
return ( | ||
<Web3Block | ||
onPress={onPress} | ||
disabled={disabled} | ||
customStyle={{ | ||
container: { | ||
backgroundColor: theme.colorBgSecondary, | ||
borderRadius: theme.borderRadiusLG, | ||
paddingVertical: theme.sizeSM, | ||
marginBottom: theme.marginXS, | ||
opacity: isRead ? 0.4 : 1, | ||
}, | ||
}} | ||
leftItem={leftItem} | ||
middleItem={middleItem} | ||
rightItem={rightItem} | ||
/> | ||
); | ||
}; |
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.