forked from Joystream/atlas
-
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.
Merge branch 'crt' into feature/token-preview
# Conflicts: # packages/atlas/src/api/schemas/orion.json # packages/atlas/src/joystream-lib/extrinsics.ts # packages/atlas/src/views/studio/CrtDashboard/CrtDashboard.tsx # packages/atlas/src/views/studio/CrtDashboard/tabs/CrtDashboardMainTab.tsx # packages/atlas/src/views/studio/CrtDashboard/tabs/CrtRevenueTab.tsx
- Loading branch information
Showing
15 changed files
with
364 additions
and
11 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
17 changes: 17 additions & 0 deletions
17
packages/atlas/src/assets/illustrations/PatternAngledLines.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,17 @@ | ||
// THIS FILE WAS AUTOGENERATED BY SVGR. DO NOT MODIFY IT MANUALLY; | ||
import { Ref, SVGProps, forwardRef, memo } from 'react' | ||
|
||
const SvgPatternAngledLines = forwardRef((props: SVGProps<SVGSVGElement>, ref: Ref<SVGSVGElement>) => ( | ||
<svg width={72} height={72} viewBox="0 0 72 72" fill="none" xmlns="http://www.w3.org/2000/svg" ref={ref} {...props}> | ||
<path | ||
fillRule="evenodd" | ||
clipRule="evenodd" | ||
d="M72 66.36V72h-5.64L0 5.64V0h5.64L72 66.36ZM0 17.28v11.255L43.466 72H54.72L0 17.28Zm0 33.64V39.6L32.4 72H21.08L0 50.92ZM0 72h10.08L0 61.92V72ZM17.28 0h11.254L72 43.465V54.72L17.28 0Zm33.64 0H39.6L72 32.4V21.08L50.92 0ZM72 10.08 61.92 0H72v10.08Z" | ||
fill="#BBD9F6" | ||
fillOpacity={0.13} | ||
/> | ||
</svg> | ||
)) | ||
SvgPatternAngledLines.displayName = 'SvgPatternAngledLines' | ||
const Memo = memo(SvgPatternAngledLines) | ||
export { Memo as SvgPatternAngledLines } |
21 changes: 21 additions & 0 deletions
21
packages/atlas/src/assets/illustrations/PatternCircleLines.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,21 @@ | ||
// THIS FILE WAS AUTOGENERATED BY SVGR. DO NOT MODIFY IT MANUALLY; | ||
import { Ref, SVGProps, forwardRef, memo } from 'react' | ||
|
||
const SvgPatternCircleLines = forwardRef((props: SVGProps<SVGSVGElement>, ref: Ref<SVGSVGElement>) => ( | ||
<svg width={72} height={72} viewBox="0 0 72 72" fill="none" xmlns="http://www.w3.org/2000/svg" ref={ref} {...props}> | ||
<g clipPath="url(#clip0_2659_1145)" fill="#BBD9F6" fillOpacity={0.13}> | ||
<path d="M0 .027V8.03C34.861 9.067 62.933 37.139 63.97 72h8.004C70.93 32.72 39.28 1.069 0 .027Z" /> | ||
<path d="M55.966 72C54.935 41.557 30.443 17.065 0 16.034v8.005C26.024 25.063 46.937 45.976 47.96 72h8.006Z" /> | ||
<path d="M40 72c0-22.091-17.909-40-40-40v8c17.673 0 32 14.327 32 32h8Z" /> | ||
<path d="M24 72c0-13.255-10.745-24-24-24v8c8.837 0 16 7.163 16 16h8ZM8 72a8 8 0 0 0-8-8v8h8Z" /> | ||
</g> | ||
<defs> | ||
<clipPath id="clip0_2659_1145"> | ||
<path fill="#fff" d="M0 0h72v72H0z" /> | ||
</clipPath> | ||
</defs> | ||
</svg> | ||
)) | ||
SvgPatternCircleLines.displayName = 'SvgPatternCircleLines' | ||
const Memo = memo(SvgPatternCircleLines) | ||
export { Memo as SvgPatternCircleLines } |
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
3 changes: 3 additions & 0 deletions
3
packages/atlas/src/assets/illustrations/svgs/pattern-angled-lines.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 14 additions & 0 deletions
14
packages/atlas/src/assets/illustrations/svgs/pattern-circle-lines.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
179 changes: 179 additions & 0 deletions
179
packages/atlas/src/components/_crt/SaleMarketChoiceDrawer/SaleMarketChoiceDrawer.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,179 @@ | ||
import styled from '@emotion/styled' | ||
import { ReactElement } from 'react' | ||
|
||
import { SvgActionCheck, SvgActionPlay } from '@/assets/icons' | ||
import { SvgPatternAngledLines, SvgPatternCircleLines } from '@/assets/illustrations' | ||
import { FlexBox } from '@/components/FlexBox' | ||
import { GridItem, LayoutGrid } from '@/components/LayoutGrid' | ||
import { Text } from '@/components/Text' | ||
import { Button } from '@/components/_buttons/Button' | ||
import { BottomDrawer } from '@/components/_overlays/BottomDrawer' | ||
import { useMediaMatch } from '@/hooks/useMediaMatch' | ||
import { cVar, media, sizes, square } from '@/styles' | ||
|
||
const SALE_POINTS = [ | ||
{ | ||
title: 'Direct revenue', | ||
description: 'Earn money directly from your sale.', | ||
}, | ||
{ | ||
title: 'Urgency', | ||
description: | ||
'Create an event with a clear end date to get everyone focused on one big event, get greater participation and excitement.', | ||
}, | ||
] | ||
|
||
const MARKET_POINTS = [ | ||
{ | ||
title: 'Liquidity', | ||
description: 'You, and everyone else, can buy and sell at any time.', | ||
}, | ||
{ | ||
title: 'Urgency', | ||
description: | ||
'Your AMM will be open all the time until you close it manually - this will be possible only if you have enough of your own tokens to do it.', | ||
}, | ||
] | ||
|
||
type SaleMarketChoiceDrawerProps = { | ||
isOpen: boolean | ||
onClose: () => void | ||
onMarketChoice: () => void | ||
} | ||
|
||
export const SaleMarketChoiceDrawer = ({ isOpen, onClose, onMarketChoice }: SaleMarketChoiceDrawerProps) => { | ||
const smMatch = useMediaMatch('sm') | ||
return ( | ||
<StyledBottomDrawer isOpen={isOpen} onClose={onClose} title="Start sale or market"> | ||
<StyledLayoutGrid> | ||
<GridItem colSpan={{ base: 12, lg: 10, xl: 8, xxl: 6 }} colStart={{ lg: 2, xl: 3, xxl: 4 }}> | ||
<FlexBox gap={14} flow="column"> | ||
<FlexBox gap={2} flow="column"> | ||
<Text variant="h700" as="h1"> | ||
Start sale or market | ||
</Text> | ||
<Text variant="t300" color="colorText" as="p"> | ||
Sell your pre-minted tokens or open market for anyone to buy and sell your token. | ||
</Text> | ||
</FlexBox> | ||
<FlexBox flow={smMatch ? 'row' : 'column'} alignItems="strech" width="100%" gap={6}> | ||
<OptionCard | ||
title="Sale" | ||
description="A sale is a way to raise money for a new project by selling a certain number of tokens to the public at a set price over a certain period." | ||
points={SALE_POINTS} | ||
actionButton={{ | ||
text: 'Start sale', | ||
onClick: () => undefined, | ||
disabled: true, | ||
}} | ||
icon={<SvgPatternCircleLines />} | ||
/> | ||
<OptionCard | ||
title="Market" | ||
description="An automated market maker (AMM) is an algorithm that helps to buy and sell tokens by using price curves which automatically set prices and match buyers and sellers." | ||
points={MARKET_POINTS} | ||
actionButton={{ | ||
text: 'Start market', | ||
onClick: onMarketChoice, | ||
}} | ||
icon={<SvgPatternAngledLines />} | ||
/> | ||
</FlexBox> | ||
</FlexBox> | ||
</GridItem> | ||
</StyledLayoutGrid> | ||
</StyledBottomDrawer> | ||
) | ||
} | ||
|
||
type OptionCardProps = { | ||
title: string | ||
description: string | ||
points: { | ||
title: string | ||
description: string | ||
}[] | ||
actionButton: { | ||
text: string | ||
onClick: () => void | ||
disabled?: boolean | ||
} | ||
icon: ReactElement | ||
} | ||
|
||
const OptionCard = ({ title, description, points, actionButton, icon }: OptionCardProps) => { | ||
return ( | ||
<OptionCardWrapper> | ||
<FlexBox flow="column" gap={4}> | ||
{icon} | ||
<FlexBox gap={4} alignItems="center"> | ||
<Text variant="h600" as="h1"> | ||
{title} | ||
</Text> | ||
<Button _textOnly icon={<SvgActionPlay />}> | ||
Learn more | ||
</Button> | ||
</FlexBox> | ||
<Text variant="t300" as="h1" color="colorText"> | ||
{description} | ||
</Text> | ||
</FlexBox> | ||
|
||
<FlexBox flow="column" gap={6}> | ||
{points.map((point, idx) => ( | ||
<FlexBox gap={4} key={idx}> | ||
<CheckWrapper> | ||
<SvgActionCheck /> | ||
</CheckWrapper> | ||
<FlexBox flow="column"> | ||
<Text variant="h300" as="h1" color="colorTextStrong"> | ||
{point.title} | ||
</Text> | ||
<Text variant="t200" as="p" color="colorText"> | ||
{point.description} | ||
</Text> | ||
</FlexBox> | ||
</FlexBox> | ||
))} | ||
</FlexBox> | ||
|
||
<Button fullWidth onClick={actionButton.onClick} disabled={actionButton.disabled}> | ||
{actionButton.text} | ||
</Button> | ||
</OptionCardWrapper> | ||
) | ||
} | ||
|
||
const CheckWrapper = styled.div` | ||
display: grid; | ||
place-items: center; | ||
padding: ${sizes(1)}; | ||
background-color: ${cVar('colorBackgroundMutedAlpha')}; | ||
border-radius: 50%; | ||
` | ||
|
||
const OptionCardWrapper = styled.div` | ||
display: grid; | ||
flex: 1; | ||
grid-template-rows: auto 1fr auto; | ||
gap: ${sizes(12)}; | ||
padding: ${sizes(8)}; | ||
background-color: ${cVar('colorBackgroundMutedAlpha')}; | ||
> * > svg { | ||
${square(56)}; | ||
} | ||
` | ||
|
||
const StyledBottomDrawer = styled(BottomDrawer)` | ||
top: 0; | ||
height: 100vh; | ||
` | ||
|
||
const StyledLayoutGrid = styled(LayoutGrid)` | ||
padding: ${sizes(20)} ${sizes(4)}; | ||
${media.md} { | ||
padding: ${sizes(20)} ${sizes(8)}; | ||
} | ||
` |
1 change: 1 addition & 0 deletions
1
packages/atlas/src/components/_crt/SaleMarketChoiceDrawer/index.ts
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 @@ | ||
export * from './SaleMarketChoiceDrawer' |
Oops, something went wrong.