diff --git a/cashtab/package-lock.json b/cashtab/package-lock.json --- a/cashtab/package-lock.json +++ b/cashtab/package-lock.json @@ -1,12 +1,12 @@ { "name": "cashtab", - "version": "2.32.6", + "version": "2.32.7", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "cashtab", - "version": "2.32.6", + "version": "2.32.7", "dependencies": { "@bitgo/utxo-lib": "^9.33.0", "@zxing/browser": "^0.1.4", diff --git a/cashtab/package.json b/cashtab/package.json --- a/cashtab/package.json +++ b/cashtab/package.json @@ -1,6 +1,6 @@ { "name": "cashtab", - "version": "2.32.6", + "version": "2.32.7", "private": true, "scripts": { "start": "node scripts/start.js", diff --git a/cashtab/src/components/Etokens/Token.js b/cashtab/src/components/Etokens/Token/index.js rename from cashtab/src/components/Etokens/Token.js rename to cashtab/src/components/Etokens/Token/index.js --- a/cashtab/src/components/Etokens/Token.js +++ b/cashtab/src/components/Etokens/Token/index.js @@ -22,7 +22,6 @@ isValidTokenMintAmount, } from 'validation'; import { formatDate } from 'utils/formatting'; -import styled from 'styled-components'; import TokenIcon from 'components/Etokens/TokenIcon'; import { explorer } from 'config/explorer'; import { queryAliasServer } from 'alias'; @@ -51,95 +50,21 @@ import { QuestionIcon } from 'components/Common/CustomIcons'; import { decimalizedTokenQtyToLocaleFormat } from 'utils/formatting'; import Switch from 'components/Common/Switch'; - -const DataAndQuestionButton = styled.div` - display: flex; - align-items: center; -`; -const TokenIconExpandButton = styled.button` - cursor: pointer; - border: none; - background-color: transparent; -`; -const SendTokenForm = styled.div` - display: flex; - flex-direction: column; - align-items: center; - justify-content: space-between; - width: 100%; - margin-bottom: 12px; -`; -const SendTokenFormRow = styled.div` - width: 100%; - display: flex; - justify-content: space-between; - gap: 12px; - margin: 3px; -`; -const InputRow = styled.div` - width: 100%; -`; - -const TokenStatsTable = styled.div` - display: flex; - flex-wrap: wrap; - align-items: center; - justify-content: center; - width: 100%; - color: ${props => props.theme.contrast}; - gap: 12px; - margin-bottom: 12px; -`; -const TokenStatsRow = styled.div` - width: 100%; - display: flex; - flex-wrap: wrap; - align-items: center; - text-align: center; - justify-content: center; - gap: 3px; -`; -const TokenStatsCol = styled.div` - align-items: center; - flex-wrap: wrap; -`; -const TokenStatsTableRow = styled.div` - width: 100%; - display: flex; - flex-wrap: wrap; - align-items: center; - justify-content: flex-start; - gap: 3px; -`; - -const TokenStatsLabel = styled.div` - font-weight: bold; - justify-content: flex-end; - text-align: right; - display: flex; - width: 106px; -`; -const SwitchHolder = styled.div` - width: 100%; - display: flex; - justify-content: flex-start; - gap: 12px; - align-content: center; - align-items: center; - margin: 12px; -`; - -const TokenSentLink = styled.a` - color: ${props => props.theme.walletBackground}; - text-decoration: none; -`; - -const AliasAddressPreviewLabel = styled.div` - text-align: center; - color: ${props => props.theme.forms.text}; - padding-left: 1px; - white-space: nowrap; -`; +import { + DataAndQuestionButton, + TokenIconExpandButton, + SendTokenForm, + SendTokenFormRow, + InputRow, + TokenStatsTable, + TokenStatsRow, + TokenStatsCol, + TokenStatsTableRow, + TokenStatsLabel, + SwitchHolder, + TokenSentLink, + AliasAddressPreviewLabel, +} from 'components/Etokens/Token/styled'; const Token = () => { let navigate = useNavigate(); diff --git a/cashtab/src/components/Etokens/Token/styled.js b/cashtab/src/components/Etokens/Token/styled.js new file mode 100644 --- /dev/null +++ b/cashtab/src/components/Etokens/Token/styled.js @@ -0,0 +1,92 @@ +// Copyright (c) 2024 The Bitcoin developers +// Distributed under the MIT software license, see the accompanying +// file COPYING or http://www.opensource.org/licenses/mit-license.php. + +import styled from 'styled-components'; + +export const DataAndQuestionButton = styled.div` + display: flex; + align-items: center; +`; +export const TokenIconExpandButton = styled.button` + cursor: pointer; + border: none; + background-color: transparent; +`; +export const SendTokenForm = styled.div` + display: flex; + flex-direction: column; + align-items: center; + justify-content: space-between; + width: 100%; + margin-bottom: 12px; +`; +export const SendTokenFormRow = styled.div` + width: 100%; + display: flex; + justify-content: space-between; + gap: 12px; + margin: 3px; +`; +export const InputRow = styled.div` + width: 100%; +`; + +export const TokenStatsTable = styled.div` + display: flex; + flex-wrap: wrap; + align-items: center; + justify-content: center; + width: 100%; + color: ${props => props.theme.contrast}; + gap: 12px; + margin-bottom: 12px; +`; +export const TokenStatsRow = styled.div` + width: 100%; + display: flex; + flex-wrap: wrap; + align-items: center; + text-align: center; + justify-content: center; + gap: 3px; +`; +export const TokenStatsCol = styled.div` + align-items: center; + flex-wrap: wrap; +`; +export const TokenStatsTableRow = styled.div` + width: 100%; + display: flex; + flex-wrap: wrap; + align-items: center; + justify-content: flex-start; + gap: 3px; +`; + +export const TokenStatsLabel = styled.div` + font-weight: bold; + justify-content: flex-end; + text-align: right; + display: flex; + width: 106px; +`; +export const SwitchHolder = styled.div` + width: 100%; + display: flex; + justify-content: flex-start; + gap: 12px; + align-content: center; + align-items: center; + margin: 12px; +`; +export const TokenSentLink = styled.a` + color: ${props => props.theme.walletBackground}; + text-decoration: none; +`; +export const AliasAddressPreviewLabel = styled.div` + text-align: center; + color: ${props => props.theme.forms.text}; + padding-left: 1px; + white-space: nowrap; +`;