aboutsummaryrefslogtreecommitdiffstats
path: root/src/components/Settings.js
diff options
context:
space:
mode:
authorguicamest <guicamest@gmail.com>2023-08-15 17:32:18 +0200
committerGitHub <noreply@github.com>2023-08-15 08:32:18 -0700
commitf1d79a17f615a9cd34b15dd7b96764e4bb99486a (patch)
treeadbaf3522176ad3240a47183388d5d8127abd3a8 /src/components/Settings.js
parent7f2413d3d08b5da7a30c17ecfc1586f5bc7b1219 (diff)
Allow setting additional cards to print (#275)
* Add setting for additional cards to print * Render additional cards to print * Do not render additional cards if amount is less than 1 * Render additional cards when printing * Improve layout for portrait printing * Render eap and identity textfields conditionally so that they dont use space * Use all width in print-area * Change additionalCards setting to Input and react to changes * Allow hiding tip (legend) on card * Print only full cards * Move print-area - not-displayed - to the bottom of the page * Set default ssid back to empty, additional cards to 0 * Lower marginBottom of password field to 5 instead of 24 (default) * Use conditional rendering instead of class to hide password * Set marginBottom to QR code only on portrait mode * Set row-gap to 0 to allow up to 6 cards to fit in portrait mode in A4 * Move hideTip setting right after hiddenSSID
Diffstat (limited to 'src/components/Settings.js')
-rw-r--r--src/components/Settings.js21
1 files changed, 20 insertions, 1 deletions
diff --git a/src/components/Settings.js b/src/components/Settings.js
index a0dbab5..837b4f0 100644
--- a/src/components/Settings.js
+++ b/src/components/Settings.js
@@ -1,4 +1,10 @@
1import { Checkbox, Pane, RadioGroup, SelectField } from 'evergreen-ui'; 1import {
2 Checkbox,
3 Pane,
4 RadioGroup,
5 SelectField,
6 TextInputField,
7} from 'evergreen-ui';
2import { useEffect } from 'react'; 8import { useEffect } from 'react';
3import { useTranslation } from 'react-i18next'; 9import { useTranslation } from 'react-i18next';
4import i18n from '../i18n'; 10import i18n from '../i18n';
@@ -62,6 +68,19 @@ export const Settings = (props) => {
62 checked={props.settings.hiddenSSID} 68 checked={props.settings.hiddenSSID}
63 onChange={() => props.onHiddenSSIDChange(!props.settings.hiddenSSID)} 69 onChange={() => props.onHiddenSSIDChange(!props.settings.hiddenSSID)}
64 /> 70 />
71
72 <Checkbox
73 label={t('cards.tip.hide')}
74 checked={props.settings.hideTip}
75 onChange={() => props.onHideTipChange(!props.settings.hideTip)}
76 />
77 <TextInputField
78 type="number"
79 width={300}
80 label={t('cards.additional')}
81 value={props.settings.additionalCards}
82 onChange={(e) => props.onAdditionalCardsChange(e.target.value)}
83 />
65 <RadioGroup 84 <RadioGroup
66 label={t('wifi.password.encryption')} 85 label={t('wifi.password.encryption')}
67 size={16} 86 size={16}