From 0e706eee5e25dbdc25f8008522a476fd70ed0d0b Mon Sep 17 00:00:00 2001 From: Rodrigo Boufleur Date: Fri, 29 Nov 2024 15:07:12 +0000 Subject: [PATCH 1/2] fix: Fix heading and linea logo --- backend/newsletter/templates/base.tpl | 9 +++++---- backend/newsletter/templates/header.html | 15 ++++++++++++++- 2 files changed, 19 insertions(+), 5 deletions(-) diff --git a/backend/newsletter/templates/base.tpl b/backend/newsletter/templates/base.tpl index 068209f1..679eb055 100644 --- a/backend/newsletter/templates/base.tpl +++ b/backend/newsletter/templates/base.tpl @@ -57,9 +57,8 @@ .header-container { background-color: #0076BC; color: #ffffff; - padding: 20px; + padding: 5px; font-family: Helvetica, sans-serif; - display: flex; align-items: center; justify-content: center; } @@ -70,24 +69,26 @@ .header-title { margin: 0; - font-size: 20px; + font-size: 22px; line-height: 1.5; font-weight: normal; text-align: center; } - .token { + .token { font-size: 32px; font-weight: bold; color: #0076BC; text-align: center; margin: 20px 0; + letter-spacing: 8px; /* Adjust the value as needed */ } +
{% include 'header.html' %} {% block content %} {% endblock %} diff --git a/backend/newsletter/templates/header.html b/backend/newsletter/templates/header.html index 1f642d44..8e875ed2 100644 --- a/backend/newsletter/templates/header.html +++ b/backend/newsletter/templates/header.html @@ -3,7 +3,20 @@ From f7d60d2088038e94cdbaab4c3397d3e2cb8fb4e2 Mon Sep 17 00:00:00 2001 From: Rodrigo Boufleur Date: Fri, 29 Nov 2024 15:08:33 +0000 Subject: [PATCH 2/2] refactor(frontend/src/pages/PublicPortal/Login/index.js): Refactor login page Adds extra information e.g. subscription and other instructions --- .../src/pages/PublicPortal/Login/index.js | 109 +++++++++++++----- 1 file changed, 78 insertions(+), 31 deletions(-) diff --git a/frontend/src/pages/PublicPortal/Login/index.js b/frontend/src/pages/PublicPortal/Login/index.js index 18669f05..bfb1d8a4 100644 --- a/frontend/src/pages/PublicPortal/Login/index.js +++ b/frontend/src/pages/PublicPortal/Login/index.js @@ -6,6 +6,9 @@ import Stack from '@mui/material/Stack' import TextField from '@mui/material/TextField' import Button from '@mui/material/Button' import Alert from '@mui/material/Alert' +import Divider from '@mui/material/Divider' +import Link from '@mui/material/Link' +import SettingsIcon from '@mui/icons-material/Settings' import { sendPasswordLessCode, passwordLessSignIn, loggedUser } from '../../../services/api/Auth' @@ -21,12 +24,11 @@ function PublicLogin() { useEffect(() => { loggedUser() .then((res) => { - console.log('Logged') if (res) { window.location.replace('/newsletter_settings/') } }) - .catch((res) => { + .catch(() => { console.log('Not logged') }) }, []) @@ -42,85 +44,130 @@ function PublicLogin() { const handleChangeEmail = (e) => { setEmail(e.target.value) resetForm() - if (e.target.validity.valid) { - setEmailIsValid(true) - } else { - setEmailIsValid(false) - } + setEmailIsValid(e.target.validity.valid) } const handleSendCode = () => { sendPasswordLessCode(email) - .then((res) => { + .then(() => { setCodeSended(true) }) - .catch((res) => { + .catch(() => { setSendCodeError(true) }) } const handleChangeCode = (e) => { setCode(e.target.value) - if (e.target.value.length === 6) { - setCodeIsValid(true) - } else { - setCodeIsValid(false) - } + setCodeIsValid(e.target.value.length === 6) } const handleSignin = () => { - passwordLessSignIn(email, token).catch((res) => { - console.log('Autehntication failed') + passwordLessSignIn(email, token).catch(() => { setSigninError(true) }) } return ( - - - - + + + {/* Header */} + + + LIneA Occultation Prediction Database + + + {/* Body */} + + Sign in to your account - - Don't have an account? Get started + + Don't have an account?{' '} + + Subscribe now. + + + Once you've signed in, click on the{' '} + {' '} + icon to customize your filter settings. + + + {/* Form */} - + {tokenSended && ( - + We’ve sent a 6-character code to {email}. The code expires shortly, so please enter it soon. )} {sendCodeError && ( - + The authentication code could not be sent to this email. Please check your email address and try again. )} - + Can’t find your code? Check your spam folder! - {signinError && ( - + Authentication failed, please check your email and code and try again. )} - - - + + ) } + export default PublicLogin
-

LIneA Occultation Prediction Database

+ + + + + +
+ LIneA Logo + +

+ LIneA Occultation Prediction Database +

+