forked from tari-project/tari
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add default mining box style and config
- Loading branch information
1 parent
00993ae
commit 05c5935
Showing
26 changed files
with
451 additions
and
199 deletions.
There are no files selected for viewing
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
49 changes: 49 additions & 0 deletions
49
applications/launchpad_v2/src/components/CoinsList/index.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,49 @@ | ||
import Loading from '../Loading' | ||
import Text from '../Text' | ||
|
||
import { CoinsListItem, StyledCoinsList } from './styles' | ||
import { CoinsListProps } from './types' | ||
|
||
/** | ||
* Render the list of coins with amount. | ||
* @param {CoinProps[]} coins - the list of coins | ||
* @param {string} [color = 'inherit'] - the text color | ||
* | ||
* @typedef {CoinProps} | ||
* @param {string} amount - the amount | ||
* @param {string} unit - the unit, ie. xtr | ||
* @param {string} [suffixText] - the latter text after the amount and unit | ||
* @param {boolean} [loading] - is value being loaded | ||
*/ | ||
const CoinsList = ({ coins, color }: CoinsListProps) => { | ||
return ( | ||
<StyledCoinsList color={color}> | ||
{coins.map((c, idx) => ( | ||
<CoinsListItem key={`coin-${idx}`} loading={c.loading}> | ||
{c.loading ? ( | ||
<Loading loading={true} style={{ marginRight: 12 }} /> | ||
) : null} | ||
<Text type='subheader'>{c.amount}</Text> | ||
<Text | ||
as='span' | ||
type='smallMedium' | ||
style={{ | ||
paddingLeft: 4, | ||
paddingRight: 4, | ||
textTransform: 'uppercase', | ||
}} | ||
> | ||
{c.unit} | ||
</Text> | ||
{c.suffixText ? ( | ||
<Text as='span' type='smallMedium'> | ||
{c.suffixText} | ||
</Text> | ||
) : null} | ||
</CoinsListItem> | ||
))} | ||
</StyledCoinsList> | ||
) | ||
} | ||
|
||
export default CoinsList |
14 changes: 14 additions & 0 deletions
14
applications/launchpad_v2/src/components/CoinsList/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,14 @@ | ||
import styled from 'styled-components' | ||
|
||
export const StyledCoinsList = styled.ul<{ color?: string }>` | ||
color: ${({ color }) => (color ? color : 'inherit')}; | ||
list-style: none; | ||
padding-left: 0; | ||
margin-top: 0; | ||
` | ||
|
||
export const CoinsListItem = styled.li<{ loading?: boolean }>` | ||
opacity: ${({ loading }) => (loading ? 0.64 : 1)}; | ||
display: flex; | ||
align-items: center; | ||
` |
11 changes: 11 additions & 0 deletions
11
applications/launchpad_v2/src/components/CoinsList/types.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,11 @@ | ||
export interface CoinProps { | ||
amount: string | ||
unit: string | ||
suffixText?: string | ||
loading?: boolean | ||
} | ||
|
||
export interface CoinsListProps { | ||
coins: CoinProps[] | ||
color?: string | ||
} |
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
Oops, something went wrong.