mirror of
https://github.com/oceanprotocol/market.git
synced 2024-12-02 05:57:29 +01:00
added AccountTeaser and AccountList stories
This commit is contained in:
parent
d53ea3f187
commit
dde191630d
11
src/components/@shared/AccountList/index.module.css
Normal file
11
src/components/@shared/AccountList/index.module.css
Normal file
@ -0,0 +1,11 @@
|
||||
.empty {
|
||||
color: var(--color-secondary);
|
||||
font-size: var(--font-size-small);
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
.loaderWrap {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
37
src/components/@shared/AccountList/index.stories.tsx
Normal file
37
src/components/@shared/AccountList/index.stories.tsx
Normal file
@ -0,0 +1,37 @@
|
||||
import React from 'react'
|
||||
import { ComponentStory, ComponentMeta } from '@storybook/react'
|
||||
import AccountList, { AccountListProps } from '@shared/AccountList'
|
||||
import * as config from '../../../../app.config'
|
||||
|
||||
export default {
|
||||
title: 'Component/@shared/AccountList',
|
||||
component: AccountList
|
||||
} as ComponentMeta<typeof AccountList>
|
||||
|
||||
const Template: ComponentStory<typeof AccountList> = (
|
||||
args: AccountListProps
|
||||
) => <AccountList {...args} />
|
||||
|
||||
interface Props {
|
||||
args: AccountListProps
|
||||
}
|
||||
|
||||
export const Default: Props = Template.bind({})
|
||||
Default.args = {
|
||||
accounts: [
|
||||
{
|
||||
address: '0x00000000000000000000000000000000000000000',
|
||||
nrSales: 25
|
||||
},
|
||||
{
|
||||
address: '0x00000000000000000000000000000000000000000',
|
||||
nrSales: 11
|
||||
},
|
||||
{
|
||||
address: '0x00000000000000000000000000000000000000000',
|
||||
nrSales: 5
|
||||
}
|
||||
],
|
||||
isLoading: false,
|
||||
chainIds: config.chainIds
|
||||
}
|
@ -1,9 +1,8 @@
|
||||
import React, { ReactElement } from 'react'
|
||||
import styles from './AssetList.module.css'
|
||||
import styles from './index.module.css'
|
||||
import classNames from 'classnames/bind'
|
||||
import Loader from '../atoms/Loader'
|
||||
import { useUserPreferences } from '@context/UserPreferences'
|
||||
import AccountTeaser from '@shared/AccountTeaser/AccountTeaser'
|
||||
import AccountTeaser from '@shared/AccountTeaser'
|
||||
|
||||
const cx = classNames.bind(styles)
|
||||
|
||||
@ -15,19 +14,19 @@ function LoaderArea() {
|
||||
)
|
||||
}
|
||||
|
||||
declare type AccountListProps = {
|
||||
export interface AccountListProps {
|
||||
accounts: AccountTeaserVM[]
|
||||
isLoading: boolean
|
||||
className?: string
|
||||
chainIds: number[]
|
||||
}
|
||||
|
||||
export default function AccountList({
|
||||
accounts,
|
||||
isLoading,
|
||||
className
|
||||
className,
|
||||
chainIds
|
||||
}: AccountListProps): ReactElement {
|
||||
const { chainIds } = useUserPreferences()
|
||||
|
||||
const styleClasses = cx({
|
||||
assetList: true,
|
||||
[className]: className
|
25
src/components/@shared/AccountTeaser/index.stories.tsx
Normal file
25
src/components/@shared/AccountTeaser/index.stories.tsx
Normal file
@ -0,0 +1,25 @@
|
||||
import React from 'react'
|
||||
import { ComponentStory, ComponentMeta } from '@storybook/react'
|
||||
import AccountTeaser, { AccountTeaserProps } from '@shared/AccountTeaser'
|
||||
|
||||
export default {
|
||||
title: 'Component/@shared/AccountTeaser',
|
||||
component: AccountTeaser
|
||||
} as ComponentMeta<typeof AccountTeaser>
|
||||
|
||||
const Template: ComponentStory<typeof AccountTeaser> = (
|
||||
args: AccountTeaserProps
|
||||
) => <AccountTeaser {...args} />
|
||||
|
||||
interface Props {
|
||||
args: AccountTeaserProps
|
||||
}
|
||||
|
||||
export const Default: Props = Template.bind({})
|
||||
Default.args = {
|
||||
accountTeaserVM: {
|
||||
address: '0x00000000000000000000000000000000000000000',
|
||||
nrSales: 25
|
||||
},
|
||||
place: 1
|
||||
}
|
@ -1,13 +1,13 @@
|
||||
import React, { ReactElement, useEffect, useState } from 'react'
|
||||
import Dotdotdot from 'react-dotdotdot'
|
||||
import Link from 'next/link'
|
||||
import styles from './AccountTeaser.module.css'
|
||||
import styles from './index.module.css'
|
||||
import Blockies from '../atoms/Blockies'
|
||||
import { useCancelToken } from '@hooks/useCancelToken'
|
||||
import get3BoxProfile from '@utils/profile'
|
||||
import { accountTruncate } from '@utils/web3'
|
||||
|
||||
declare type AccountTeaserProps = {
|
||||
export interface AccountTeaserProps {
|
||||
accountTeaserVM: AccountTeaserVM
|
||||
place?: number
|
||||
}
|
@ -1,5 +1,5 @@
|
||||
import { useUserPreferences } from '@context/UserPreferences'
|
||||
import AccountList from '@shared/AccountList/AccountList'
|
||||
import AccountList from '@shared/AccountList'
|
||||
import { getTopAssetsPublishers } from '@utils/subgraph'
|
||||
import React, { ReactElement, useEffect, useState } from 'react'
|
||||
import styles from './Home.module.css'
|
||||
@ -38,7 +38,7 @@ export default function PublishersWithMostSales({
|
||||
return (
|
||||
<section className={styles.section}>
|
||||
<h3>{title}</h3>
|
||||
<AccountList accounts={result} isLoading={loading} />
|
||||
<AccountList accounts={result} isLoading={loading} chainIds={chainIds} />
|
||||
{action && action}
|
||||
</section>
|
||||
)
|
||||
|
Loading…
x
Reference in New Issue
Block a user