-
Notifications
You must be signed in to change notification settings - Fork 1
Alternative Login Picker #2058
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
eilifhl
wants to merge
23
commits into
master
Choose a base branch
from
Eilif/alternative-login-picker
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+171
−70
Open
Alternative Login Picker #2058
Changes from all commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
f031589
Implement alternative login picker
eilifhl d69ed72
Linter
eilifhl c1264e9
Add backlink
eilifhl 6ae855c
Use arrow icon instead of plain css (for readability)
eilifhl 501c5b6
Use color constants
eilifhl 67ba0ff
Center select dot
eilifhl 0337b96
Use button to pass biome
eilifhl 8d42b43
Add caption "innlogging for interne"
eilifhl 6ac5fe1
Change hint text
eilifhl 0479ccc
Rephrase samf3 hint
eilifhl 28e517b
STYLEEEELIIIINT!!!!!!!! GRRRRRR
eilifhl c6f3dc5
Add boxes for easier mobile use
eilifhl f44abb1
biome
eilifhl f2374c5
Add samf colors to boxes
eilifhl f078f5a
Add darkmode support
eilifhl 740fe9f
change heading color
eilifhl ff7f0da
Increase circle size, justify fortsett right
eilifhl 1b2d52c
Change bg color of selected
eilifhl bec770b
Remove transition
eilifhl e2bba9e
Create breadcrumbs for new-login
eilifhl 169e5da
Remove form, add buttons, add arrows
eilifhl 2486cb6
Biome
eilifhl 92d68e5
Adjust font weights
eilifhl File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
171 changes: 124 additions & 47 deletions
171
frontend/src/Pages/LoginPickerPage/LoginPickerPage.module.scss
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,81 +1,158 @@ | ||
| @use 'sass:color'; | ||
|
|
||
| @use 'src/constants' as *; | ||
|
|
||
| @use 'src/mixins' as *; | ||
|
|
||
| .container { | ||
| min-height: 100%; | ||
| max-width: 960px; | ||
| margin: 0 auto; | ||
| padding: 2rem 1rem; | ||
| } | ||
|
|
||
| .formWrapper { | ||
| max-width: 640px; | ||
| display: flex; | ||
| flex-direction: column; | ||
| align-items: center; | ||
| padding: 2rem 1rem; | ||
| } | ||
|
|
||
| .header { | ||
| text-align: center; | ||
| margin-bottom: 2rem; | ||
| .caption { | ||
| display: block; | ||
| font-size: 1.25rem; | ||
| color: $grey-1; | ||
| margin-bottom: 5px; | ||
| font-weight: 400; | ||
|
|
||
| @include theme-dark { | ||
| color: $grey-3; | ||
| } | ||
| } | ||
|
|
||
| .headerTitle { | ||
| font-size: 2rem; | ||
| margin: 0 0 .25rem 0; | ||
| } | ||
| color: $black-1; | ||
| font-size: 3rem; | ||
| font-weight: 700; | ||
| margin-top: 0; | ||
| margin-bottom: 30px; | ||
| line-height: 1.1; | ||
|
|
||
| .headerSubtitle { | ||
| font-size: 1.25rem; | ||
| opacity: 0.9; | ||
| margin: 0; | ||
| @include theme-dark { | ||
| color: $white; | ||
| } | ||
| } | ||
|
|
||
| .picker { | ||
| display: flex; | ||
| justify-content: center; | ||
| align-items: flex-start; | ||
| gap: 3rem; | ||
| flex-wrap: wrap; | ||
| flex-direction: column; | ||
| margin-bottom: 30px; | ||
| } | ||
|
|
||
| .choiceWrapper { | ||
| position: relative; | ||
| display: flex; | ||
| flex-direction: column; | ||
| align-items: center; | ||
| width: 280px; | ||
| text-align: center; | ||
| min-height: 200px; | ||
| justify-content: space-between; | ||
| width: 100%; | ||
| padding: 22px 30px; | ||
| border: 2px solid $grey-35; | ||
| background-color: $white; | ||
| cursor: pointer; | ||
| margin-bottom: 15px; | ||
| text-align: left; | ||
| font-family: inherit; | ||
|
|
||
| @include theme-dark { | ||
| background-color: $theme_dark_input_bg; | ||
| border-color: $grey-1; | ||
| } | ||
|
|
||
| &:hover { | ||
| border-color: $red_samf_hover; | ||
| background-color: $grey-5; | ||
|
|
||
| @include theme-dark { | ||
| background-color: $black-2; | ||
| border-color: $red_samf_faded; | ||
| } | ||
| } | ||
| } | ||
|
|
||
| .description { | ||
| margin-bottom: 1rem; | ||
| line-height: 1.4; | ||
| min-height: 3.5rem; | ||
| .textWrapper { | ||
| display: flex; | ||
| align-items: center; | ||
| justify-content: center; | ||
| flex-direction: column; | ||
| } | ||
|
|
||
| .choice { | ||
| display: flex; | ||
| align-items: center; | ||
| justify-content: center; | ||
| text-decoration: none; | ||
| font-weight: 700; | ||
| .radioLabel { | ||
| display: block; | ||
| color: $black-1; | ||
| font-size: 1.5rem; | ||
| padding: 1rem; | ||
| border-radius: 6px; | ||
| background: $red-samf; | ||
| color: $white; | ||
| box-shadow: 0 1px 2px rgba(0,0,0,.08); | ||
| min-height: 100px; | ||
| transition: transform .05s ease, filter .15s ease, box-shadow .15s ease; | ||
|
|
||
| &:hover { filter: brightness(0.96); } | ||
| &:active { transform: translateY(1px); } | ||
| &:focus-visible { | ||
| outline: 3px solid rgba(0,0,0,.4); | ||
| outline-offset: 3px; | ||
| font-weight: 600; | ||
| cursor: pointer; | ||
| margin-bottom: 4px; | ||
|
|
||
| @include theme-dark { | ||
| color: $white; | ||
| } | ||
| } | ||
|
|
||
| .choiceTitle { | ||
| .description { | ||
| color: $grey-1; | ||
| font-size: 1.1rem; | ||
| font-weight: 300; | ||
| margin: 0; | ||
| line-height: 1.5; | ||
|
|
||
| @include theme-dark { | ||
| color: $grey-3; | ||
| } | ||
| } | ||
|
|
||
| .arrowIcon { | ||
| font-size: 2.5rem; | ||
| color: $black-1; | ||
| margin-left: 20px; | ||
| flex-shrink: 0; | ||
|
|
||
| @include theme-dark { | ||
| color: $white; | ||
| } | ||
| } | ||
|
|
||
| .backLink { | ||
| background: none; | ||
| border: none; | ||
| padding: 0; | ||
| font: inherit; | ||
| cursor: pointer; | ||
| display: inline-flex; | ||
| align-items: center; | ||
| margin-top: 15px; | ||
| margin-bottom: 25px; | ||
| color: $black-1; | ||
| text-decoration: underline; | ||
| text-underline-offset: 3px; | ||
|
|
||
| @include theme-dark { | ||
| color: $theme_dark_color; | ||
| } | ||
|
|
||
| &:hover { | ||
| color: $grey-1; | ||
| text-decoration-thickness: 2px; | ||
|
|
||
| @include theme-dark { | ||
| color: $white; | ||
| } | ||
| } | ||
|
|
||
| &:focus-visible { | ||
| outline: 3px solid $orange-light; | ||
| outline-offset: 2px; | ||
| } | ||
| } | ||
|
|
||
| .backIcon { | ||
| margin-right: 4px; | ||
| font-size: 1.2rem; | ||
| text-decoration: none; | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,12 +1,11 @@ | ||
| import { Icon } from '@iconify/react'; | ||
| import type { FC } from 'react'; | ||
| import { Link } from 'react-router'; | ||
| import { useNavigate } from 'react-router-dom'; | ||
| import { Page } from '~/Components'; | ||
| import { SAMF3_LOGIN_URL } from '~/routes/samf-three'; | ||
| import styles from './LoginPickerPage.module.scss'; | ||
|
|
||
| type Props = { | ||
| newRoute: string; | ||
| }; | ||
| type Props = { newRoute: string }; | ||
|
|
||
| /** | ||
| * A page that allows users to choose between the old and new samf login. | ||
|
|
@@ -15,29 +14,43 @@ type Props = { | |
| * @constructor | ||
| */ | ||
| export const LoginPickerPage: FC<Props> = ({ newRoute }) => { | ||
| const navigate = useNavigate(); | ||
|
|
||
| const handleChoice = (choice: 'new' | 'old') => { | ||
| if (choice === 'new') navigate(newRoute); | ||
| else if (choice === 'old') window.location.href = SAMF3_LOGIN_URL.login; | ||
| }; | ||
|
|
||
| return ( | ||
| <Page> | ||
| <div className={styles.container}> | ||
| <div className={styles.header}> | ||
| <h1 className={styles.headerTitle}>Logg inn som intern</h1> | ||
| <p className={styles.headerSubtitle}>Velg hvilket system du vil logge inn på</p> | ||
| </div> | ||
| <button type="button" className={styles.backLink} onClick={() => navigate(-1)}> | ||
| <Icon icon="mdi:chevron-left" className={styles.backIcon} /> | ||
| Tilbake | ||
| </button> | ||
|
|
||
| <nav aria-label="Velg innlogging" className={styles.picker}> | ||
| <div className={styles.choiceWrapper}> | ||
| <p className={styles.description}>For å administrere grupper, og andre administrative oppgaver</p> | ||
| <a href={SAMF3_LOGIN_URL.login} className={styles.choice} role="button" aria-label="Gamle samf (samf3)"> | ||
| <h3 className={styles.choiceTitle}>Gamle samf (samf3)</h3> | ||
| </a> | ||
| </div> | ||
| <div className={styles.formWrapper}> | ||
| <span className={styles.caption}>Innlogging for interne</span> | ||
| <h1 className={styles.headerTitle}>Hvordan vil du logge inn?</h1> | ||
|
|
||
| <div className={styles.picker}> | ||
| <button type="button" className={styles.choiceWrapper} onClick={() => handleChoice('new')}> | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Bruk en anchor tag her, ikke button. Mye bedre accessibility og så kan du droppe |
||
| <div className={styles.textWrapper}> | ||
| <span className={styles.radioLabel}>Logg inn på ny plattform (samf4)</span> | ||
| <p className={styles.description}>Den nye plattformen for arrangementer og generell bruk</p> | ||
| </div> | ||
| <Icon icon="mdi:arrow-right" className={styles.arrowIcon} /> | ||
| </button> | ||
|
|
||
| <div className={styles.choiceWrapper}> | ||
| <p className={styles.description}>Den nye plattformen for arrangementer og generell bruk</p> | ||
| <Link to={newRoute} className={styles.choice} role="button" aria-label="Ny samf (samf4)"> | ||
| <h3 className={styles.choiceTitle}>Ny samf (samf4)</h3> | ||
| </Link> | ||
| <button type="button" className={styles.choiceWrapper} onClick={() => handleChoice('old')}> | ||
| <div className={styles.textWrapper}> | ||
| <span className={styles.radioLabel}>Logg inn på eldre plattform (samf3)</span> | ||
| <p className={styles.description}>Gruppeadministrasjon og andre administrative oppgaver</p> | ||
| </div> | ||
| <Icon icon="mdi:arrow-right" className={styles.arrowIcon} /> | ||
| </button> | ||
| </div> | ||
| </nav> | ||
| </div> | ||
| </div> | ||
| </Page> | ||
| ); | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hvorfor ble bruken av
navfjernet? Vil si den er veldig relevant å bruke herThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oops