-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: add initial notification bell * update: dialect packages and bring in styling * chore: update holaplex monitoring public key * chore: bump dialect packages * chore: change network to mainnet Co-authored-by: Filipp Sher <[email protected]>
- Loading branch information
Showing
11 changed files
with
1,690 additions
and
52 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import * as React from 'react' | ||
import { SVGProps } from 'react' | ||
|
||
const SvgComponent = (props: SVGProps<SVGSVGElement>) => ( | ||
<svg | ||
viewBox="0 0 20 20" | ||
fill="none" | ||
xmlns="http://www.w3.org/2000/svg" | ||
{...props} | ||
> | ||
<path | ||
d="M15 6.667a5 5 0 0 0-10 0c0 5.833-2.5 7.5-2.5 7.5h15S15 12.5 15 6.667ZM11.442 17.5a1.666 1.666 0 0 1-2.884 0" | ||
stroke="currentColor" | ||
strokeWidth={2} | ||
strokeLinecap="round" | ||
strokeLinejoin="round" | ||
/> | ||
</svg> | ||
) | ||
|
||
export default SvgComponent |
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,22 @@ | ||
import * as React from 'react' | ||
import { SVGProps } from 'react' | ||
|
||
const SvgX = (props: SVGProps<SVGSVGElement>) => ( | ||
<svg | ||
xmlns="http://www.w3.org/2000/svg" | ||
className="x_svg__h-6 x_svg__w-6" | ||
fill="none" | ||
viewBox="-4 -4 32 32" | ||
stroke="currentColor" | ||
{...props} | ||
> | ||
<path | ||
strokeLinecap="round" | ||
strokeLinejoin="round" | ||
strokeWidth={2} | ||
d="M6 18 18 6M6 6l12 12" | ||
/> | ||
</svg> | ||
) | ||
|
||
export default SvgX |
24 changes: 24 additions & 0 deletions
24
src/components/DialectNotificationsButton/SettingsIcon.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 * as React from 'react' | ||
import { SVGProps } from 'react' | ||
|
||
const SvgComponent = (props: SVGProps<SVGSVGElement>) => ( | ||
<svg | ||
width={20} | ||
height={20} | ||
fill="none" | ||
xmlns="http://www.w3.org/2000/svg" | ||
{...props} | ||
> | ||
<path | ||
stroke="#D8D8D8" | ||
strokeWidth={2} | ||
strokeLinecap="round" | ||
d="M4 4v12M10 4v12M16 4v12" | ||
/> | ||
<rect x={8} y={11} width={4} height={4} rx={1.5} fill="#fff" /> | ||
<rect x={2} y={5} width={4} height={4} rx={1.5} fill="#fff" /> | ||
<rect x={14} y={5} width={4} height={4} rx={1.5} fill="#fff" /> | ||
</svg> | ||
) | ||
|
||
export default SvgComponent |
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,48 @@ | ||
import { | ||
defaultVariables, | ||
IncomingThemeVariables, | ||
NotificationsButton, | ||
} from '@dialectlabs/react-ui' | ||
import { useWallet } from '@solana/wallet-adapter-react' | ||
import { PublicKey } from '@solana/web3.js' | ||
import Bell from './BellIcon' | ||
import Settings from './SettingsIcon' | ||
import Close from './CloseIcon' | ||
|
||
const HOLAPLEX_MONITORING_PUBLIC_KEY = new PublicKey( | ||
'BpVYWaAPbv5vyeRxiX9PMsmAVJVoL2Lp4YtuRgjuhoZh' | ||
) | ||
|
||
export const themeVariables: IncomingThemeVariables = { | ||
dark: { | ||
colors: { | ||
bg: 'bg-gray-800', | ||
}, | ||
bellButton: | ||
'w-[48px] h-[48px] bg-gray-800 rounded-full hover:bg-gray-600 transition-transform hover:scale-[1.02]', | ||
modal: `sm:rounded-md shadow-xl shadow-neutral-900 pt-1`, | ||
icons: { | ||
bell: Bell, | ||
settings: Settings, | ||
x: Close, | ||
}, | ||
divider: `${defaultVariables.dark.divider} h-px opacity-10 mx-0`, | ||
notificationMessage: `${defaultVariables.dark.notificationMessage} bg-transparent`, | ||
notificationTimestamp: `${defaultVariables.dark.notificationTimestamp} text-left`, | ||
notificationsDivider: '', // Empty line is intentional to ovveride dt-hidden | ||
}, | ||
} | ||
|
||
export default function DialectNotificationsButton() { | ||
const wallet = useWallet() | ||
return ( | ||
<NotificationsButton | ||
wallet={wallet} | ||
publicKey={HOLAPLEX_MONITORING_PUBLIC_KEY} | ||
notifications={[{ name: 'Offer on NFT', detail: 'Event' }]} | ||
theme="dark" | ||
variables={themeVariables} | ||
network="mainnet" | ||
/> | ||
) | ||
} |
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
Oops, something went wrong.