Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 9cfdbec

Browse files
refactor: Remove login banner (coder#5239)
1 parent cec667d commit 9cfdbec

File tree

3 files changed

+32
-148
lines changed

3 files changed

+32
-148
lines changed

site/src/components/SignInForm/SignInForm.tsx

+2-9
Original file line numberDiff line numberDiff line change
@@ -57,15 +57,9 @@ const validationSchema = Yup.object({
5757
})
5858

5959
const useStyles = makeStyles((theme) => ({
60-
wrapper: {
61-
maxWidth: 385,
60+
root: {
6261
width: "100%",
63-
64-
[theme.breakpoints.down("sm")]: {
65-
maxWidth: "none",
66-
},
6762
},
68-
6963
title: {
7064
fontSize: theme.spacing(4),
7165
fontWeight: 400,
@@ -77,7 +71,6 @@ const useStyles = makeStyles((theme) => ({
7771
fontWeight: 600,
7872
},
7973
},
80-
8174
buttonIcon: {
8275
width: 14,
8376
height: 14,
@@ -145,7 +138,7 @@ export const SignInForm: FC<React.PropsWithChildren<SignInFormProps>> = ({
145138
const loginPageTranslation = useTranslation("loginPage")
146139

147140
return (
148-
<div className={styles.wrapper}>
141+
<div className={styles.root}>
149142
<h1 className={styles.title}>
150143
{loginPageTranslation.t("signInTo")}{" "}
151144
<strong>{commonTranslation.t("coder")}</strong>

site/src/i18n/en/loginPage.json

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
{
2-
"signInTo": "Sign in to",
3-
"tipCaption": "Coder Tip"
2+
"signInTo": "Sign in to"
43
}
+29-137
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,11 @@
11
import { makeStyles } from "@material-ui/core/styles"
2-
import { Logo } from "components/Icons/Logo"
32
import { FullScreenLoader } from "components/Loader/FullScreenLoader"
43
import { FC } from "react"
54
import { useLocation } from "react-router-dom"
65
import { AuthContext } from "xServices/auth/authXService"
76
import { LoginErrors, SignInForm } from "components/SignInForm/SignInForm"
87
import { retrieveRedirect } from "util/redirect"
9-
import { Pill } from "components/Pill/Pill"
10-
import { useTranslation } from "react-i18next"
11-
import IdeaIcon from "@material-ui/icons/EmojiObjects"
12-
import { colors } from "theme/colors"
8+
import { CoderIcon } from "components/Icons/CoderIcon"
139

1410
interface LocationState {
1511
isRedirect: boolean
@@ -35,163 +31,59 @@ export const LoginPageView: FC<LoginPageViewProps> = ({
3531
const { authError, getUserError, checkPermissionsError, getMethodsError } =
3632
context
3733
const styles = useStyles()
38-
const { t } = useTranslation("loginPage")
3934

4035
return isLoading ? (
4136
<FullScreenLoader />
4237
) : (
43-
<div className={styles.container}>
44-
<div className={styles.left}>
45-
<Logo fill="white" opacity={1} width={110} />
46-
47-
<div className={styles.formSection}>
48-
<SignInForm
49-
authMethods={context.methods}
50-
redirectTo={redirectTo}
51-
isLoading={isLoading}
52-
loginErrors={{
53-
[LoginErrors.AUTH_ERROR]: authError,
54-
[LoginErrors.GET_USER_ERROR]: isRedirected ? getUserError : null,
55-
[LoginErrors.CHECK_PERMISSIONS_ERROR]: checkPermissionsError,
56-
[LoginErrors.GET_METHODS_ERROR]: getMethodsError,
57-
}}
58-
onSubmit={onSignIn}
59-
/>
60-
</div>
61-
38+
<div className={styles.root}>
39+
<div className={styles.container}>
40+
<CoderIcon fill="white" opacity={1} className={styles.icon} />
41+
<SignInForm
42+
authMethods={context.methods}
43+
redirectTo={redirectTo}
44+
isLoading={isLoading}
45+
loginErrors={{
46+
[LoginErrors.AUTH_ERROR]: authError,
47+
[LoginErrors.GET_USER_ERROR]: isRedirected ? getUserError : null,
48+
[LoginErrors.CHECK_PERMISSIONS_ERROR]: checkPermissionsError,
49+
[LoginErrors.GET_METHODS_ERROR]: getMethodsError,
50+
}}
51+
onSubmit={onSignIn}
52+
/>
6253
<footer className={styles.footer}>
6354
Copyright © 2022 Coder Technologies, Inc.
6455
</footer>
6556
</div>
66-
67-
<div className={styles.right}>
68-
<div className={styles.tipWrapper}>
69-
<Pill
70-
icon={<IdeaIcon className={styles.pillIcon} />}
71-
text={t("tipCaption")}
72-
className={styles.pill}
73-
type="secondary"
74-
/>
75-
<div className={styles.tipContent}>
76-
<h2 className={styles.tipTitle}>Scheduling</h2>
77-
<p>
78-
Coder automates your cloud cost control by ensuring developer
79-
resources are only online while used.
80-
</p>
81-
<img
82-
src="/featured/scheduling.webp"
83-
alt=""
84-
className={styles.tipImage}
85-
/>
86-
</div>
87-
</div>
88-
</div>
8957
</div>
9058
)
9159
}
9260

9361
const useStyles = makeStyles((theme) => ({
94-
container: {
95-
padding: theme.spacing(5),
96-
margin: "auto",
97-
display: "flex",
98-
height: "100vh",
99-
100-
[theme.breakpoints.down("md")]: {
101-
height: "auto",
102-
minHeight: "100vh",
103-
},
104-
105-
[theme.breakpoints.down("sm")]: {
106-
padding: theme.spacing(4),
107-
},
108-
},
109-
110-
left: {
111-
flex: 1,
112-
display: "flex",
113-
flexDirection: "column",
114-
gap: theme.spacing(4),
115-
},
116-
117-
right: {
118-
flex: 1,
119-
120-
[theme.breakpoints.down("md")]: {
121-
display: "none",
122-
},
123-
},
124-
125-
formSection: {
126-
flex: 1,
62+
root: {
63+
padding: theme.spacing(3),
12764
display: "flex",
12865
alignItems: "center",
12966
justifyContent: "center",
67+
minHeight: "100vh",
68+
textAlign: "center",
13069
},
13170

132-
footer: {
133-
fontSize: 12,
134-
color: theme.palette.text.secondary,
135-
},
136-
137-
tipWrapper: {
71+
container: {
13872
width: "100%",
139-
height: "100%",
140-
borderRadius: theme.shape.borderRadius,
141-
background: theme.palette.background.paper,
142-
padding: theme.spacing(5),
73+
maxWidth: 385,
14374
display: "flex",
144-
justifyContent: "center",
75+
flexDirection: "column",
14576
alignItems: "center",
146-
position: "relative",
147-
},
148-
149-
pill: {
150-
position: "absolute",
151-
top: theme.spacing(3),
152-
right: theme.spacing(3),
153-
fontWeight: 600,
154-
fontSize: 10,
155-
letterSpacing: "0.1em",
156-
textTransform: "uppercase",
157-
background: theme.palette.divider,
158-
border: 0,
159-
padding: theme.spacing(0, 1.5),
160-
height: theme.spacing(3.5),
77+
gap: theme.spacing(2),
16178
},
16279

163-
pillIcon: {
164-
color: colors.yellow[5],
80+
icon: {
81+
fontSize: theme.spacing(8),
16582
},
16683

167-
tipContent: {
168-
maxWidth: 570,
169-
textAlign: "center",
170-
fontSize: 16,
84+
footer: {
85+
fontSize: 12,
17186
color: theme.palette.text.secondary,
172-
lineHeight: "160%",
173-
174-
"& p": {
175-
maxWidth: 440,
176-
margin: "auto",
177-
},
178-
179-
"& strong": {
180-
color: theme.palette.text.primary,
181-
},
182-
},
183-
184-
tipTitle: {
185-
fontWeight: 400,
186-
fontSize: 24,
187-
margin: 0,
188-
lineHeight: 1,
189-
marginBottom: theme.spacing(2),
190-
color: theme.palette.text.primary,
191-
},
192-
193-
tipImage: {
194-
maxWidth: 570,
195-
marginTop: theme.spacing(4),
87+
marginTop: theme.spacing(3),
19688
},
19789
}))

0 commit comments

Comments
 (0)