-
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.
Merge pull request #1962 from push-protocol/1957-dashboard-monetizati…
…on-flow DAPP-1957: Integrate UI for Dashboard Social Account Links (Email/Telegram/Discord)
- Loading branch information
Showing
6 changed files
with
262 additions
and
1 deletion.
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
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,89 @@ | ||
import { FC } from 'react'; | ||
|
||
import { Box, Button, Lozenge, Multiplier, RewardsBell, Star, Text } from 'blocks'; | ||
|
||
export type ClaimSocialHandlesProps = {}; | ||
|
||
const ClaimSocialHandles: FC<ClaimSocialHandlesProps> = () => { | ||
return ( | ||
<Box | ||
display="flex" | ||
justifyContent="space-between" | ||
flexDirection={{ tb: 'column' }} | ||
gap={{ tb: 'spacing-xs' }} | ||
width="100%" | ||
> | ||
<Box> | ||
<Box | ||
display="flex" | ||
flexDirection="row" | ||
alignItems="center" | ||
gap="spacing-sm" | ||
> | ||
<Text | ||
variant="h4-semibold" | ||
color="text-primary" | ||
> | ||
Get notified anywhere and earn points | ||
</Text> | ||
<Lozenge icon={<Star />}>NEW</Lozenge> | ||
</Box> | ||
<Text | ||
variant="bs-regular" | ||
color="text-tertiary" | ||
> | ||
Connect apps and receive notifications directly in your Email, Telegram and Discord | ||
</Text> | ||
</Box> | ||
|
||
<Box | ||
display="flex" | ||
flexDirection="row" | ||
alignItems="center" | ||
gap="spacing-md" | ||
> | ||
<Box | ||
display="flex" | ||
gap="spacing-xxs" | ||
alignItems="center" | ||
> | ||
<Multiplier | ||
height={28} | ||
width={31} | ||
/> | ||
<Text | ||
variant="bl-semibold" | ||
color="text-primary" | ||
> | ||
1.5x | ||
</Text> | ||
</Box> | ||
<Box | ||
display="flex" | ||
gap="spacing-xxs" | ||
alignItems="center" | ||
> | ||
<RewardsBell | ||
width={24} | ||
height={28} | ||
/> | ||
<Text | ||
variant="bm-semibold" | ||
color="text-primary" | ||
> | ||
25,000 | ||
</Text> | ||
</Box> | ||
<Button | ||
aria-label="Claim" | ||
size="small" | ||
variant="tertiary" | ||
> | ||
Claim | ||
</Button> | ||
</Box> | ||
</Box> | ||
); | ||
}; | ||
|
||
export { ClaimSocialHandles }; |
106 changes: 106 additions & 0 deletions
106
src/modules/dashboard/components/ConnectSocialHandles.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,106 @@ | ||
import { FC } from 'react'; | ||
import { css } from 'styled-components'; | ||
|
||
import { Box, Button, Dropdown, Menu, MenuItem, Text, CaretDown, OptOut } from 'blocks'; | ||
import { socialHandlesList } from '../Dashboard.constants'; | ||
import { SocialHandlesItemType } from '../Dashboard.types'; | ||
|
||
export type ConnectSocialHandlesProps = {}; | ||
|
||
const ConnectSocialHandles: FC<ConnectSocialHandlesProps> = () => { | ||
return ( | ||
<> | ||
<Box | ||
display="flex" | ||
justifyContent="space-between" | ||
flexDirection="row" | ||
gap={{ tb: 'spacing-xs' }} | ||
width="100%" | ||
> | ||
{socialHandlesList.map((item: SocialHandlesItemType) => ( | ||
<Box | ||
display="flex" | ||
flexDirection="column" | ||
border="border-sm solid stroke-secondary" | ||
padding={{ initial: 'spacing-md', ml: 'spacing-md spacing-sm', tb: 'spacing-sm', lp: 'spacing-sm' }} | ||
borderRadius="radius-md" | ||
gap="spacing-sm" | ||
width={{ | ||
initial: '290px', | ||
mm: '258px', | ||
ml: 'auto', | ||
tb: '278px', | ||
lp: '278px', | ||
}} | ||
css={css` | ||
flex-shrink: 0; | ||
`} | ||
minHeight={{ initial: 'auto', tb: '180px' }} | ||
> | ||
<Box> | ||
<Box | ||
display="flex" | ||
gap="spacing-xxs" | ||
alignItems="center" | ||
flexDirection="row" | ||
> | ||
{/* Social icons will be displayed here */} | ||
{/* Add icons according to the specified type */} | ||
<Text | ||
variant="h5-semibold" | ||
color="text-primary" | ||
> | ||
{item.heading} | ||
</Text> | ||
</Box> | ||
|
||
<Text | ||
variant="bs-regular" | ||
color="text-tertiary" | ||
> | ||
{item.description} | ||
</Text> | ||
</Box> | ||
|
||
<Box | ||
display="flex" | ||
alignItems="center" | ||
alignSelf="flex-start" | ||
> | ||
{item.isConnected ? ( | ||
<Dropdown | ||
overlay={ | ||
<Menu> | ||
<MenuItem | ||
label="Disconnect" | ||
icon={<OptOut />} | ||
/> | ||
</Menu> | ||
} | ||
> | ||
<Button | ||
variant="outline" | ||
size="small" | ||
trailingIcon={<CaretDown />} | ||
> | ||
[email protected] | ||
</Button> | ||
</Dropdown> | ||
) : ( | ||
<Button | ||
aria-label="Connect" | ||
size="small" | ||
variant="tertiary" | ||
> | ||
Connect | ||
</Button> | ||
)} | ||
</Box> | ||
</Box> | ||
))} | ||
</Box> | ||
</> | ||
); | ||
}; | ||
|
||
export { ConnectSocialHandles }; |
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,36 @@ | ||
import { FC } from 'react'; | ||
|
||
import { Box } from 'blocks'; | ||
import { ClaimSocialHandles } from './ClaimSocialHandles'; | ||
import { ConnectSocialHandles } from './ConnectSocialHandles'; | ||
import { useAccount } from 'hooks'; | ||
|
||
export type SocialHandlesProps = {}; | ||
|
||
const SocialHandles: FC<SocialHandlesProps> = () => { | ||
const { isWalletConnected } = useAccount(); | ||
|
||
// Check if the wallet is connected to the DApp. | ||
// If not, return null. If connected, return SocialHandles. | ||
if (!isWalletConnected) return null; | ||
|
||
return ( | ||
<Box | ||
borderRadius="radius-md" | ||
padding={{ ml: 'spacing-md spacing-sm', initial: 'spacing-md' }} | ||
display="flex" | ||
flexDirection="column" | ||
backgroundColor="surface-primary" | ||
gap="spacing-md" | ||
alignItems="flex-start" | ||
> | ||
{/* Render Claim based on Social Handles if wallet is connected */} | ||
<ClaimSocialHandles /> | ||
|
||
{/* Render option to connect Social Handles */} | ||
<ConnectSocialHandles /> | ||
</Box> | ||
); | ||
}; | ||
|
||
export { SocialHandles }; |