Skip to content

chore: use emotion for styling (pt. 8) #10447

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

Merged
merged 23 commits into from
Nov 1, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
emotion: CliAuthPageView
  • Loading branch information
aslilac committed Oct 31, 2023
commit 44ff69b6dbca3b4b33f5487cc9c9358f448eb2be
62 changes: 28 additions & 34 deletions site/src/pages/CliAuthPage/CliAuthPageView.tsx
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
import Button from "@mui/material/Button";
import { makeStyles } from "@mui/styles";
import { useTheme } from "@emotion/react";
import { type FC } from "react";
import { Link as RouterLink } from "react-router-dom";
import { CodeExample } from "components/CodeExample/CodeExample";
import { SignInLayout } from "components/SignInLayout/SignInLayout";
import { Welcome } from "components/Welcome/Welcome";
import { FC } from "react";
import { Link as RouterLink } from "react-router-dom";
import { FullScreenLoader } from "components/Loader/FullScreenLoader";

export interface CliAuthPageViewProps {
sessionToken: string | null;
}

export const CliAuthPageView: FC<CliAuthPageViewProps> = ({ sessionToken }) => {
const styles = useStyles();
const theme = useTheme();

if (!sessionToken) {
return <FullScreenLoader />;
Expand All @@ -22,45 +22,39 @@ export const CliAuthPageView: FC<CliAuthPageViewProps> = ({ sessionToken }) => {
<SignInLayout>
<Welcome message="Session token" />

<p className={styles.text}>
<p
css={{
fontSize: 16,
color: theme.palette.text.secondary,
marginBottom: theme.spacing(4),
textAlign: "center",
lineHeight: "160%",
}}
>
Copy the session token below and{" "}
<strong className={styles.lineBreak}>paste it in your terminal</strong>.
<strong
css={{
whiteSpace: "nowrap",
}}
>
paste it in your terminal
</strong>
.
</p>

<CodeExample code={sessionToken} password />

<div className={styles.links}>
<div
css={{
display: "flex",
justifyContent: "flex-end",
paddingTop: theme.spacing(1),
}}
>
<Button component={RouterLink} size="large" to="/workspaces" fullWidth>
Go to workspaces
</Button>
</div>
</SignInLayout>
);
};

const useStyles = makeStyles((theme) => ({
title: {
fontSize: theme.spacing(4),
fontWeight: 400,
lineHeight: "140%",
margin: 0,
},

text: {
fontSize: 16,
color: theme.palette.text.secondary,
marginBottom: theme.spacing(4),
textAlign: "center",
lineHeight: "160%",
},

lineBreak: {
whiteSpace: "nowrap",
},

links: {
display: "flex",
justifyContent: "flex-end",
paddingTop: theme.spacing(1),
},
}));