From 093f025de3e97339750dc3df5be626a0315507dc Mon Sep 17 00:00:00 2001 From: Ben Woodward Date: Thu, 5 Aug 2021 12:12:17 -0700 Subject: Style and code refactor (#166) * Move all settings below card * refactor components; lifting state up * background color * Evergreen components for everything * password error * Tighten card size * Simply hide password to basic toggle, never disable * Hide password label, too * Maximize mobile portrait width * Make wifi tip smaller * Small style tweaks * Copy: update password length error text to include helpful instructions This will need a backfill for other translations * Remove unused css * Use empty string for EncryptionMode=None value * Remove light.min.css * Include logo on wificard * Cleanup after rebase * Clean-up comments on state * Padding for mobile --- src/components/Settings.js | 77 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 77 insertions(+) create mode 100644 src/components/Settings.js (limited to 'src/components/Settings.js') diff --git a/src/components/Settings.js b/src/components/Settings.js new file mode 100644 index 0000000..1c28dab --- /dev/null +++ b/src/components/Settings.js @@ -0,0 +1,77 @@ +import { Checkbox, Pane, RadioGroup, SelectField } from 'evergreen-ui'; +import { useEffect, useState } from 'react'; +import { useTranslation } from 'react-i18next'; +import i18n from '../i18n'; +import './style.css'; + +export const Settings = (props) => { + const { t } = useTranslation(); + const [encryptionModes] = useState([ + { label: 'None', value: '' }, + { label: 'WPA/WPA2/WPA3', value: 'WPA' }, + { label: 'WEP', value: 'WEP' }, + ]); + + useEffect(() => { + if (props.firstLoad.current && window.innerWidth < 500) { + props.onFirstLoad(); + props.onOrientationChange(true); + } + }); + + return ( + + props.onLanguageChange(e.target.value)} + > + + + + + + + + + + + + + + + + + + + + + + + + + + props.onOrientationChange(!props.settings.portrait)} + /> + + props.onHidePasswordChange(!props.settings.hidePassword) + } + /> + props.onEncryptionModeChange(e.target.value)} + /> + + ); +}; -- cgit v1.2.3