forked from MystenLabs/sui
-
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.
add Request Testnet SUI on Discord button (MystenLabs#8042)
- Added request token from Discord - added Plausible event tracking https://user-images.githubusercontent.com/8676844/216609502-4d1934ea-d63c-4a06-a4dc-4643058e4efe.mov
- Loading branch information
Showing
4 changed files
with
66 additions
and
8 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
45 changes: 45 additions & 0 deletions
45
apps/wallet/src/ui/app/shared/faucet/request-button/FaucetDiscordLink.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,45 @@ | ||
// Copyright (c) Mysten Labs, Inc. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
import { ArrowUpRight16 } from '@mysten/icons'; | ||
import cl from 'classnames'; | ||
|
||
import ExternalLink from '_components/external-link'; | ||
import { trackEvent } from '_shared/plausible'; | ||
|
||
import type { ButtonProps } from '_app/shared/button'; | ||
|
||
//TODO: Remove delete this file after testnet | ||
const TESTNET_DISCORD_LINK = | ||
'https://discord.com/channels/916379725201563759/1037811694564560966'; | ||
|
||
export function FaucetDiscordLink({ | ||
mode = 'primary', | ||
trackEventSource, | ||
}: { | ||
mode?: ButtonProps['mode']; | ||
trackEventSource: 'home' | 'settings'; | ||
}) { | ||
return ( | ||
<ExternalLink | ||
className={cl( | ||
'flex flex-nowrap max-w-full items-center justify-center rounded-xl px-5 py-3.5 gap-2 no-underline font-semibold text-body', | ||
mode === 'primary' | ||
? 'bg-hero-dark text-white hover:bg-hero' | ||
: 'bg-white text-steel border-solid border-color-steel border hover:border-color-steel-dark hover:text-steel-dark' | ||
)} | ||
href={TESTNET_DISCORD_LINK} | ||
showIcon={false} | ||
onClick={() => | ||
trackEvent('DiscordRequestSUIToken', { | ||
props: { source: trackEventSource }, | ||
}) | ||
} | ||
> | ||
Request Testnet SUI on Discord | ||
<ArrowUpRight16 | ||
className={cl(mode === 'primary' ? 'text-white' : 'text-steel')} | ||
/> | ||
</ExternalLink> | ||
); | ||
} |
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