-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add Notifi * remove discord & change cratio save button * ui fixes * Deps * Dont rely on connector * Hide notification icon when in delegate mode * Prettier * Lazy load notificard * update version, split chains (#973) * update version, split chains * add unread counter * fix history icon alignment (#985) * update version, split chains * add unread counter * align history icons * Update notifi.css * update npm package * Fix deps * Node v16 is deprecated * yarn pretty:fix * Lint issues * add discord support (#987) * upgrade sdk (#991) * deps --------- Co-authored-by: Haoqian-Zheng <haoqian.zheng@gmail.com>
- Loading branch information
1 parent
28c0c40
commit a2d7221
Showing
27 changed files
with
2,147 additions
and
7 deletions.
There are no files selected for viewing
Binary file added
BIN
+133 KB
.yarn/cache/@notifi-network-notifi-axios-adapter-npm-0.86.0-fd2b0b19a2-59115912e1.zip
Binary file not shown.
Binary file added
BIN
+18 KB
.yarn/cache/@notifi-network-notifi-axios-utils-npm-0.86.0-d3a9133501-a510d0bb14.zip
Binary file not shown.
Binary file added
BIN
+106 KB
.yarn/cache/@notifi-network-notifi-core-npm-0.86.0-314a7e7553-55263fc642.zip
Binary file not shown.
Binary file added
BIN
+53.4 KB
.yarn/cache/@notifi-network-notifi-frontend-client-npm-0.86.0-4c90045f4d-3b2943444e.zip
Binary file not shown.
Binary file added
BIN
+116 KB
.yarn/cache/@notifi-network-notifi-graphql-npm-0.86.0-7468ee3eb2-c312a29b92.zip
Binary file not shown.
Binary file added
BIN
+523 KB
.yarn/cache/@notifi-network-notifi-react-card-npm-0.86.0-cac9927206-996138e513.zip
Binary file not shown.
Binary file added
BIN
+61.1 KB
.yarn/cache/@notifi-network-notifi-react-hooks-npm-0.86.0-9f0c5e9c6e-c0aae8315e.zip
Binary file not shown.
Binary file added
BIN
+28.9 KB
.yarn/cache/@virtuoso.dev-react-urx-npm-0.2.13-778c2d6bbd-173e91c21f.zip
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
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,70 @@ | ||
import { | ||
NotifiInputFieldsText, | ||
NotifiInputSeparators, | ||
NotifiSubscriptionCard, | ||
} from '@notifi-network/notifi-react-card'; | ||
import './notifi.css'; | ||
import React, { useContext } from 'react'; | ||
import { ContractContext } from '@snx-v2/ContractContext'; | ||
import { NetworkIdByName } from '@snx-v2/useSynthetixContracts'; | ||
|
||
const isTestnet = (networkId: null | number) => { | ||
if (networkId === NetworkIdByName['mainnet-ovm'] || networkId === NetworkIdByName['mainnet']) { | ||
return false; | ||
} | ||
return true; | ||
}; | ||
export const NotifiCard: React.FC<{ onClose: () => void }> = ({ onClose }) => { | ||
const { networkId, walletAddress } = useContext(ContractContext); | ||
if (walletAddress === null || networkId === null) { | ||
// account is required | ||
return null; | ||
} | ||
const isL2 = networkId === NetworkIdByName['mainnet-ovm']; | ||
const isMainnet = !isTestnet(networkId); | ||
|
||
const cardId = isMainnet | ||
? isL2 | ||
? '283fa53b4b8e4ed1a2234615bf01d240' | ||
: '5ece3cd3ec504576b10ab396d619dc9b' | ||
: '8a569abd38974f76837960bd9bf36049'; | ||
|
||
const inputLabels: NotifiInputFieldsText = { | ||
label: {}, | ||
placeholderText: { | ||
email: 'Email address', | ||
telegram: 'Telegram ID', | ||
}, | ||
}; | ||
|
||
const inputSeparators: NotifiInputSeparators = { | ||
emailSeparator: { | ||
content: 'OR', | ||
}, | ||
telegramSeparator: { | ||
content: 'OR', | ||
}, | ||
}; | ||
|
||
return ( | ||
<NotifiSubscriptionCard | ||
cardId={cardId} | ||
inputLabels={inputLabels} | ||
inputSeparators={inputSeparators} | ||
inputs={{ userWallet: walletAddress }} | ||
copy={{ | ||
FetchedStateCard: { | ||
SubscriptionCardV1: { | ||
EditCard: { | ||
AlertListPreview: { | ||
description: 'Get real-time alerts to the destinations of your choice', | ||
}, | ||
}, | ||
}, | ||
}, | ||
}} | ||
darkMode | ||
onClose={onClose} | ||
/> | ||
); | ||
}; |
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,3 @@ | ||
import { NotifiCard } from './NotifiCard'; | ||
export { NotifiCard } from './NotifiCard'; | ||
export default NotifiCard; |
Oops, something went wrong.
a2d7221
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
v2-storybook – ./v2/ui
v2-storybook-git-master-synthetixio.vercel.app
staking-storybook.vercel.app
v2-storybook-synthetixio.vercel.app