Skip to content

Commit

Permalink
v7.9.7
Browse files Browse the repository at this point in the history
v7.9.7
  • Loading branch information
platschi authored Oct 9, 2023
2 parents cff0664 + 875a133 commit 2cb68f3
Show file tree
Hide file tree
Showing 28 changed files with 1,063 additions and 731 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "kwenta",
"version": "7.9.6",
"version": "7.9.7",
"description": "Kwenta",
"main": "index.js",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion packages/app/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@kwenta/app",
"version": "7.9.6",
"version": "7.9.7",
"scripts": {
"dev": "next",
"build": "next build",
Expand Down
49 changes: 25 additions & 24 deletions packages/app/src/pages/dashboard/history.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,13 @@ import styled from 'styled-components'

import UploadIcon from 'assets/svg/futures/upload-icon.svg'
import { FlexDivCol, FlexDivRowCentered } from 'components/layout/flex'
import { MobileHiddenView, MobileOnlyView } from 'components/Media'
import Spacer from 'components/Spacer'
import { Body, Heading } from 'components/Text'
import DashboardLayout from 'sections/dashboard/DashboardLayout'
import HistoryTabs, { HistoryTab } from 'sections/dashboard/HistoryTabs'
import TradesTab from 'sections/futures/MobileTrade/UserTabs/TradesTab'
import { usePollDashboardFuturesData } from 'state/futures/hooks'
import { selectPositionsCsvData, selectTradesCsvData } from 'state/futures/selectors'
import { useAppSelector } from 'state/hooks'
import media from 'styles/media'

type HistoryPageProps = React.FC & { getLayout: (page: ReactNode) => JSX.Element }

Expand Down Expand Up @@ -46,33 +44,36 @@ const HistoryPage: HistoryPageProps = () => {
)

return (
<>
<TitleContainer>
<Head>
<title>{t('dashboard-history.page-title')}</title>
</Head>
<MobileHiddenView>
<Spacer height={15} />
<FlexDivRowCentered>
<FlexDivCol>
<Heading variant="h3">{t('dashboard-history.main-title')}</Heading>
<Body color={'secondary'}>{t('dashboard-history.subtitle')}</Body>
</FlexDivCol>
<ExportButton href={file} download={fileName}>
<span>{t('dashboard-history.export-btn')}</span>
<UploadIcon width={8} style={{ 'margin-bottom': '2px' }} />
</ExportButton>
</FlexDivRowCentered>
<Spacer height={30} />
<HistoryTabs onChangeTab={handleChangeTab} currentTab={currentTab} />
<Spacer height={50} />
</MobileHiddenView>
<MobileOnlyView>
<TradesTab />
</MobileOnlyView>
</>

<FlexDivRowCentered style={{ marginBottom: '30px' }}>
<FlexDivCol>
<Heading variant="h3">{t('dashboard-history.main-title')}</Heading>
<Body color={'secondary'}>{t('dashboard-history.subtitle')}</Body>
</FlexDivCol>
<ExportButton href={file} download={fileName}>
<span>{t('dashboard-history.export-btn')}</span>
<UploadIcon width={8} style={{ 'margin-bottom': '2px' }} />
</ExportButton>
</FlexDivRowCentered>

<HistoryTabs onChangeTab={handleChangeTab} currentTab={currentTab} />
</TitleContainer>
)
}

const TitleContainer = styled.div`
${media.lessThan('lg')`
margin: 15px 15px 0 15px;
`}
${media.lessThan('sm')`
margin: 15px 15px 0 15px;
`}
`

const ExportButton = styled.a`
gap: 8px;
height: 36px;
Expand Down
64 changes: 18 additions & 46 deletions packages/app/src/sections/dashboard/HistoryTabs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import { fetchPositionHistoryForTrader } from 'state/futures/actions'
import { selectPositionsHistoryTableData } from 'state/futures/selectors'
import { useAppDispatch, useAppSelector } from 'state/hooks'
import { selectWallet } from 'state/wallet/selectors'
import media from 'styles/media'

export enum HistoryTab {
Positions = 'positions',
Expand All @@ -33,23 +32,21 @@ const HistoryTabs: React.FC<HistoryTabsProp> = ({ currentTab, onChangeTab }) =>
}, [dispatch, walletAddress])

return (
<HistoryTabsContainer>
<HistoryTabsHeader>
<TabButtons>
<TabButton
variant="noOutline"
title={t('dashboard.history.tabs.positions')}
onClick={onChangeTab(HistoryTab.Positions)}
active={currentTab === HistoryTab.Positions}
/>
<TabButton
variant="noOutline"
title={t('dashboard.history.tabs.trades')}
onClick={onChangeTab(HistoryTab.Trades)}
active={currentTab === HistoryTab.Trades}
/>
</TabButtons>
</HistoryTabsHeader>
<>
<TabButtons>
<TabButton
variant="noOutline"
title={t('dashboard.history.tabs.positions')}
onClick={onChangeTab(HistoryTab.Positions)}
active={currentTab === HistoryTab.Positions}
/>
<TabButton
variant="noOutline"
title={t('dashboard.history.tabs.trades')}
onClick={onChangeTab(HistoryTab.Trades)}
active={currentTab === HistoryTab.Trades}
/>
</TabButtons>
<div>
<TabPanel name={HistoryTab.Positions} activeTab={currentTab}>
<TraderHistory
Expand All @@ -63,39 +60,14 @@ const HistoryTabs: React.FC<HistoryTabsProp> = ({ currentTab, onChangeTab }) =>
<Trades rounded={true} noBottom={false} />
</TabPanel>
</div>
</HistoryTabsContainer>
</>
)
}

const HistoryTabsHeader = styled.div`
display: flex;
justify-content: space-between;
margin-bottom: 15px;
${media.lessThan('md')`
flex-direction: column;
row-gap: 10px;
margin-bottom: 25px;
margin-top: 0px;
`}
`

const HistoryTabsContainer = styled.div`
${media.lessThan('md')`
padding: 15px;
`}
`

const TabButtons = styled.div`
display: flex;
& > button:not(:last-of-type) {
margin-right: 25px;
}
${media.lessThan('md')`
justify-content: flex-start;
`}
gap: 25px;
margin-bottom: 25px;
`

export default HistoryTabs
Loading

1 comment on commit 2cb68f3

@vercel
Copy link

@vercel vercel bot commented on 2cb68f3 Oct 9, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

kwenta – ./packages/app

kwenta-kwenta.vercel.app
www.kwenta.io
kwenta-git-main-kwenta.vercel.app
kwenta.io

Please sign in to comment.