From 9a5e9c03eea5db0f2ad9702334f19eae14f6dea9 Mon Sep 17 00:00:00 2001 From: WRadoslaw Date: Mon, 27 Nov 2023 15:33:28 +0100 Subject: [PATCH] Merge fixes --- .../__generated__/creatorTokens.generated.tsx | 74 +++++++++++++++++++ .../AmmTransactionsTable.tsx | 11 ++- .../studio/CrtDashboard/CrtDashboard.tsx | 14 +++- .../studio/CrtDashboard/CrtDashboard.types.ts | 2 +- 4 files changed, 95 insertions(+), 6 deletions(-) diff --git a/packages/atlas/src/api/queries/__generated__/creatorTokens.generated.tsx b/packages/atlas/src/api/queries/__generated__/creatorTokens.generated.tsx index 7d03b25ffe..14e3ad6d6d 100644 --- a/packages/atlas/src/api/queries/__generated__/creatorTokens.generated.tsx +++ b/packages/atlas/src/api/queries/__generated__/creatorTokens.generated.tsx @@ -6,6 +6,7 @@ import { BasicCreatorTokenFragmentDoc, BasicCreatorTokenHolderFragmentDoc, BasicRevenueShareFragmentDoc, + FullAmmCurveFragmentDoc, FullCreatorTokenFragmentDoc, } from './fragments.generated' @@ -329,6 +330,36 @@ export type GetHistoricalTokenAllocationQuery = { } } +export type GetFullAmmCurveQueryVariables = Types.Exact<{ + where?: Types.InputMaybe + orderBy?: Types.InputMaybe | Types.AmmCurveOrderByInput> + limit?: Types.InputMaybe + offset?: Types.InputMaybe +}> + +export type GetFullAmmCurveQuery = { + __typename?: 'Query' + ammCurves: Array<{ + __typename?: 'AmmCurve' + id: string + ammSlopeParameter: string + mintedByAmm: string + burnedByAmm: string + ammInitPrice: string + finalized: boolean + transactions: Array<{ + __typename?: 'AmmTransaction' + id: string + createdIn: number + pricePaid: string + pricePerUnit: string + transactionType: Types.AmmTransactionType + quantity: string + account: { __typename?: 'TokenAccount'; member: { __typename?: 'Membership'; id: string } } + }> + }> +} + export type GetTokenRevenueSharesQueryVariables = Types.Exact<{ where?: Types.InputMaybe limit?: Types.InputMaybe @@ -674,6 +705,49 @@ export type GetHistoricalTokenAllocationQueryResult = Apollo.QueryResult< GetHistoricalTokenAllocationQuery, GetHistoricalTokenAllocationQueryVariables > +export const GetFullAmmCurveDocument = gql` + query GetFullAmmCurve($where: AmmCurveWhereInput, $orderBy: [AmmCurveOrderByInput!], $limit: Int, $offset: Int) { + ammCurves(where: $where, orderBy: $orderBy, offset: $offset, limit: $limit) { + ...FullAmmCurve + } + } + ${FullAmmCurveFragmentDoc} +` + +/** + * __useGetFullAmmCurveQuery__ + * + * To run a query within a React component, call `useGetFullAmmCurveQuery` and pass it any options that fit your needs. + * When your component renders, `useGetFullAmmCurveQuery` returns an object from Apollo Client that contains loading, error, and data properties + * you can use to render your UI. + * + * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; + * + * @example + * const { data, loading, error } = useGetFullAmmCurveQuery({ + * variables: { + * where: // value for 'where' + * orderBy: // value for 'orderBy' + * limit: // value for 'limit' + * offset: // value for 'offset' + * }, + * }); + */ +export function useGetFullAmmCurveQuery( + baseOptions?: Apollo.QueryHookOptions +) { + const options = { ...defaultOptions, ...baseOptions } + return Apollo.useQuery(GetFullAmmCurveDocument, options) +} +export function useGetFullAmmCurveLazyQuery( + baseOptions?: Apollo.LazyQueryHookOptions +) { + const options = { ...defaultOptions, ...baseOptions } + return Apollo.useLazyQuery(GetFullAmmCurveDocument, options) +} +export type GetFullAmmCurveQueryHookResult = ReturnType +export type GetFullAmmCurveLazyQueryHookResult = ReturnType +export type GetFullAmmCurveQueryResult = Apollo.QueryResult export const GetTokenRevenueSharesDocument = gql` query GetTokenRevenueShares($where: RevenueShareWhereInput, $limit: Int, $offset: Int) { revenueShares(where: $where, limit: $limit, offset: $offset) { diff --git a/packages/atlas/src/components/_crt/AmmTransactionsTable/AmmTransactionsTable.tsx b/packages/atlas/src/components/_crt/AmmTransactionsTable/AmmTransactionsTable.tsx index d6daa6c6f0..17ca751636 100644 --- a/packages/atlas/src/components/_crt/AmmTransactionsTable/AmmTransactionsTable.tsx +++ b/packages/atlas/src/components/_crt/AmmTransactionsTable/AmmTransactionsTable.tsx @@ -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' @@ -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: , +} + type AmmTransactionsTableProps = { data: FullAmmCurveFragment['transactions'] } @@ -41,7 +48,9 @@ export const AmmTransactionsTable = ({ data }: AmmTransactionsTableProps) => { [data] ) - return + return ( + + ) } const StyledTable = styled(Table)` diff --git a/packages/atlas/src/views/studio/CrtDashboard/CrtDashboard.tsx b/packages/atlas/src/views/studio/CrtDashboard/CrtDashboard.tsx index 5c9712f540..50c8709650 100644 --- a/packages/atlas/src/views/studio/CrtDashboard/CrtDashboard.tsx +++ b/packages/atlas/src/views/studio/CrtDashboard/CrtDashboard.tsx @@ -91,15 +91,21 @@ export const CrtDashboard = () => { )} - {currentTab === 0 && ( + {currentTab === mappedTabs.findIndex((tab) => tab.name === 'Dashboard') && ( setCurrentTab(mappedTabs.findIndex((tab) => tab.name === tabName))} /> )} - {currentTab === 1 && } - {currentTab === 2 && } - {currentTab === 3 && } + {currentTab === mappedTabs.findIndex((tab) => tab.name === 'Market') && ( + + )} + {currentTab === mappedTabs.findIndex((tab) => tab.name === 'Holders') && ( + + )} + {currentTab === mappedTabs.findIndex((tab) => tab.name === 'Revenue share') && ( + + )} ) diff --git a/packages/atlas/src/views/studio/CrtDashboard/CrtDashboard.types.ts b/packages/atlas/src/views/studio/CrtDashboard/CrtDashboard.types.ts index 398033b6ab..ddbfe23603 100644 --- a/packages/atlas/src/views/studio/CrtDashboard/CrtDashboard.types.ts +++ b/packages/atlas/src/views/studio/CrtDashboard/CrtDashboard.types.ts @@ -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]