Skip to content

Commit be79ae7

Browse files
refactor: Add coder tip pill on sign in page (#5196)
1 parent 2a73362 commit be79ae7

File tree

2 files changed

+32
-1
lines changed

2 files changed

+32
-1
lines changed

site/src/i18n/en/loginPage.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
{
2-
"signInTo": "Sign in to"
2+
"signInTo": "Sign in to",
3+
"tipCaption": "Coder Tip"
34
}

site/src/pages/LoginPage/LoginPageView.tsx

+30
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ import { useLocation } from "react-router-dom"
66
import { AuthContext } from "xServices/auth/authXService"
77
import { LoginErrors, SignInForm } from "components/SignInForm/SignInForm"
88
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"
913

1014
interface LocationState {
1115
isRedirect: boolean
@@ -31,6 +35,7 @@ export const LoginPageView: FC<LoginPageViewProps> = ({
3135
const { authError, getUserError, checkPermissionsError, getMethodsError } =
3236
context
3337
const styles = useStyles()
38+
const { t } = useTranslation("loginPage")
3439

3540
return isLoading ? (
3641
<FullScreenLoader />
@@ -61,6 +66,12 @@ export const LoginPageView: FC<LoginPageViewProps> = ({
6166

6267
<div className={styles.right}>
6368
<div className={styles.tipWrapper}>
69+
<Pill
70+
icon={<IdeaIcon className={styles.pillIcon} />}
71+
text={t("tipCaption")}
72+
className={styles.pill}
73+
type="secondary"
74+
/>
6475
<div className={styles.tipContent}>
6576
<h2 className={styles.tipTitle}>Scheduling</h2>
6677
<p>
@@ -132,6 +143,25 @@ const useStyles = makeStyles((theme) => ({
132143
display: "flex",
133144
justifyContent: "center",
134145
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),
161+
},
162+
163+
pillIcon: {
164+
color: colors.yellow[5],
135165
},
136166

137167
tipContent: {

0 commit comments

Comments
 (0)