Skip to content

Commit a121c7e

Browse files
committed
Lint
1 parent 675b195 commit a121c7e

File tree

6 files changed

+30
-45
lines changed

6 files changed

+30
-45
lines changed

site/src/components/BorderedMenu/BorderedMenu.stories.tsx

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -12,28 +12,19 @@ export default {
1212

1313
const Template: Story<BorderedMenuProps> = (args: BorderedMenuProps) => (
1414
<BorderedMenu {...args}>
15-
<BorderedMenuRow
16-
title="Item 1"
17-
description="Here's a description"
18-
Icon={BuildingIcon}
19-
/>
20-
<BorderedMenuRow
21-
active
22-
title="Item 2"
23-
description="This BorderedMenuRow is active"
24-
Icon={UsersOutlinedIcon}
25-
/>
15+
<BorderedMenuRow title="Item 1" description="Here's a description" Icon={BuildingIcon} />
16+
<BorderedMenuRow active title="Item 2" description="This BorderedMenuRow is active" Icon={UsersOutlinedIcon} />
2617
</BorderedMenu>
2718
)
2819

2920
export const AdminVariant = Template.bind({})
3021
AdminVariant.args = {
3122
variant: "admin-dropdown",
32-
open: true
23+
open: true,
3324
}
3425

3526
export const UserVariant = Template.bind({})
3627
UserVariant.args = {
3728
variant: "user-dropdown",
38-
open: true
29+
open: true,
3930
}

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

Lines changed: 18 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
import { fade, Theme } from "@material-ui/core"
21
import ListItem from "@material-ui/core/ListItem"
32
import ListItemText from "@material-ui/core/ListItemText"
3+
import { fade, makeStyles, Theme } from "@material-ui/core/styles"
44
import AdminIcon from "@material-ui/icons/SettingsOutlined"
5-
import { makeStyles } from "@material-ui/styles"
65
import React, { useState } from "react"
76
import { useNavigate } from "react-router-dom"
87
import { navHeight } from "../../../theme/constants"
@@ -12,7 +11,8 @@ import { BuildingIcon } from "../../Icons/BuildingIcon"
1211
import { UsersOutlinedIcon } from "../../Icons/UsersOutlinedIcon"
1312
import { CloseDropdown, OpenDropdown } from "../Arrows"
1413

15-
const Language = {
14+
export const Language = {
15+
menuTitle: "Admin",
1616
usersLabel: "Users",
1717
usersDescription: "Manage users, roles, and permissions.",
1818
orgsLabel: "Organizations",
@@ -53,7 +53,7 @@ export const AdminDropdown: React.FC = () => {
5353
<>
5454
<div className={styles.link}>
5555
<ListItem selected={Boolean(anchorEl)} button onClick={onOpenAdminMenu}>
56-
<ListItemText className="no-brace" color="primary" primary="Admin" />
56+
<ListItemText className="no-brace" color="primary" primary={Language.menuTitle} />
5757
{anchorEl ? <CloseDropdown /> : <OpenDropdown />}
5858
</ListItem>
5959
</div>
@@ -74,22 +74,20 @@ export const AdminDropdown: React.FC = () => {
7474
variant="admin-dropdown"
7575
onClose={onClose}
7676
>
77-
{entries.map((entry) =>
78-
entry.label && entry.Icon ? (
79-
<BorderedMenuRow
80-
description={entry.description}
81-
Icon={entry.Icon}
82-
key={entry.label}
83-
path={entry.path}
84-
title={entry.label}
85-
variant="narrow"
86-
onClick={() => {
87-
onClose()
88-
navigate(entry.path)
89-
}}
90-
/>
91-
) : null,
92-
)}
77+
{entries.map((entry) => (
78+
<BorderedMenuRow
79+
description={entry.description}
80+
Icon={entry.Icon}
81+
key={entry.label}
82+
path={entry.path}
83+
title={entry.label}
84+
variant="narrow"
85+
onClick={() => {
86+
onClose()
87+
navigate(entry.path)
88+
}}
89+
/>
90+
))}
9391
</BorderedMenu>
9492
</>
9593
)

site/src/components/Navbar/Arrows.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,12 @@ const useStyles = makeStyles((theme: Theme) => ({
1515
},
1616
}))
1717

18-
export const OpenDropdown = () => {
18+
export const OpenDropdown: React.FC = () => {
1919
const styles = useStyles()
2020
return <KeyboardArrowDown className={styles.arrowIcon} />
2121
}
2222

23-
export const CloseDropdown = () => {
23+
export const CloseDropdown: React.FC = () => {
2424
const styles = useStyles()
2525
return <KeyboardArrowUp className={`${styles.arrowIcon} ${styles.arrowIconUp}`} />
2626
}

site/src/components/Navbar/NavbarView/NavbarView.test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import { screen } from "@testing-library/react"
22
import React from "react"
3+
import { NavbarView } from "."
34
import { render } from "../../../test_helpers"
45
import { MockUser } from "../../../test_helpers/entities"
5-
import { NavbarView } from "."
66

77
describe("NavbarView", () => {
88
const noop = () => {

site/src/components/Navbar/UserDropdown/UserDropdown.test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import { screen } from "@testing-library/react"
22
import React from "react"
3+
import { Language, UserDropdown, UserDropdownProps } from "."
34
import { render } from "../../../test_helpers"
45
import { MockUser } from "../../../test_helpers/entities"
5-
import { Language, UserDropdown, UserDropdownProps } from "."
66

77
const renderAndClick = async (props: Partial<UserDropdownProps> = {}) => {
88
render(<UserDropdown user={props.user ?? MockUser} onSignOut={props.onSignOut ?? jest.fn()} />)

site/src/components/Typography/Typography.stories.tsx

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,20 +9,16 @@ export default {
99

1010
const Template: Story<TypographyProps> = (args: TypographyProps) => (
1111
<>
12-
<Typography {...args}>
13-
Colorless green ideas sleep furiously
14-
</Typography>
15-
<Typography {...args}>
16-
More people have been to France than I have
17-
</Typography>
12+
<Typography {...args}>Colorless green ideas sleep furiously</Typography>
13+
<Typography {...args}>More people have been to France than I have</Typography>
1814
</>
1915
)
2016

2117
export const Short = Template.bind({})
2218
Short.args = {
23-
short: true
19+
short: true,
2420
}
2521
export const Tall = Template.bind({})
2622
Tall.args = {
27-
short: false
23+
short: false,
2824
}

0 commit comments

Comments
 (0)