-
Notifications
You must be signed in to change notification settings - Fork 753
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(uikit/tokenpairimage): Inverted variant
- Loading branch information
1 parent
64677b3
commit 1947fd0
Showing
8 changed files
with
113 additions
and
24 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -35,7 +35,6 @@ it("renders correctly", () => { | |
display: inline-flex; | ||
height: 48px; | ||
width: 48px; | ||
z-index: 5; | ||
} | ||
<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
34 changes: 19 additions & 15 deletions
34
packages/pancake-uikit/src/components/Image/TokenPairImage.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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
import styled from "styled-components"; | ||
import { variant as StyledSystemVariant } from "styled-system"; | ||
import { TokenImageProps, Variant, variants } from "./types"; | ||
import TokenImage from "./TokenImage"; | ||
|
||
interface StyledImageProps extends TokenImageProps { | ||
variant: Variant; | ||
} | ||
|
||
export const StyledPrimaryImage = styled(TokenImage)<StyledImageProps>` | ||
position: absolute; | ||
${StyledSystemVariant({ | ||
variants: { | ||
[variants.DEFAULT]: { | ||
bottom: "auto", | ||
left: 0, | ||
right: "auto", | ||
top: 0, | ||
zIndex: 5, | ||
}, | ||
[variants.INVERTED]: { | ||
bottom: 0, | ||
left: "auto", | ||
right: 0, | ||
top: "auto", | ||
zIndex: 6, | ||
}, | ||
}, | ||
})} | ||
`; | ||
|
||
export const StyledSecondaryImage = styled(TokenImage)<StyledImageProps>` | ||
position: absolute; | ||
${StyledSystemVariant({ | ||
variants: { | ||
[variants.DEFAULT]: { | ||
bottom: 0, | ||
left: "auto", | ||
right: 0, | ||
top: "auto", | ||
zIndex: 6, | ||
}, | ||
[variants.INVERTED]: { | ||
bottom: "auto", | ||
left: 0, | ||
right: "auto", | ||
top: 0, | ||
zIndex: 5, | ||
}, | ||
}, | ||
})} | ||
`; |
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