Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sync production branch with main #671

Merged
merged 67 commits into from
Jun 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
67 commits
Select commit Hold shift + click to select a range
aa9dd86
add logic for 4 flow to prove ownership
marc-aurele-besner Jun 18, 2024
5ca3766
improve typing and remove signature flow
marc-aurele-besner Jun 19, 2024
bd47618
add faunadb
marc-aurele-besner Jun 20, 2024
cfcb849
save user token
marc-aurele-besner Jun 20, 2024
f64f35d
save&update user profile
marc-aurele-besner Jun 20, 2024
355407d
add new env
marc-aurele-besner Jun 20, 2024
743c845
renaming operator section -> staking
marc-aurele-besner Jun 21, 2024
f649467
do changes in other files consuming these route
marc-aurele-besner Jun 21, 2024
f806147
change apps/ directory to use staking/ route
marc-aurele-besner Jun 21, 2024
7f07dff
change stake route to register
marc-aurele-besner Jun 21, 2024
4948ead
change route title in staking header
marc-aurele-besner Jun 21, 2024
fb0d27c
Hide Stake wars section #642
marc-aurele-besner Jun 21, 2024
30239a6
Rename `Add funds` to `Nominating` #643
marc-aurele-besner Jun 21, 2024
40d1f92
Add suggestion to name the action 'Nominate'
marc-aurele-besner Jun 21, 2024
6960bdb
Merge branch 'main' into 638-change-operators-for-staking
marc-aurele-besner Jun 21, 2024
5957920
remove wallet flow and improve error handling
marc-aurele-besner Jun 21, 2024
8cc8626
Merge branch 'main' into 588-add-proof-of-ownership-for-register_oper…
marc-aurele-besner Jun 21, 2024
fcd9822
fix build errors
marc-aurele-besner Jun 21, 2024
533d1cb
Merge branch '588-add-proof-of-ownership-for-register_operator-flow-i…
marc-aurele-besner Jun 21, 2024
345ef79
Merge branch 'main' into 638-change-operators-for-staking
marc-aurele-besner Jun 22, 2024
7795316
Merge pull request #648 from subspace/638-change-operators-for-staking
marc-aurele-besner Jun 22, 2024
d9f3e07
Merge branch 'main' into 636-create-permanent-relation-to-avoid-the-s…
marc-aurele-besner Jun 22, 2024
668c53e
reduce code duplication with reusable function
marc-aurele-besner Jun 22, 2024
78e9d1a
Merge branch '636-create-permanent-relation-to-avoid-the-same-wallet-…
marc-aurele-besner Jun 22, 2024
7e93479
Merge pull request #647 from subspace/636-create-permanent-relation-t…
marc-aurele-besner Jun 22, 2024
b38c343
improve code redundance, add step 2 connect wallet and add account ty…
marc-aurele-besner Jun 22, 2024
1aef7a2
Merge branch 'main' into 588-add-proof-of-ownership-for-register_oper…
marc-aurele-besner Jun 22, 2024
ef4ba1c
add label back
marc-aurele-besner Jun 22, 2024
fe9c4a7
add WalletType and WalletAccountWithType
marc-aurele-besner Jun 22, 2024
975aaaa
use new type in provider and wallet dropdown
marc-aurele-besner Jun 22, 2024
54e283b
protect consensus call and query to be run on ethereum type
marc-aurele-besner Jun 22, 2024
6256fe3
protect ui element not made for ethereum type
marc-aurele-besner Jun 22, 2024
72a66d9
improve wallet sidekick to open with limited features if on evm walle…
marc-aurele-besner Jun 22, 2024
fb2d2fa
add footer component to MainLayout
marc-aurele-besner Jun 22, 2024
1b8c0bc
extend chain type with token details
marc-aurele-besner Jun 22, 2024
373608b
remove unused constant
marc-aurele-besner Jun 22, 2024
8d4723f
use constant token symbol instead hardcoded one
marc-aurele-besner Jun 22, 2024
ee55bea
add token symbol next to amount field label
marc-aurele-besner Jun 22, 2024
e1ddd0a
Change Subspace logo for Autonomys logo
marc-aurele-besner Jun 22, 2024
bf21c3b
add autonomys as know word
marc-aurele-besner Jun 22, 2024
8ebb85b
fix sorting errors by only showing sorting option on sortable column
marc-aurele-besner Jun 22, 2024
2a15730
add ListCard component to handle list of card the similarly to Deskto…
marc-aurele-besner Jun 23, 2024
ce64ae3
implement the use of ListCard if mobileComponent is undefined
marc-aurele-besner Jun 23, 2024
d7f0708
implement default mobileComponent for NewTable in staking section
marc-aurele-besner Jun 23, 2024
4c527c4
switch operator detail nominator list to use NewTable
marc-aurele-besner Jun 23, 2024
088122f
remove mobileComponent everywhere
marc-aurele-besner Jun 23, 2024
d3a31dd
fix build and lint warnings
marc-aurele-besner Jun 23, 2024
922b377
change token constant back to tSSC
marc-aurele-besner Jun 24, 2024
fb684c5
Merge pull request #655 from subspace/654-astral-account-type-support
marc-aurele-besner Jun 24, 2024
d03fd44
change tATC by tSSC
marc-aurele-besner Jun 24, 2024
bd11e17
Merge branch 'main' into 588-add-proof-of-ownership-for-register_oper…
marc-aurele-besner Jun 24, 2024
f0fe8f9
Merge branch 'main' into 637-add-footer-components-with-backlink
marc-aurele-besner Jun 24, 2024
571f486
Merge pull request #656 from subspace/637-add-footer-components-with-…
marc-aurele-besner Jun 24, 2024
92eefc1
Merge branch 'main' into 588-add-proof-of-ownership-for-register_oper…
marc-aurele-besner Jun 24, 2024
5fc6bb7
Merge branch 'main' into 658-change-the-subspace-logo-for-the-autonom…
marc-aurele-besner Jun 24, 2024
e2cc795
Merge pull request #661 from subspace/658-change-the-subspace-logo-fo…
marc-aurele-besner Jun 24, 2024
00f418d
Merge branch 'main' into 644-add-the-type-next-to-each-field-descript…
marc-aurele-besner Jun 24, 2024
71864d4
Merge pull request #657 from subspace/644-add-the-type-next-to-each-f…
marc-aurele-besner Jun 24, 2024
1dbd62d
Merge branch 'main' into 588-add-proof-of-ownership-for-register_oper…
marc-aurele-besner Jun 24, 2024
4880650
Merge branch '588-add-proof-of-ownership-for-register_operator-flow-i…
marc-aurele-besner Jun 24, 2024
aa21efb
Merge pull request #632 from subspace/588-add-proof-of-ownership-for-…
marc-aurele-besner Jun 24, 2024
40c0da1
Merge branch 'main' into 640-sorting-is-broken-in-operators-section
marc-aurele-besner Jun 24, 2024
97b6047
Merge pull request #662 from subspace/640-sorting-is-broken-in-operat…
marc-aurele-besner Jun 24, 2024
dcb919a
Merge branch 'main' into 663-improve-newtable-component-to-automatica…
marc-aurele-besner Jun 24, 2024
39c7cc2
Merge pull request #664 from subspace/663-improve-newtable-component-…
marc-aurele-besner Jun 24, 2024
ebd62df
fix small bug that creped in during merge conflict
marc-aurele-besner Jun 25, 2024
661a9bd
Merge pull request #669 from subspace/bug/registerWithSeed
marc-aurele-besner Jun 25, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .vscode/astral.code-workspace
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
"typescript.format.insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis": true,
"editor.formatOnSave": true,
"cSpell.words": [
"autonomys",
"extrinsics",
"gemini",
"graphiql",
Expand Down
1 change: 1 addition & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"typescript.format.insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis": true,
"editor.formatOnSave": true,
"cSpell.words": [
"autonomys",
"extrinsics",
"gemini",
"graphiql",
Expand Down
2 changes: 2 additions & 0 deletions explorer/.env.sample
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ NEXT_PUBLIC_PUBLIC_URL='/'
NEXTAUTH_SECRET='secret-key-1234'
NEXTAUTH_URL='http://localhost:3000/'

FAUNA_DB_SECRET="<fauna-db-secret>"

# Google Analytics ID
GA_MEASUREMENT_ID=G-
NEXT_PUBLIC_GOOGLE_ANALYTICS_ID='G-'
Expand Down
8 changes: 7 additions & 1 deletion explorer/next-auth.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import type { Expr } from 'faunadb'
import 'next-auth'
import { DiscordToken, SubspaceToken } from 'types/jwt'
import type { DiscordToken, SubspaceToken } from 'types/jwt'

// Extending the 'next-auth' module to include custom user and session types
declare module 'next-auth' {
Expand All @@ -16,6 +17,11 @@ declare module 'next-auth' {
user: User | null
token: string
}

export interface SavedUser extends User {
createdAt: Expr
updatedAt: Expr
}
}

// Extending the 'next-auth/client' module for client-side usage
Expand Down
1 change: 1 addition & 0 deletions explorer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
"@vercel/og": "^0.6.2",
"dayjs": "^1.11.10",
"ethers": "^6.11.1",
"faunadb": "^4.8.0",
"formik": "^2.4.5",
"graphql": "^16.6.0",
"js-cookie": "^3.0.5",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,6 @@ function Screen({
accountById: AccountByIdQuery['accountById']
}) {
dayjs.extend(relativeTime)
console.log('chainMatch', chainMatch)
console.log('accountId', accountId)
console.log('accountById', accountById)

const account = {
total: accountById?.total ?? '0',
Expand Down Expand Up @@ -128,23 +125,24 @@ function Screen({
}}
tw='absolute text-xl text-white p-4 ml-30 font-bold'
>
Total {numberWithCommas(bigNumberToNumber(account.total))} tSSC
Total {numberWithCommas(bigNumberToNumber(account.total))} ({chainMatch.token.symbol})
</span>
<span
style={{
fontFamily: 'Montserrat',
}}
tw='absolute text-xl text-white p-4 ml-30 mt-8 font-bold'
>
Reserved {numberWithCommas(bigNumberToNumber(account.reserved))} tSSC
Reserved {numberWithCommas(bigNumberToNumber(account.reserved))} (
{chainMatch.token.symbol})
</span>
<span
style={{
fontFamily: 'Montserrat',
}}
tw='absolute text-xl text-white p-4 ml-30 mt-16 font-bold'
>
Free {numberWithCommas(bigNumberToNumber(account.free))} tSSC
Free {numberWithCommas(bigNumberToNumber(account.free))} ({chainMatch.token.symbol})
</span>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,23 +128,24 @@ function Screen({
}}
tw='absolute text-xl text-white p-4 ml-30 font-bold'
>
Total {numberWithCommas(bigNumberToNumber(account.total))} tSSC
Total {numberWithCommas(bigNumberToNumber(account.total))} ({chainMatch.token.symbol})
</span>
<span
style={{
fontFamily: 'Montserrat',
}}
tw='absolute text-xl text-white p-4 ml-30 mt-8 font-bold'
>
Reserved {numberWithCommas(bigNumberToNumber(account.reserved))} tSSC
Reserved {numberWithCommas(bigNumberToNumber(account.reserved))} (
{chainMatch.token.symbol})
</span>
<span
style={{
fontFamily: 'Montserrat',
}}
tw='absolute text-xl text-white p-4 ml-30 mt-16 font-bold'
>
Free {numberWithCommas(bigNumberToNumber(account.free))} tSSC
Free {numberWithCommas(bigNumberToNumber(account.free))} ({chainMatch.token.symbol})
</span>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { MainLayout } from 'components/layout/Layout'
import { OperatorHeader } from 'components/layout/OperatorHeader'
import { StakingHeader } from 'components/layout/StakingHeader'
import type { ChildrenPageProps } from 'types/app'

export default async function Layout({ children }: ChildrenPageProps) {
return <MainLayout subHeader={<OperatorHeader />}>{children}</MainLayout>
return <MainLayout subHeader={<StakingHeader />}>{children}</MainLayout>
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import type { ChainPageProps } from 'types/app'

export async function generateMetadata({ params: { chain } }: ChainPageProps): Promise<Metadata> {
const chainTitle = chains.find((c) => c.urls.page === chain)?.title || 'Unknown chain'
const title = `${metadata.title} - ${chainTitle} - Stake My Operator`
const title = `${metadata.title} - ${chainTitle} - Register Operator`
return {
...metadata,
title,
Expand Down
14 changes: 9 additions & 5 deletions explorer/src/components/Account/AccountBalanceStats.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { StatItem } from 'components/common/StatItem'
import { Account } from 'gql/graphql'
import useDomains from 'hooks/useDomains'
import { FC } from 'react'
import { bigNumberToNumber, numberWithCommas } from 'utils/number'
import { AccountBalancePieChart } from './AccountBalancePieChart'
Expand All @@ -10,6 +11,7 @@ type Props = {
}

export const AccountBalanceStats: FC<Props> = ({ account, isDesktop = false }) => {
const { selectedChain } = useDomains()
const accountTotal = bigNumberToNumber(account.total || 0)
const accountFree = bigNumberToNumber(account.free || 0)
const accountReserved = bigNumberToNumber(account.reserved || 0)
Expand All @@ -28,25 +30,27 @@ export const AccountBalanceStats: FC<Props> = ({ account, isDesktop = false }) =
<div className='text-[26px] font-medium text-gray-900 dark:text-white'>
{numberWithCommas(accountTotal)}
</div>
<div className='text-[13px] font-semibold text-gray-900 dark:text-white'>tSSC</div>
<div className='text-[13px] font-semibold text-gray-900 dark:text-white'>
{selectedChain.token.symbol}
</div>
</div>
<div className='col-span-2 flex size-full items-center justify-center lg:items-end lg:justify-end'>
<AccountBalancePieChart account={account} />
</div>
<div className='flex w-full items-center lg:gap-4 lg:py-8'>
<div className='flex flex-row justify-center gap-8 lg:flex-none lg:flex-col'>
<div className='flex items-center'>
<div className='mr-2 h-[30px] w-1 bg-purpleElectric' />
<div className='bg-purpleElectric mr-2 h-[30px] w-1' />
<StatItem
title='Free'
value={`${numberWithCommas(accountFree)} tSSC (${freePercent.toFixed(2)}%)`}
value={`${numberWithCommas(accountFree)} ${selectedChain.token.symbol} (${freePercent.toFixed(2)}%)`}
/>
</div>
<div className='flex items-center'>
<div className='mr-2 h-[30px] w-1 bg-blueShade2' />
<div className='bg-blueShade2 mr-2 h-[30px] w-1' />
<StatItem
title='Reserved'
value={`${numberWithCommas(accountReserved)} tSSC (${reservedPercent.toFixed(2)}%)`}
value={`${numberWithCommas(accountReserved)} ${selectedChain.token.symbol} (${reservedPercent.toFixed(2)}%)`}
/>
</div>
</div>
Expand Down
21 changes: 2 additions & 19 deletions explorer/src/components/Account/AccountExtrinsicList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import { useErrorHandler } from 'react-error-boundary'
import { downloadFullData } from 'utils/downloadFullData'
import { sort } from 'utils/sort'
import { shortString } from 'utils/string'
import { ExtrinsicListCard } from '../Extrinsic/ExtrinsicListCard'
import { AccountExtrinsicFilterDropdown } from './AccountExtrinsicFilterDropdown'
import { QUERY_ACCOUNT_EXTRINSICS } from './query'

Expand Down Expand Up @@ -176,9 +175,9 @@ export const AccountExtrinsicList: FC<Props> = ({ accountId }) => {

return (
<div className='mt-5 flex w-full flex-col align-middle'>
<div className='mt-6 rounded-[20px] bg-white p-6 dark:border-none dark:bg-gradient-to-r dark:from-gradientTwilight dark:via-gradientDusk dark:to-gradientSunset'>
<div className='dark:from-gradientTwilight dark:via-gradientDusk dark:to-gradientSunset mt-6 rounded-[20px] bg-white p-6 dark:border-none dark:bg-gradient-to-r'>
<div className='flex w-full justify-center gap-2'>
<div className='text-sm text-purpleShade2 dark:text-white/75'>Action Filter:</div>
<div className='text-purpleShade2 text-sm dark:text-white/75'>Action Filter:</div>
<AccountExtrinsicFilterDropdown filters={filters} setFilters={setFilters} />
</div>
</div>
Expand All @@ -194,24 +193,8 @@ export const AccountExtrinsicList: FC<Props> = ({ accountId }) => {
onPaginationChange={setPagination}
filename='account-extrinsic-list'
fullDataDownloader={fullDataDownloader}
mobileComponent={<MobileComponent extrinsics={extrinsics} />}
/>
</div>
</div>
)
}

type MobileComponentProps = {
extrinsics: Extrinsic[]
}

const MobileComponent: FC<MobileComponentProps> = ({ extrinsics }) => (
<div className='w-full'>
{extrinsics.map((extrinsic, index) => (
<ExtrinsicListCard
extrinsic={extrinsic}
key={`extrinsic-list-card-${extrinsic.id}-${index}`}
/>
))}
</div>
)
6 changes: 5 additions & 1 deletion explorer/src/components/Account/AccountGraphTabs.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { TabTitle } from 'components/common/Tabs'
import useDomains from 'hooks/useDomains'
import React, { FC, ReactElement, useState } from 'react'
import { bigNumberToNumber, numberWithCommas } from 'utils/number'

Expand All @@ -10,6 +11,7 @@ type Props = {

export const AccountGraphTabs: FC<Props> = ({ children, total, isDesktop = false }) => {
const [selectedTab, setSelectedTab] = useState(0)
const { selectedChain } = useDomains()

const tabStyle = isDesktop
? 'bg-white border border-slate-100 shadow rounded-[20px] p-4 dark:bg-gradient-to-r dark:from-gradientTwilight dark:via-gradientDusk dark:to-gradientSunset dark:border-none'
Expand All @@ -29,7 +31,9 @@ export const AccountGraphTabs: FC<Props> = ({ children, total, isDesktop = false
<div className='text-[26px] font-medium text-gray-900 dark:text-white'>
{total ? numberWithCommas(bigNumberToNumber(total)) : 0}
</div>
<div className='text-[13px] font-semibold text-gray-900 dark:text-white'>tSSC</div>
<div className='text-[13px] font-semibold text-gray-900 dark:text-white'>
{selectedChain.token.symbol}
</div>
</div>

<div className='w-full lg:w-auto'>
Expand Down
16 changes: 7 additions & 9 deletions explorer/src/components/Account/AccountLatestRewards.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,27 +18,25 @@ interface AccountLatestRewardsProps {

export const AccountLatestRewards: FC<AccountLatestRewardsProps> = ({ rewards }) => {
const { selectedChain, selectedDomain } = useDomains()

const { accountId } = useParams<AccountIdParam>()

const { push } = useRouter()

return (
<div className='flex w-full flex-col rounded-[20px] border border-gray-200 bg-white px-4 dark:border-none dark:bg-gradient-to-r dark:from-gradientTwilight dark:via-gradientDusk dark:to-gradientSunset'>
<div className='dark:from-gradientTwilight dark:via-gradientDusk dark:to-gradientSunset flex w-full flex-col rounded-[20px] border border-gray-200 bg-white px-4 dark:border-none dark:bg-gradient-to-r'>
<div className='flex w-full flex-col gap-6 pl-4'>
<div className='flex w-full justify-between'>
<div className='flex-1 grow text-[13px] font-normal text-purpleShade2 dark:text-white/75'>
<div className='text-purpleShade2 flex-1 grow text-[13px] font-normal dark:text-white/75'>
Block Number
</div>
<div className='flex-1 grow text-center text-[13px] font-normal text-purpleShade2 dark:text-white/75'>
<div className='text-purpleShade2 flex-1 grow text-center text-[13px] font-normal dark:text-white/75'>
Type
</div>
<div className='flex-1 grow text-end text-[13px] font-normal text-purpleShade2 dark:text-white/75'>
<div className='text-purpleShade2 flex-1 grow text-end text-[13px] font-normal dark:text-white/75'>
Amount
</div>
</div>
<div className='w-full'>
<ol className='relative w-full border-l border-purpleLight dark:border-blueShade1'>
<ol className='border-purpleLight dark:border-blueShade1 relative w-full border-l'>
{rewards.map(({ id, name, block, amount }, index) => (
<li
key={`${id}-account-rewards-block`}
Expand Down Expand Up @@ -75,7 +73,7 @@ export const AccountLatestRewards: FC<AccountLatestRewardsProps> = ({ rewards })
.join(' ')}
</div>
<div className='text-grayDark -mt-1 w-full flex-1 grow text-end text-[13px] font-normal dark:text-white'>
{bigNumberToNumber(amount)} tSSC
{bigNumberToNumber(amount)} {selectedChain.token.symbol}
</div>
</li>
))}
Expand All @@ -93,7 +91,7 @@ export const AccountLatestRewards: FC<AccountLatestRewardsProps> = ({ rewards })
),
)
}
className='mt-4 w-full rounded-[20px] bg-blueLight py-4 dark:bg-whiteTransparent dark:text-white'
className='bg-blueLight dark:bg-whiteTransparent mt-4 w-full rounded-[20px] py-4 dark:text-white'
>
See All Rewards
</button>
Expand Down
12 changes: 6 additions & 6 deletions explorer/src/components/Account/AccountPreviousRewards.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -218,21 +218,21 @@ export const AccountPreviousRewards: FC<AccountPreviousRewardsProps> = () => {
}, [handleSearch])

return (
<div className='flex w-full flex-col rounded-[20px] border border-gray-200 bg-white p-4 dark:border-none dark:bg-gradient-to-r dark:from-gradientTwilight dark:via-gradientDusk dark:to-gradientSunset'>
<div className='dark:from-gradientTwilight dark:via-gradientDusk dark:to-gradientSunset flex w-full flex-col rounded-[20px] border border-gray-200 bg-white p-4 dark:border-none dark:bg-gradient-to-r'>
<div className='flex w-full flex-col gap-6 py-4 pl-4'>
<div className='grid w-full grid-cols-3 gap-8 xl:gap-8'>
<div className='col-span-1 text-[13px] font-normal text-purpleShade2 dark:text-white/75'>
<div className='text-purpleShade2 col-span-1 text-[13px] font-normal dark:text-white/75'>
Testnet
</div>
<div className='col-span-1 text-[13px] font-normal text-purpleShade2 dark:text-white/75'>
Localized tSSC
<div className='text-purpleShade2 col-span-1 text-[13px] font-normal dark:text-white/75'>
Localized {selectedChain.token.symbol}
</div>
<div className='col-span-1 text-[13px] font-normal text-purpleShade2 dark:text-white/75'>
<div className='text-purpleShade2 col-span-1 text-[13px] font-normal dark:text-white/75'>
Mainnet allocation %
</div>
</div>
<div className='w-full'>
<ol className='relative border-l border-purpleLight dark:border-blueShade1'>
<ol className='border-purpleLight dark:border-blueShade1 relative border-l'>
{rewardsPhase.map((phase, index) => (
<li
key={`${index}-account-rewards-block`}
Expand Down
7 changes: 5 additions & 2 deletions explorer/src/components/Account/AccountRewardGraph.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { NotFound } from 'components/layout/NotFound'
import dayjs from 'dayjs'
import relativeTime from 'dayjs/plugin/relativeTime'
import utc from 'dayjs/plugin/utc'
import useDomains from 'hooks/useDomains'
import { useTheme } from 'providers/ThemeProvider'
import { FC, useMemo } from 'react'
import { LatestRewardsWeekQuery } from '../gql/graphql'
Expand All @@ -21,7 +22,7 @@ type Props = {

export const AccountRewardGraph: FC<Props> = ({ accountId, total }) => {
const { isDark } = useTheme()

const { selectedChain } = useDomains()
const lastWeek = dayjs().subtract(3, 'month').utc().format()

const { data, error, loading } = useQuery<LatestRewardsWeekQuery>(QUERY_LAST_WEEK_REWARDS, {
Expand Down Expand Up @@ -74,7 +75,9 @@ export const AccountRewardGraph: FC<Props> = ({ accountId, total }) => {
<div className='text-[26px] font-medium text-gray-900 dark:text-white'>
{total ? numberWithCommas(bigNumberToNumber(total)) : 0}
</div>
<div className='text-[13px] font-semibold text-gray-900 dark:text-white'>tSSC</div>
<div className='text-[13px] font-semibold text-gray-900 dark:text-white'>
{selectedChain.token.symbol}
</div>
</div>
<div className='h-80 w-3/4 md:h-96 md:w-full'>
{parsedData.length > 0 ? (
Expand Down
15 changes: 2 additions & 13 deletions explorer/src/components/Account/AccountRewardTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import useDomains from 'hooks/useDomains'
import useMediaQuery from 'hooks/useMediaQuery'
import Link from 'next/link'
import { FC, useMemo } from 'react'
import { AccountRewardListCard } from './AccountRewardListCard'

dayjs.extend(relativeTime)

Expand Down Expand Up @@ -102,7 +101,8 @@ export const AccountRewardTable: FC<Props> = ({
enableSorting: true,
cell: ({ row }) => (
<div key={`${row.original.id}-account-balance`}>
{row.original.amount ? bigNumberToNumber(row.original.amount) : 0} tSSC
{row.original.amount ? bigNumberToNumber(row.original.amount) : 0}{' '}
{selectedChain.token.symbol}
</div>
),
},
Expand All @@ -122,17 +122,6 @@ export const AccountRewardTable: FC<Props> = ({
pagination={pagination}
pageCount={pageCount}
onPaginationChange={setPagination}
mobileComponent={
<div className='w-full'>
{rewards.map((reward, index) => (
<AccountRewardListCard
index={index}
reward={reward}
key={`account-list-card-${reward.id}`}
/>
))}
</div>
}
/>
</div>
</div>
Expand Down
Loading
Loading