-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
…info-data-on-add-position faet: [GSW-681] Integrate position info data on Add Position
- Loading branch information
Showing
11 changed files
with
250 additions
and
106 deletions.
There are no files selected for viewing
53 changes: 53 additions & 0 deletions
53
packages/web/src/components/common/double-token-logo/DoubleTokenLogo.styles.ts
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,53 @@ | ||
import { fonts } from "@constants/font.constant"; | ||
import styled from "@emotion/styled"; | ||
import { media } from "@styles/media"; | ||
import mixins from "@styles/mixins"; | ||
|
||
export interface DoubleTokenLogoStyleProps { | ||
size?: string | number; | ||
overlap?: string | number; | ||
fontSize?: number; | ||
} | ||
|
||
export const DoubleTokenLogoWrapper = styled.div<DoubleTokenLogoStyleProps>` | ||
${mixins.flexbox("row", "center", "center")}; | ||
img { | ||
width: ${({ size }) => { | ||
if (size) return typeof size === "number" ? `${size}px` : size; | ||
return "36px"; | ||
}}; | ||
height: ${({ size }) => { | ||
if (size) return typeof size === "number" ? `${size}px` : size; | ||
return "36px"; | ||
}}; | ||
border-radius: 50%; | ||
} | ||
.right-logo { | ||
margin-left: ${({ overlap }) => { | ||
if (overlap) | ||
return typeof overlap === "number" ? `-${overlap}px` : `-${overlap}`; | ||
return "-6px"; | ||
}}; | ||
} | ||
.missing-logo { | ||
${mixins.flexbox("row", "center", "center")}; | ||
width: ${({ size }) => { | ||
if (size) return typeof size === "number" ? `${size}px` : size; | ||
return "36px"; | ||
}}; | ||
height: ${({ size }) => { | ||
if (size) return typeof size === "number" ? `${size}px` : size; | ||
return "36px"; | ||
}}; | ||
border-radius: 50%; | ||
color: ${({ theme }) => theme.color.text02}; | ||
background-color: ${({ theme }) => theme.color.border02}; | ||
${fonts.p6} | ||
font-size: ${({ fontSize }) => `${fontSize}px`}; | ||
line-height: 1.1em; | ||
${media.mobile} { | ||
font-size: 8px; | ||
line-height: 10px; | ||
} | ||
} | ||
`; |
22 changes: 22 additions & 0 deletions
22
packages/web/src/components/common/double-token-logo/DoubleTokenLogo.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,22 @@ | ||
import { TokenModel } from "@models/token/token-model"; | ||
import { DoubleTokenLogoWrapper } from "./DoubleTokenLogo.styles"; | ||
import TokenLogo from "../token-logo/TokenLogo"; | ||
|
||
interface DoubleTokenLogoProps { | ||
left: TokenModel; | ||
right: TokenModel; | ||
size?: string | number; | ||
overlap?: string | number; | ||
fontSize?: number; | ||
} | ||
|
||
const DoubleTokenLogo = ({ left, right, size, overlap, fontSize }: DoubleTokenLogoProps) => { | ||
return ( | ||
<DoubleTokenLogoWrapper overlap={overlap} size={size} fontSize={fontSize}> | ||
<TokenLogo token={left} /> | ||
<TokenLogo className="right-logo" token={right} /> | ||
</DoubleTokenLogoWrapper> | ||
); | ||
}; | ||
|
||
export default DoubleTokenLogo; |
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
15 changes: 15 additions & 0 deletions
15
packages/web/src/components/common/token-logo/TokenLogo.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,15 @@ | ||
import { TokenModel } from "@models/token/token-model"; | ||
import React from "react"; | ||
|
||
export interface TokenLogoProps { | ||
className?: string; | ||
token: TokenModel; | ||
} | ||
|
||
const TokenLogo: React.FC<TokenLogoProps> = ({ className, token }) => { | ||
return token?.logoURI ? | ||
<img className={"token-logo " + className} src={token.logoURI} alt="token logo" /> : | ||
<div className={"missing-logo " + className} >{token.symbol.slice(0, 3)}</div>; | ||
}; | ||
|
||
export default TokenLogo; |
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
Oops, something went wrong.