This repository has been archived by the owner on Feb 2, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding surplus column on tx table (#99)
* Adding surplus column on tx table * Use popper tooltip with click instead hover * Fixing onClick on tooltip * Creating BaseIconTooltip * Avoid use tooltip on mobile view * Fix mobile view wrap surplus * Use OrderSurplusTooltipDisplay on OrderUserTable * Hover instead Click, no cast return, amount of smart formatting * Fix row spacing, improve type naming
- Loading branch information
1 parent
183ee90
commit 9c60af0
Showing
9 changed files
with
299 additions
and
138 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
25 changes: 25 additions & 0 deletions
25
src/components/orders/OrdersUserDetailsTable/OrderSurplusTooltipStyledByRow.tsx
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,25 @@ | ||
import React from 'react' | ||
import styled from 'styled-components' | ||
|
||
import { media } from 'theme/styles/media' | ||
import { Order } from 'api/operator' | ||
import { useMediaBreakpoint } from 'hooks/useMediaBreakPoint' | ||
import { OrderSurplusTooltipDisplay, OrderSurplusDisplay } from '../OrderSurplusDisplay' | ||
|
||
export const OrderSurplusDisplayStyled = styled(OrderSurplusDisplay)` | ||
${media.mobile} { | ||
flex-direction: column; | ||
} | ||
` | ||
/** | ||
* Displays surplus amount inside tooltip when display mode has little space to display | ||
*/ | ||
export function OrderSurplusDisplayStyledByRow({ order }: { order: Order }): JSX.Element { | ||
const isDesktop = useMediaBreakpoint(['xl', 'lg']) | ||
|
||
if (isDesktop) { | ||
return <OrderSurplusTooltipDisplay order={order} /> | ||
} | ||
|
||
return <OrderSurplusDisplayStyled order={order} amountSmartFormatting /> | ||
} |
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
Oops, something went wrong.