From 2c4114f3a0990203dfc560ebcd4e7a81b48c0ae1 Mon Sep 17 00:00:00 2001 From: Rami Berman Date: Sun, 9 Jan 2022 13:48:14 +0200 Subject: [PATCH] log in page --- ui/src/components/InstallPage.tsx | 9 ++-- ui/src/components/LoginPage.tsx | 19 +++++--- .../components/SettingsModal/SettingModal.tsx | 7 ++- .../SettingsModal/SettingsModal.sass | 14 +++--- ui/src/components/style/AuthBasePage.sass | 45 ++++++++++++++++++- ui/src/components/style/Common.sass | 21 --------- ui/src/helpers/commonStyle.ts | 11 ++++- 7 files changed, 81 insertions(+), 45 deletions(-) delete mode 100644 ui/src/components/style/Common.sass diff --git a/ui/src/components/InstallPage.tsx b/ui/src/components/InstallPage.tsx index a30aa14c2..234d55545 100644 --- a/ui/src/components/InstallPage.tsx +++ b/ui/src/components/InstallPage.tsx @@ -5,6 +5,7 @@ import { adminUsername } from "../consts"; import Api, { FormValidationErrorType } from "../helpers/api"; import { toast } from 'react-toastify'; import LoadingOverlay from "./LoadingOverlay"; +import { useCommonStyles } from "../helpers/commonStyle"; const api = Api.getInstance(); @@ -14,6 +15,7 @@ interface InstallPageProps { export const InstallPage: React.FC = ({onFirstLogin}) => { + const classes = useCommonStyles(); const [isLoading, setIsLoading] = useState(false); const [password, setPassword] = useState(""); const [passwordConfirm, setPasswordConfirm] = useState(""); @@ -53,11 +55,12 @@ export const InstallPage: React.FC = ({onFirstLogin}) => { return
{isLoading && } -

Welcome to Mizu, please set up the admin user to continue

- +
Setup
+ Welcome to Mizu, please set up the admin user to continue + setPassword(e.target.value)}/> setPasswordConfirm(e.target.value)}/> - +
; }; diff --git a/ui/src/components/LoginPage.tsx b/ui/src/components/LoginPage.tsx index be0a6861d..964aac1b5 100644 --- a/ui/src/components/LoginPage.tsx +++ b/ui/src/components/LoginPage.tsx @@ -3,15 +3,15 @@ import React, { useContext, useState } from "react"; import { toast } from "react-toastify"; import { MizuContext, Page } from "../EntApp"; import Api from "../helpers/api"; +import { useCommonStyles } from "../helpers/commonStyle"; import LoadingOverlay from "./LoadingOverlay"; -import './style/Common.sass'; const api = Api.getInstance(); const LoginPage: React.FC = () => { + const classes = useCommonStyles(); const [isLoading, setIsLoading] = useState(false); - const [username, setUsername] = useState(""); const [password, setPassword] = useState(""); @@ -39,10 +39,17 @@ const LoginPage: React.FC = () => { return
{isLoading && } -
Login
- setUsername(e.target.value)} /> - setPassword(e.target.value)} /> - +
Login
+
+ + setUsername(event.target.value)}/> +
+
+ + setPassword(event.target.value)}/> +
+ +
; }; diff --git a/ui/src/components/SettingsModal/SettingModal.tsx b/ui/src/components/SettingsModal/SettingModal.tsx index 14cf6ec94..e7629f74d 100644 --- a/ui/src/components/SettingsModal/SettingModal.tsx +++ b/ui/src/components/SettingsModal/SettingModal.tsx @@ -2,7 +2,6 @@ import React, {useEffect, useMemo, useState} from "react"; import {Modal, Backdrop, Fade, Box, Button} from "@material-ui/core"; import {modalStyle} from "../Filters"; import Checkbox from "../UI/Checkbox"; -import '../style/Common.sass'; import './SettingsModal.sass'; import Api from "../../helpers/api"; import spinner from "../assets/spinner.svg"; @@ -121,7 +120,7 @@ export const SettingsModal: React.FC = ({isOpen, onClose, is
-
Tapping Settings
+
Tapping Settings
Please choose from below the namespaces for tapping, traffic for namespaces selected will be displayed
@@ -130,7 +129,7 @@ export const SettingsModal: React.FC = ({isOpen, onClose, is
: <>
- setSearchValue(event.target.value)}/>
{buildNamespacesTable()} @@ -148,4 +147,4 @@ export const SettingsModal: React.FC = ({isOpen, onClose, is -} +} \ No newline at end of file diff --git a/ui/src/components/SettingsModal/SettingsModal.sass b/ui/src/components/SettingsModal/SettingsModal.sass index d580dd150..27d4a5daf 100644 --- a/ui/src/components/SettingsModal/SettingsModal.sass +++ b/ui/src/components/SettingsModal/SettingsModal.sass @@ -1,5 +1,10 @@ @import "../../variables.module" +.settingsTitle + font-size: 28px + color: $blue-gray + font-weight: 600 + .settingsSubtitle font-size: 14px color: $light-gray @@ -11,15 +16,8 @@ padding: 20px 0 .searchNamespace - outline: 0 - background: white - border-radius: 4px width: 300px max-width: calc(40vw - 85px) - padding: 8px 10px - border: 1px #9D9D9D solid - font-size: 14px - color: #494677 .settingsActionsContainer display: flex @@ -53,4 +51,4 @@ td color: $light-gray padding: 10px - font-size: 16px + font-size: 16px \ No newline at end of file diff --git a/ui/src/components/style/AuthBasePage.sass b/ui/src/components/style/AuthBasePage.sass index fae44571c..8abe6453e 100644 --- a/ui/src/components/style/AuthBasePage.sass +++ b/ui/src/components/style/AuthBasePage.sass @@ -1,3 +1,5 @@ +@import "../../variables.module" + .authContainer height: 100vh width: 100vw @@ -5,8 +7,47 @@ float: left .authHeader - margin: 4% 0 + margin: 80px 0 120px 0 width: 100% display: flex align-items: center - justify-content: center \ No newline at end of file + justify-content: center + +.centeredForm + background-color: $main-background-color + border-radius: 5px + box-shadow: 0 0 20px -4px $light-blue-color + + padding: 35px + max-width: 350px + text-align: center + display: flex + flex-direction: column + margin: 0 auto + +.form-button + margin-top: 25px !important + padding: 14px 0 !important + .MuiButton-label + text-transform: none !important + +.form-input + margin-top: 20px !important + input + width: 100% + box-sizing: border-box + label + float: left + font-size: 12px + opacity: 0.7 + margin-bottom: 4px + +.form-title + font-size: 28px + color: $blue-gray + font-weight: 600 + text-align: left + +.form-subtitle + text-align: left + margin: 4% 0 \ No newline at end of file diff --git a/ui/src/components/style/Common.sass b/ui/src/components/style/Common.sass deleted file mode 100644 index 911a48797..000000000 --- a/ui/src/components/style/Common.sass +++ /dev/null @@ -1,21 +0,0 @@ -@import "../../variables.module" - -.centeredForm - background-color: $main-background-color - border-radius: 5px - box-shadow: 0 0 20px -4px $light-blue-color - - padding: 4% 2% - max-width: 350px - text-align: center - display: flex - flex-direction: column - margin: 0 auto - -.form-input, .form-button - margin-top: 20px - -.title - font-size: 28px - color: $blue-gray - font-weight: 600 \ No newline at end of file diff --git a/ui/src/helpers/commonStyle.ts b/ui/src/helpers/commonStyle.ts index cae681d5a..8c4e2e34e 100644 --- a/ui/src/helpers/commonStyle.ts +++ b/ui/src/helpers/commonStyle.ts @@ -26,5 +26,14 @@ export const useCommonStyles = makeStyles(() => ({ "&:hover": { backgroundColor: "transparent", }, - } + }, + textField: { + outline: 0, + background: "white", + borderRadius: "4px", + padding: "8px 10px", + border: "1px #9D9D9D solid", + fontSize: "14px", + color: "#494677" + }, }));