Skip to content

Commit

Permalink
Clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
WRadoslaw committed Oct 31, 2023
1 parent 8e57ad7 commit e4b8722
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 85 deletions.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,10 @@ import { formatDateTime, formatDurationShort } from '@/utils/time'

export type CrtHoldersWidgetProps = {
token: FullCreatorTokenFragment
onTabSwitch?: () => void
}

export const CrtRevenueShareWidget = ({ token }: CrtHoldersWidgetProps) => {
export const CrtRevenueShareWidget = ({ token, onTabSwitch }: CrtHoldersWidgetProps) => {
const activeRevenueShare = token.revenueShares.find((rS) => !rS.finalized)
const { convertBlockToMsTimestamp } = useBlockTimeEstimation()
const endingBlockTimestamp = convertBlockToMsTimestamp(activeRevenueShare?.endsAt ?? 0)
Expand All @@ -30,11 +31,11 @@ export const CrtRevenueShareWidget = ({ token }: CrtHoldersWidgetProps) => {

return (
<Widget
title="Holders"
title="Revenue share with holders"
titleVariant="h500"
titleColor="colorTextStrong"
customTopRightNode={
<TextButton iconPlacement="right" icon={<SvgActionChevronR />}>
<TextButton iconPlacement="right" onClick={onTabSwitch} icon={<SvgActionChevronR />}>
Show revenue shares
</TextButton>
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,12 @@ export const CrtDashboard = () => {
</>
)}
</TabsContainer>
{currentTab === 0 && <CrtDashboardMainTab token={data.creatorTokenById} />}
{currentTab === 0 && (
<CrtDashboardMainTab
token={data.creatorTokenById}
onRevenueShareDetails={() => setCurrentTab(TABS.indexOf('Revenue share'))}
/>
)}
{currentTab === 1 && <CrtHoldersTab token={data.creatorTokenById} />}
{currentTab === 2 && <CrtRevenueTab token={data.creatorTokenById} />}
</MainContainer>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import { StyledSvgJoyTokenMonochrome24 } from '@/views/studio/MyPaymentsView/Pay

type CrtDashboardMainTabProps = {
token: FullCreatorTokenFragment
onRevenueShareDetails: () => void
}

const steps: ProgressWidgetProps['steps'] = [
Expand Down Expand Up @@ -54,7 +55,7 @@ const steps: ProgressWidgetProps['steps'] = [
},
]

export const CrtDashboardMainTab = ({ token }: CrtDashboardMainTabProps) => {
export const CrtDashboardMainTab = ({ token, onRevenueShareDetails }: CrtDashboardMainTabProps) => {
const { memberId } = useUser()
const { data } = useGetCreatorTokenHoldersQuery({
variables: {
Expand Down Expand Up @@ -154,7 +155,7 @@ export const CrtDashboardMainTab = ({ token }: CrtDashboardMainTabProps) => {
</WidgetContainer>
<BigWidgetContainer>
<CrtHoldersWidget tokenId={token.id} totalSupply={+(token.totalSupply ?? 0)} />
<CrtRevenueShareWidget token={token} />
<CrtRevenueShareWidget token={token} onTabSwitch={onRevenueShareDetails} />
</BigWidgetContainer>
</>
)
Expand Down

0 comments on commit e4b8722

Please sign in to comment.