-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: #107: add styles to 24h stats * fix: #107: improve pair selector styles * fix: styles * fix: format * fix: use `round` instead of `toFixed` * fix: add shimmering animation to skeleton * fix: negative percentage color * feat: implement mobile grid layout partly * feat: finish the mobile version of the trade page * feat: prepare the desktop layout * fix: fix the mobile chart size * fix: lint and format * fix: update ui package version * feat: apply grid to the order book * fix: apply grid for every possible screen resolution * fix: integrate order form into the layout * fix: global z-index
- Loading branch information
Showing
19 changed files
with
515 additions
and
147 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,6 +25,7 @@ body > section { | |
|
||
::-webkit-scrollbar { | ||
width: 4px; | ||
height: 4px; | ||
} | ||
|
||
::-webkit-scrollbar-track { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
import { useState } from 'react'; | ||
import { useAutoAnimate } from '@formkit/auto-animate/react'; | ||
import { Tabs } from '@penumbra-zone/ui/Tabs'; | ||
import { Density } from '@penumbra-zone/ui/Density'; | ||
import { OrderForm } from './order-form'; | ||
|
||
enum FormTabsType { | ||
Market = 'market', | ||
Limit = 'limit', | ||
Range = 'range', | ||
} | ||
|
||
export const FormTabs = () => { | ||
const [parent] = useAutoAnimate(); | ||
const [tab, setTab] = useState<FormTabsType>(FormTabsType.Market); | ||
|
||
return ( | ||
<div ref={parent} className='h-full flex flex-col'> | ||
<div className='px-4 lg:pt-2 border-b border-b-other-solidStroke'> | ||
<Density medium> | ||
<Tabs | ||
value={tab} | ||
actionType='accent' | ||
onChange={value => setTab(value as FormTabsType)} | ||
options={[ | ||
{ value: FormTabsType.Market, label: 'Market' }, | ||
{ value: FormTabsType.Limit, label: 'Limit' }, | ||
{ value: FormTabsType.Range, label: 'Range Liquidity' }, | ||
]} | ||
/> | ||
</Density> | ||
</div> | ||
|
||
{tab === FormTabsType.Market && <OrderForm />} | ||
{tab === FormTabsType.Limit && ( | ||
<div className='h-[380px] p-4 text-text-secondary'>Limit order form</div> | ||
)} | ||
{tab === FormTabsType.Range && ( | ||
<div className='h-[380px] p-4 text-text-secondary'>Range liquidity form</div> | ||
)} | ||
</div> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
import { useState } from 'react'; | ||
import { useAutoAnimate } from '@formkit/auto-animate/react'; | ||
import { Tabs } from '@penumbra-zone/ui/Tabs'; | ||
import { Density } from '@penumbra-zone/ui/Density'; | ||
import { Toggle } from '@penumbra-zone/ui/Toggle'; | ||
import { Text } from '@penumbra-zone/ui/Text'; | ||
import { Positions } from './positions'; | ||
import { History } from './history'; | ||
|
||
enum HistoryTabsType { | ||
Positions = 'positions', | ||
History = 'history', | ||
} | ||
|
||
export const HistoryTabs = () => { | ||
const [parent] = useAutoAnimate(); | ||
const [tab, setTab] = useState<HistoryTabsType>(HistoryTabsType.Positions); | ||
const [showAll, setShowAll] = useState(false); | ||
|
||
return ( | ||
<div ref={parent} className='flex flex-col'> | ||
<div className='flex justify-between gap-2 px-4 border-b border-b-other-solidStroke'> | ||
<Density medium> | ||
<Tabs | ||
value={tab} | ||
actionType='accent' | ||
onChange={value => setTab(value as HistoryTabsType)} | ||
options={[ | ||
{ value: HistoryTabsType.Positions, label: 'Positions' }, | ||
{ value: HistoryTabsType.History, label: 'History' }, | ||
]} | ||
/> | ||
</Density> | ||
|
||
<label className='flex gap-2 h-[42px] items-center py-2 text-text-secondary cursor-pointer'> | ||
<Text small>Show all</Text> | ||
<Toggle label='Show all' value={showAll} onChange={setShowAll} /> | ||
</label> | ||
</div> | ||
|
||
{tab === HistoryTabsType.Positions && <Positions />} | ||
{tab === HistoryTabsType.History && <History />} | ||
</div> | ||
); | ||
}; |
Oops, something went wrong.