From af062a46dfad1f237850232df6e876006863fbf6 Mon Sep 17 00:00:00 2001 From: "F. Mitjans" Date: Thu, 1 Sep 2022 23:25:36 -0400 Subject: [PATCH] Make Maker page scale with fontsize --- .../src/components/AutocompletePayments.js | 73 +++++++++---------- frontend/src/components/MakerPage.js | 48 ++++++------ frontend/src/components/RangeSlider.js | 10 +-- 3 files changed, 65 insertions(+), 66 deletions(-) diff --git a/frontend/src/components/AutocompletePayments.js b/frontend/src/components/AutocompletePayments.js index 949166da..62bc9974 100644 --- a/frontend/src/components/AutocompletePayments.js +++ b/frontend/src/components/AutocompletePayments.js @@ -18,7 +18,7 @@ const Root = styled('div')( color: ${ theme.palette.mode === 'dark' ? 'rgba(255,255,255,0.65)' : 'rgba(0,0,0,.85)' }; - font-size: 14px; + font-size: ${14/16}em; `, ); @@ -26,21 +26,20 @@ const Label = styled('label')( ({ theme , error}) => ` color: ${theme.palette.mode === 'dark' ? (error? '#f44336': '#cfcfcf') : (error? '#dd0000':'#717171')}; align: center; - padding: 0 0 4px; line-height: 1.5; f44336 display: block; - font-size: 13px; + font-size: ${13/16}em; `, ); const InputWrapper = styled('div')( ({ theme , error}) => ` - width: 244px; - min-height: 44px; - max-height: 124px; + width: ${244/16}em; + min-height: ${44/16}em; + max-height: ${124/16}em; border: 1px solid ${theme.palette.mode === 'dark' ? (error? '#f44336': '#434343') : (error? '#dd0000':'#c4c4c4')}; background-color: ${theme.palette.mode === 'dark' ? '#141414' : '#fff'}; - border-radius: 4px; + border-radius: ${4/16}em; padding: 1px; display: flex; flex-wrap: wrap; @@ -59,17 +58,17 @@ const InputWrapper = styled('div')( color: ${ theme.palette.mode === 'dark' ? 'rgba(255,255,255,0.65)' : 'rgba(0,0,0,.85)' }; - height: 30px; + height: ;${30/16}em box-sizing: border-box; - padding: 4px 6px; + padding: ${4/16}em ${6/16}em; width: 0; - min-width: 30px; - font-size: 15px; + min-width: ${30/16}em; + font-size: ${15/16}em; flex-grow: 1; border: 0; margin: 0; outline: 0; - max-height: 124px; + max-height: ${124/16}em; } `, ); @@ -78,8 +77,8 @@ function Tag(props) { const { label, icon, onDelete, ...other } = props; return (
-
- +
+
{label} @@ -97,16 +96,16 @@ const StyledTag = styled(Tag)( ({ theme }) => ` display: flex; align-items: center; - height: 34px; - margin: 2px; - line-height: 22px; + height: ${34/16}em; + margin: ${2/16}em; + line-height: ${22/16}em; background-color: ${ theme.palette.mode === 'dark' ? 'rgba(255,255,255,0.08)' : '#fafafa' }; border: 1px solid ${theme.palette.mode === 'dark' ? '#303030' : '#e8e8e8'}; border-radius: 2px; box-sizing: content-box; - padding: 0 4px 0 10px; + padding: 0 ${4/16}em 0 ${10/16}em; outline: 0; overflow: hidden; @@ -119,13 +118,13 @@ const StyledTag = styled(Tag)( overflow: hidden; white-space: nowrap; text-overflow: ellipsis; - font-size: 15px; + font-size: ${15/16}em; } & svg { - font-size: 15px; + font-size: ${15/16}em; cursor: pointer; - padding: 4px; + padding: ${4/16}em; } `, ); @@ -134,31 +133,31 @@ const ListHeader = styled('span')( ({ theme }) => ` color: ${theme.palette.mode === 'dark' ? '#90caf9' : '#1976d2'}; align: left; - line-height:10px; - max-height: 10px; + line-height: ${10/16}em; + max-height: ${10/16}em; display: inline-block; background-color: ${theme.palette.mode === 'dark' ? '#141414' : '#ffffff'}; - font-size: 12px; + font-size: ${12/16}em; pointer-events: none; `, ); const Listbox = styled('ul')( ({ theme }) => ` - width: 244px; + width: ${244/16}em; margin: 2px 0 0; padding: 0; position: absolute; list-style: none; background-color: ${theme.palette.mode === 'dark' ? '#141414' : '#fff'}; overflow: auto; - max-height: 250px; - border-radius: 4px; - box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15); + max-height: ${250/16}em; + border-radius: ${4/16}em; + box-shadow: 0 ${2/16}em ${8/16}em rgba(0, 0, 0, 0.15); z-index: 999; & li { - padding: 5px 12px; + padding: ${5/16}em ${12/16}em; display: flex; & span { @@ -205,7 +204,7 @@ export default function AutocompletePayments(props) { focused="true", setAnchorEl, } = useAutocomplete({ - sx: {width:'200px', align:'left'}, + sx: {width: `${200/16}em`, align:'left'}, id: 'payment-methods', multiple: true, options: props.optionsType=="fiat" ? paymentMethods : swapDestinations, @@ -237,7 +236,7 @@ export default function AutocompletePayments(props) { return ( -
+
@@ -251,23 +250,23 @@ export default function AutocompletePayments(props) { {groupedOptions.length > 0 ? ( -
+
{props.listHeaderText+" "}
{groupedOptions.map((option, index) => (
  • -
    +
  • ))} {val != null? (val.length > 2 ? - + :null) :null} @@ -275,7 +274,7 @@ export default function AutocompletePayments(props) { //Here goes what happens if there is no groupedOptions (getInputProps().value.length > 0 ? - + :null) } diff --git a/frontend/src/components/MakerPage.js b/frontend/src/components/MakerPage.js index 54beb3b4..8a8897c6 100644 --- a/frontend/src/components/MakerPage.js +++ b/frontend/src/components/MakerPage.js @@ -302,9 +302,9 @@ class MakerPage extends Component { StandardMakerOptions = () => { const { t } = this.props; return( - + -
    +
    {t("Buy or Sell Bitcoin?")} @@ -313,13 +313,13 @@ class MakerPage extends Component { } checkedIcon={}/>} + control={} checkedIcon={}/>} label={this.state.type == 0 ? {t("Buy")}: {t("Buy")}} labelPlacement="end" /> } checkedIcon={}/>} + control={} checkedIcon={}/>} label={this.state.type == 1 ? {t("Sell")}: {t("Sell")}} labelPlacement="end" /> @@ -329,7 +329,7 @@ class MakerPage extends Component { -
    +