Reorganize history page (#434)

* displayed content using tabs

* fixed transparent background on table and tabs

* tabs design update

* overflow tabs

* pagination and no results message spacing
This commit is contained in:
Norbi 2021-03-11 19:05:49 +02:00 committed by GitHub
parent a3e2c8ef3b
commit aa6cceaf0e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 30 additions and 33 deletions

View File

@ -18,17 +18,29 @@
.content { .content {
margin-top: var(--spacer); margin-top: var(--spacer);
background-color: var(--background-content) !important;
} }
.section { .tabs div[class*='tabs'] {
margin-top: calc(var(--spacer) * 1.5); background-color: var(--background-content);
} }
.section:last-child { .tabs ul[class*='tabList'] {
margin-bottom: 0; background-color: var(--background-content);
border: 1px solid var(--border-color);
border-bottom: 0;
border-top-left-radius: var(--border-radius);
border-top-right-radius: var(--border-radius);
white-space: nowrap;
overflow-y: hidden;
overflow-x: auto;
} }
.sectionTitle { .tabs div[class*='tabContent'] {
font-size: var(--font-size-h3); border: 1px solid var(--border-color);
margin-bottom: calc(var(--spacer) / 2); padding-bottom: 0;
}
.tabs div[class*='tab-panel--selected'] {
margin-bottom: var(--spacer);
} }

View File

@ -1,56 +1,39 @@
import React, { ReactElement, ReactNode } from 'react' import React, { ReactElement } from 'react'
import ComputeJobs from './ComputeJobs' import ComputeJobs from './ComputeJobs'
import styles from './index.module.css' import styles from './index.module.css'
import PoolShares from './PoolShares' import PoolShares from './PoolShares'
import PoolTransactions from '../../molecules/PoolTransactions' import PoolTransactions from '../../molecules/PoolTransactions'
import PublishedList from './PublishedList' import PublishedList from './PublishedList'
import Downloads from './Downloads' import Downloads from './Downloads'
import Tabs from '../../atoms/Tabs'
const sections = [ const tabs = [
{ {
title: 'Published', title: 'Published',
component: <PublishedList /> content: <PublishedList />
}, },
{ {
title: 'Pool Shares', title: 'Pool Shares',
component: <PoolShares /> content: <PoolShares />
}, },
{ {
title: 'Pool Transactions', title: 'Pool Transactions',
component: <PoolTransactions /> content: <PoolTransactions />
}, },
{ {
title: 'Downloads', title: 'Downloads',
component: <Downloads /> content: <Downloads />
}, },
{ {
title: 'Compute Jobs', title: 'Compute Jobs',
component: <ComputeJobs /> content: <ComputeJobs />
} }
] ]
const Section = ({
title,
component
}: {
title: string
component: ReactNode
}) => {
return (
<div className={styles.section}>
<h2 className={styles.sectionTitle}>{title}</h2>
{component}
</div>
)
}
export default function HistoryPage(): ReactElement { export default function HistoryPage(): ReactElement {
return ( return (
<article className={styles.content}> <article className={styles.content}>
{sections.map((section) => { <Tabs items={tabs} className={styles.tabs} />
const { title, component } = section
return <Section key={title} title={title} component={component} />
})}
</article> </article>
) )
} }

View File

@ -26,6 +26,7 @@
--font-color-text: #41474e; --font-color-text: #41474e;
--font-color-heading: #141414; --font-color-heading: #141414;
--background-body: #fff; --background-body: #fff;
--background-content: #fff;
--background-body-transparent: rgba(255, 255, 255, 0.8); --background-body-transparent: rgba(255, 255, 255, 0.8);
--background-highlight: #f7f7f7; --background-highlight: #f7f7f7;
--border-color: #e2e2e2; --border-color: #e2e2e2;
@ -70,6 +71,7 @@
.dark { .dark {
--font-color-text: #e2e2e2; --font-color-text: #e2e2e2;
--font-color-heading: #f7f7f7; --font-color-heading: #f7f7f7;
--background-content: #141414;
--background-body: #141414; --background-body: #141414;
--background-body-transparent: rgba(20, 20, 20, 0.9); --background-body-transparent: rgba(20, 20, 20, 0.9);
--background-highlight: #201f1f; --background-highlight: #201f1f;