Skip to content

Commit

Permalink
feat: add creators stake sub banner
Browse files Browse the repository at this point in the history
  • Loading branch information
teodorus-nathaniel committed Dec 19, 2023
1 parent 0cdf174 commit 70cfd16
Show file tree
Hide file tree
Showing 4 changed files with 75 additions and 0 deletions.
Binary file added public/images/subsocial-tokens.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions src/components/spaces/ViewSpace.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import MyEntityLabel from '../utils/MyEntityLabel'
import Section from '../utils/Section'
import { BareProps } from '../utils/types'
import ViewTags from '../utils/ViewTags'
import StakeSubBanner from './creators/StakeSubBanner'
import {
HiddenSpaceAlert,
OfficialSpaceStatus,
Expand Down Expand Up @@ -276,6 +277,9 @@ export const InnerViewSpace = (props: Props) => {
<PendingSpaceOwnershipPanel space={space} />
<HiddenSpaceAlert space={space} />
<Section className='pt-2'>{renderPreview()}</Section>
<Section className='mt-4'>
<StakeSubBanner />
</Section>
<Section className='DfContentPage mt-4'>
<PostPreviewsOnSpace spaceData={spaceData} posts={posts} postIds={postIds} />
</Section>
Expand Down
42 changes: 42 additions & 0 deletions src/components/spaces/creators/StakeSubBanner.module.sass
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
@import 'src/styles/subsocial-vars.scss'

.StakeSubBanner
position: relative
display: flex
border: 1px solid #6366F1
background: #EDF4FF
border-radius: $border_radius_huge
padding: $space_large
justify-content: space-between

.Content
position: relative
z-index: 1
display: flex
flex-direction: column
align-items: flex-start

.Title
font-size: $font_large
font-weight: $font_weight_medium

.Subtitle
font-size: $font_small
opacity: 0.8

.Button
border: 1px solid $color_primary
font-weight: $font_weight_medium
padding-left: $space_huge
padding-right: $space_huge

.Image
position: absolute
right: $space_normal
top: 0
height: 100%

:global(.ant-image), :global(.ant-image-img)
// width: 100%
height: 100%
object-fit: contain
29 changes: 29 additions & 0 deletions src/components/spaces/creators/StakeSubBanner.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import { Button } from 'antd'
import clsx from 'clsx'
import { ComponentProps } from 'react'
import { DfImage } from 'src/components/utils/DfImage'
import styles from './StakeSubBanner.module.sass'

export type StakeSubBannerProps = ComponentProps<'div'>

export default function StakeSubBanner({ ...props }: StakeSubBannerProps) {
return (
<div {...props} className={clsx(props.className, styles.StakeSubBanner)}>
<div className={styles.Content}>
<p className={clsx(styles.Title, 'mb-2')}>Stake SUB to this creator and earn more</p>
<p className={clsx(styles.Subtitle, 'mb-4')}>
Generate rewards for both you and this creator by staking towards them
</p>
<Button
href='https://sub.id/creators'
target='_blank'
size='large'
className={styles.Button}
>
Stake
</Button>
</div>
<DfImage src='/images/subsocial-tokens.png' className={styles.Image} />
</div>
)
}

0 comments on commit 70cfd16

Please sign in to comment.