Skip to content

Commit b50b34d

Browse files
committed
Format
1 parent 14b9e86 commit b50b34d

File tree

6 files changed

+50
-60
lines changed

6 files changed

+50
-60
lines changed

site/src/components/BorderedMenu/types.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
import SvgIcon from "@material-ui/core/SvgIcon";
2-
import { RouteProps } from "react-router-dom";
1+
import SvgIcon from "@material-ui/core/SvgIcon"
2+
import { RouteProps } from "react-router-dom"
33

44
export type RouteNavbarGroup = "main" | "admin"
55

6-
interface BasicRouteConfig {
6+
interface BasicRouteConfig {
77
path: string
88
/** Use to match when the path includes variables. */
99
re?: RegExp
@@ -24,7 +24,7 @@ interface RouteConfigWithNav extends BasicRouteConfig {
2424

2525
export type RouteConfig = BasicRouteConfig | RouteConfigWithNav
2626
export interface NavbarEntryProps extends Pick<RouteConfig, "description" | "Icon" | "label" | "path"> {
27-
selected: boolean
28-
className?: string
29-
onClick?: () => void
30-
}
27+
selected: boolean
28+
className?: string
29+
onClick?: () => void
30+
}

site/src/components/Navbar/AdminDropdown/index.tsx

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ const Language = {
1818
orgsLabel: "Organizations",
1919
orgsDescription: "Manage organizations.",
2020
settingsLabel: "Settings",
21-
settingsDescription: "Configure authentication and more."
21+
settingsDescription: "Configure authentication and more.",
2222
}
2323

2424
const entries = [
@@ -38,8 +38,8 @@ const entries = [
3838
label: Language.settingsLabel,
3939
description: Language.settingsDescription,
4040
path: "/settings",
41-
Icon: AdminIcon
42-
}
41+
Icon: AdminIcon,
42+
},
4343
]
4444

4545
export const AdminDropdown: React.FC = () => {
@@ -54,11 +54,7 @@ export const AdminDropdown: React.FC = () => {
5454
<div className={styles.link}>
5555
<ListItem selected={Boolean(anchorEl)} button onClick={onOpenAdminMenu}>
5656
<ListItemText className="no-brace" color="primary" primary="Admin" />
57-
{anchorEl ? (
58-
<CloseDropdown />
59-
) : (
60-
<OpenDropdown />
61-
)}
57+
{anchorEl ? <CloseDropdown /> : <OpenDropdown />}
6258
</ListItem>
6359
</div>
6460

site/src/components/Navbar/NavbarView.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,7 @@ export const NavbarView: React.FC<NavbarViewProps> = ({ user, onSignOut }) => {
2424
</Link>
2525
</div>
2626
<div className={styles.fullWidth} />
27-
{user && user.email === "admin@coder.com" &&
28-
<AdminDropdown />
29-
}
27+
{user && user.email === "admin@coder.com" && <AdminDropdown />}
3028
<div className={styles.fixed}>{user && <UserDropdown user={user} onSignOut={onSignOut} />}</div>
3129
</div>
3230
)

site/src/components/Navbar/UserDropdown.tsx

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,7 @@ export const UserDropdown: React.FC<UserDropdownProps> = ({ user, onSignOut }: U
3838
<Badge overlap="circle">
3939
<UserAvatar username={user.username} />
4040
</Badge>
41-
{anchorEl ? (
42-
<CloseDropdown />
43-
) : (
44-
<OpenDropdown />
45-
)}
41+
{anchorEl ? <CloseDropdown /> : <OpenDropdown />}
4642
</div>
4743
</MenuItem>
4844
</div>

site/src/components/Typography/index.tsx

Lines changed: 36 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -3,40 +3,40 @@
33
* verbatim port from `@coder/ui`.
44
*/
55

6-
import { makeStyles } from "@material-ui/core/styles"
7-
import MuiTypography, { TypographyProps as MuiTypographyProps } from "@material-ui/core/Typography"
8-
import * as React from "react"
6+
import { makeStyles } from "@material-ui/core/styles"
7+
import MuiTypography, { TypographyProps as MuiTypographyProps } from "@material-ui/core/Typography"
8+
import * as React from "react"
99
import { combineClasses, appendCSSString } from "../../util/combineClasses"
10-
11-
export interface TypographyProps extends MuiTypographyProps {
12-
short?: boolean
13-
}
14-
15-
/**
16-
* Wrapper around Material UI's Typography component to allow for future
17-
* custom typography types.
18-
*
19-
* See original component's Material UI documentation here: https://material-ui.com/components/typography/
20-
*/
21-
export const Typography: React.FC<TypographyProps> = ({ className, short, ...rest }) => {
22-
const styles = useStyles()
23-
24-
let classes = combineClasses({ [styles.short]: short })
25-
if (className) {
26-
classes = appendCSSString(classes ?? "", className)
27-
}
28-
29-
return <MuiTypography {...rest} className={classes} />
30-
}
31-
32-
const useStyles = makeStyles({
33-
short: {
34-
"&.MuiTypography-body1": {
35-
lineHeight: "21px",
36-
},
37-
"&.MuiTypography-body2": {
38-
lineHeight: "18px",
39-
letterSpacing: 0.2,
40-
},
41-
},
42-
})
10+
11+
export interface TypographyProps extends MuiTypographyProps {
12+
short?: boolean
13+
}
14+
15+
/**
16+
* Wrapper around Material UI's Typography component to allow for future
17+
* custom typography types.
18+
*
19+
* See original component's Material UI documentation here: https://material-ui.com/components/typography/
20+
*/
21+
export const Typography: React.FC<TypographyProps> = ({ className, short, ...rest }) => {
22+
const styles = useStyles()
23+
24+
let classes = combineClasses({ [styles.short]: short })
25+
if (className) {
26+
classes = appendCSSString(classes ?? "", className)
27+
}
28+
29+
return <MuiTypography {...rest} className={classes} />
30+
}
31+
32+
const useStyles = makeStyles({
33+
short: {
34+
"&.MuiTypography-body1": {
35+
lineHeight: "21px",
36+
},
37+
"&.MuiTypography-body2": {
38+
lineHeight: "18px",
39+
letterSpacing: 0.2,
40+
},
41+
},
42+
})

site/src/util/nullable.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
* A Nullable may be its concrete type, `null` or `undefined`
33
* @remark Exact opposite of the native TS type NonNullable<T>
44
*/
5-
export type Nullable<T> = null | undefined | T
5+
export type Nullable<T> = null | undefined | T

0 commit comments

Comments
 (0)