-
-
Notifications
You must be signed in to change notification settings - Fork 251
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(coinmarket): update card wrappers
- Loading branch information
1 parent
544f334
commit 54102a6
Showing
8 changed files
with
128 additions
and
84 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
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
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
91 changes: 91 additions & 0 deletions
91
packages/suite/src/views/wallet/coinmarket/common/CoinmarketWrapper.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,91 @@ | ||
import { Card, variables } from '@trezor/components'; | ||
import { spacingsPx } from '@trezor/theme'; | ||
import { PropsWithChildren } from 'react'; | ||
import styled from 'styled-components'; | ||
|
||
export const CoinmarketWrapper = ` | ||
display: flex; | ||
justify-content: space-between; | ||
padding-bottom: ${spacingsPx.xxxl}; | ||
${variables.SCREEN_QUERY.BELOW_LAPTOP} { | ||
flex-wrap: wrap; | ||
} | ||
`; | ||
|
||
const CoinmarketLeftWrapper = styled.div` | ||
width: 60%; | ||
${variables.SCREEN_QUERY.BELOW_DESKTOP} { | ||
width: 49%; | ||
} | ||
${variables.SCREEN_QUERY.BELOW_LAPTOP} { | ||
width: 100%; | ||
} | ||
`; | ||
|
||
const CoinmarketLeftPaddingWrapper = styled.div<{ $isWithoutPadding?: boolean }>` | ||
padding: ${({ $isWithoutPadding }) => | ||
$isWithoutPadding ? 0 : `${spacingsPx.xl} ${spacingsPx.xl} ${spacingsPx.lg}`}; | ||
${variables.SCREEN_QUERY.BELOW_DESKTOP} { | ||
padding: ${spacingsPx.md}; | ||
} | ||
${variables.SCREEN_QUERY.BELOW_LAPTOP} { | ||
padding-bottom: ${spacingsPx.zero}; | ||
} | ||
`; | ||
|
||
const CoinmarketRightWrapper = styled.div` | ||
width: 37%; | ||
${variables.SCREEN_QUERY.BELOW_DESKTOP} { | ||
width: 49%; | ||
} | ||
${variables.SCREEN_QUERY.BELOW_LAPTOP} { | ||
width: 100%; | ||
margin-top: ${spacingsPx.sm}; | ||
} | ||
`; | ||
|
||
const CoinmarketRightPaddingWrapper = styled.div` | ||
padding: ${spacingsPx.xl} ${spacingsPx.xl} ${spacingsPx.xxxl}; | ||
${variables.SCREEN_QUERY.BELOW_DESKTOP} { | ||
padding: ${spacingsPx.md} ${spacingsPx.md} ${spacingsPx.xxl}; | ||
} | ||
`; | ||
|
||
interface CoinmarketSideWrapperProps extends PropsWithChildren { | ||
side: 'left' | 'right'; | ||
isLeftSideWithoutPadding?: boolean; | ||
} | ||
|
||
export const CoinmarketSideWrapper = ({ | ||
side, | ||
isLeftSideWithoutPadding, | ||
children, | ||
}: CoinmarketSideWrapperProps) => { | ||
if (side === 'left') { | ||
return ( | ||
<CoinmarketLeftWrapper> | ||
<Card paddingType="none" height="100%"> | ||
<CoinmarketLeftPaddingWrapper $isWithoutPadding={isLeftSideWithoutPadding}> | ||
{children} | ||
</CoinmarketLeftPaddingWrapper> | ||
</Card> | ||
</CoinmarketLeftWrapper> | ||
); | ||
} | ||
|
||
return ( | ||
<CoinmarketRightWrapper> | ||
<Card paddingType="none" height="100%"> | ||
<CoinmarketRightPaddingWrapper>{children}</CoinmarketRightPaddingWrapper> | ||
</Card> | ||
</CoinmarketRightWrapper> | ||
); | ||
}; |
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