Skip to content

Commit

Permalink
Merge fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
WRadoslaw committed Nov 27, 2023
1 parent d564254 commit 9a5e9c0
Show file tree
Hide file tree
Showing 4 changed files with 95 additions and 6 deletions.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { useMemo } from 'react'

import { FullAmmCurveFragment } from '@/api/queries/__generated__/fragments.generated'
import { SvgActionArrowBottom, SvgActionArrowTop } from '@/assets/icons'
import { SvgEmptyStateIllustration } from '@/assets/illustrations'
import { NumberFormat } from '@/components/NumberFormat'
import { Pill } from '@/components/Pill'
import { Table, TableProps } from '@/components/Table'
Expand All @@ -18,6 +19,12 @@ const COLUMNS: TableProps['columns'] = [
{ Header: 'Amount', accessor: 'amount' },
]

const tableEmptyState = {
title: 'No transactions made yet',
description: 'When any member make a transaction on your market you will see the record here',
icon: <SvgEmptyStateIllustration />,
}

type AmmTransactionsTableProps = {
data: FullAmmCurveFragment['transactions']
}
Expand All @@ -41,7 +48,9 @@ export const AmmTransactionsTable = ({ data }: AmmTransactionsTableProps) => {
[data]
)

return <StyledTable title="Market transactions" data={mappedData ?? []} columns={COLUMNS} />
return (
<StyledTable title="Market transactions" data={mappedData ?? []} columns={COLUMNS} emptyState={tableEmptyState} />
)
}

const StyledTable = styled(Table)`
Expand Down
14 changes: 10 additions & 4 deletions packages/atlas/src/views/studio/CrtDashboard/CrtDashboard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -91,15 +91,21 @@ export const CrtDashboard = () => {
</>
)}
</TabsContainer>
{currentTab === 0 && (
{currentTab === mappedTabs.findIndex((tab) => tab.name === 'Dashboard') && (
<CrtDashboardMainTab
token={data.creatorTokenById}
onTabChange={(tabName) => setCurrentTab(mappedTabs.findIndex((tab) => tab.name === tabName))}
/>
)}
{currentTab === 1 && <CrtMarketTab token={data.creatorTokenById} />}
{currentTab === 2 && <CrtHoldersTab token={data.creatorTokenById} />}
{currentTab === 3 && <CrtRevenueTab token={data.creatorTokenById} />}
{currentTab === mappedTabs.findIndex((tab) => tab.name === 'Market') && (
<CrtMarketTab token={data.creatorTokenById} />
)}
{currentTab === mappedTabs.findIndex((tab) => tab.name === 'Holders') && (
<CrtHoldersTab token={data.creatorTokenById} />
)}
{currentTab === mappedTabs.findIndex((tab) => tab.name === 'Revenue share') && (
<CrtRevenueTab token={data.creatorTokenById} />
)}
</MainContainer>
</LimitedWidthContainer>
)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export const TABS = ['Dashboard', 'Holders', 'Revenue share'] as const
export const TABS = ['Dashboard', 'Market', 'Holders', 'Revenue share'] as const
export type CrtTabs = typeof TABS[number]

0 comments on commit 9a5e9c0

Please sign in to comment.