Skip to content

Commit 9682b7b

Browse files
committed
Many storybook fixes
1 parent 367c445 commit 9682b7b

File tree

24 files changed

+109
-339
lines changed

24 files changed

+109
-339
lines changed

site/src/components/AvatarData/AvatarData.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ export const AvatarData: FC<PropsWithChildren<AvatarDataProps>> = ({
4141

4242
const useStyles = makeStyles((theme) => ({
4343
root: {
44+
...theme.typography.body2,
4445
minHeight: theme.spacing(5), // Make it predictable for the skeleton
4546
width: "100%",
4647
},
@@ -58,7 +59,6 @@ const useStyles = makeStyles((theme) => ({
5859
fontSize: 12,
5960
color: theme.palette.text.secondary,
6061
lineHeight: "140%",
61-
marginTop: 2,
6262
maxWidth: 540,
6363
},
6464
}))

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

Lines changed: 0 additions & 30 deletions
This file was deleted.

site/src/components/CodeExample/CodeExample.tsx

Lines changed: 5 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ export const CodeExample: FC<React.PropsWithChildren<CodeExampleProps>> = ({
3131
<CopyButton
3232
text={code}
3333
tooltipTitle={tooltipTitle}
34-
buttonClassName={combineClasses([styles.button, buttonClassName])}
34+
buttonClassName={buttonClassName}
3535
/>
3636
</div>
3737
)
@@ -52,26 +52,13 @@ const useStyles = makeStyles<Theme, styleProps>((theme) => ({
5252
fontFamily: MONOSPACE_FONT_FAMILY,
5353
fontSize: 14,
5454
borderRadius: theme.shape.borderRadius,
55-
padding: props.inline ? "0px" : theme.spacing(0.5),
55+
padding: theme.spacing(1),
5656
}),
57-
code: (props) => ({
58-
padding: `
59-
${props.inline ? 0 : theme.spacing(0.5)}px
60-
${theme.spacing(0.75)}px
61-
${props.inline ? 0 : theme.spacing(0.5)}px
62-
${props.inline ? theme.spacing(1) : theme.spacing(2)}px
63-
`,
57+
code: {
58+
padding: theme.spacing(0, 1),
6459
width: "100%",
6560
display: "flex",
6661
alignItems: "center",
6762
wordBreak: "break-all",
68-
}),
69-
button: (props) => ({
70-
border: 0,
71-
minWidth: props.inline ? 30 : 42,
72-
minHeight: props.inline ? 30 : 42,
73-
borderRadius: theme.shape.borderRadius,
74-
padding: props.inline ? theme.spacing(0.4) : undefined,
75-
background: "transparent",
76-
}),
63+
},
7764
}))

site/src/components/CopyButton/CopyButton.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ export const CopyButton: React.FC<React.PropsWithChildren<CopyButtonProps>> = ({
4242
onClick={copyToClipboard}
4343
size="small"
4444
aria-label={Language.ariaLabel}
45+
variant="text"
4546
>
4647
{isCopied ? (
4748
<Check className={styles.fileCopyIcon} />

site/src/components/GitAuth/GitAuth.tsx

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import { AzureDevOpsIcon } from "components/Icons/AzureDevOpsIcon"
88
import { BitbucketIcon } from "components/Icons/BitbucketIcon"
99
import { GitlabIcon } from "components/Icons/GitlabIcon"
1010
import { FC } from "react"
11-
import Link from "@mui/material/Link"
1211
import { makeStyles } from "@mui/styles"
1312

1413
export interface GitAuthProps {
@@ -58,8 +57,15 @@ export const GitAuth: FC<GitAuthProps> = ({
5857
}
5958
>
6059
<div>
61-
<Link
60+
<Button
6261
href={authenticateURL}
62+
variant="contained"
63+
size="large"
64+
startIcon={<Icon />}
65+
disabled={authenticated}
66+
className={styles.button}
67+
color={error ? "error" : undefined}
68+
fullWidth
6369
onClick={(event) => {
6470
event.preventDefault()
6571
// If the user is already authenticated, we don't want to redirect them
@@ -69,19 +75,11 @@ export const GitAuth: FC<GitAuthProps> = ({
6975
window.open(authenticateURL, "_blank", "width=900,height=600")
7076
}}
7177
>
72-
<Button
73-
size="large"
74-
startIcon={<Icon />}
75-
disabled={authenticated}
76-
className={styles.button}
77-
color={error ? "error" : undefined}
78-
fullWidth
79-
>
80-
{authenticated
81-
? `You're authenticated with ${prettyName}!`
82-
: `Click to login with ${prettyName}!`}
83-
</Button>
84-
</Link>
78+
{authenticated
79+
? `You're authenticated with ${prettyName}!`
80+
: `Click to login with ${prettyName}!`}
81+
</Button>
82+
8583
{error && <FormHelperText error>{error}</FormHelperText>}
8684
</div>
8785
</Tooltip>

site/src/components/LicenseBanner/LicenseBannerView.tsx

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import Link from "@mui/material/Link"
12
import { makeStyles } from "@mui/styles"
23
import { Expander } from "components/Expander/Expander"
34
import { Pill } from "components/Pill/Pill"
@@ -35,9 +36,7 @@ export const LicenseBannerView: React.FC<LicenseBannerViewProps> = ({
3536
<div className={styles.leftContent}>
3637
<span>{messages[0]}</span>
3738
&nbsp;
38-
<a href="mailto:sales@coder.com" className={styles.link}>
39-
{Language.upgrade}
40-
</a>
39+
<Link href="mailto:sales@coder.com">{Language.upgrade}</Link>
4140
</div>
4241
</div>
4342
)
@@ -53,9 +52,7 @@ export const LicenseBannerView: React.FC<LicenseBannerViewProps> = ({
5352
<div>
5453
{Language.exceeded}
5554
&nbsp;
56-
<a href="mailto:sales@coder.com" className={styles.link}>
57-
{Language.upgrade}
58-
</a>
55+
<Link href="mailto:sales@coder.com">{Language.upgrade}</Link>
5956
</div>
6057
<Expander expanded={showDetails} setExpanded={setShowDetails}>
6158
<ul className={styles.list}>
@@ -74,6 +71,7 @@ export const LicenseBannerView: React.FC<LicenseBannerViewProps> = ({
7471

7572
const useStyles = makeStyles((theme) => ({
7673
container: {
74+
...theme.typography.body2,
7775
padding: theme.spacing(1.5),
7876
backgroundColor: theme.palette.warning.main,
7977
display: "flex",
@@ -90,11 +88,6 @@ const useStyles = makeStyles((theme) => ({
9088
marginRight: theme.spacing(1),
9189
marginLeft: theme.spacing(1),
9290
},
93-
link: {
94-
color: "inherit",
95-
textDecoration: "none",
96-
fontWeight: 600,
97-
},
9891
list: {
9992
padding: theme.spacing(1),
10093
margin: 0,

site/src/components/ParameterInput/ParameterInput.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,6 @@ const useStyles = makeStyles((theme) => ({
137137
fontSize: 14,
138138
color: theme.palette.text.secondary,
139139
display: "block",
140-
marginBottom: theme.spacing(0.5),
141140
},
142141
labelDescription: {
143142
fontSize: 16,

site/src/components/RichParameterInput/RichParameterInput.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ const ParameterLabel: FC<ParameterLabelProps> = ({ id, parameter }) => {
4040
)}
4141

4242
{hasDescription ? (
43-
<Stack spacing={0.5}>
43+
<Stack spacing={0}>
4444
<span className={styles.labelCaption}>{displayName}</span>
4545
<span className={styles.labelPrimary}>
4646
<MemoizedMarkdown>{parameter.description}</MemoizedMarkdown>

site/src/components/TemplateExampleCard/TemplateExampleCard.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,6 @@ const useStyles = makeStyles((theme) => ({
6868
padding: theme.spacing(2, 2, 2, 0),
6969
display: "flex",
7070
flexDirection: "column",
71-
gap: theme.spacing(0.5),
7271
overflow: "hidden",
7372
},
7473

site/src/components/TemplateFiles/TemplateFiles.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ const useStyles = makeStyles((theme) => ({
100100
cursor: "pointer",
101101
gap: theme.spacing(0.5),
102102
position: "relative",
103+
color: theme.palette.text.secondary,
103104

104105
"& svg": {
105106
width: 22,
@@ -114,6 +115,7 @@ const useStyles = makeStyles((theme) => ({
114115
tabActive: {
115116
opacity: 1,
116117
background: theme.palette.action.hover,
118+
color: theme.palette.text.primary,
117119

118120
"&:after": {
119121
content: '""',

site/src/components/TemplateVersionEditor/TemplateVersionEditor.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,7 @@ export const TemplateVersionEditor: FC<TemplateVersionEditorProps> = ({
216216
</Button>
217217

218218
<Button
219+
variant="contained"
219220
title={
220221
dirty
221222
? "You have edited files! Run another build before updating."

site/src/components/UserOrGroupAutocomplete/UserOrGroupAutocomplete.tsx

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ export const UserOrGroupAutocomplete: React.FC<
115115
)
116116
}
117117

118-
export const useStyles = makeStyles((theme) => {
118+
export const useStyles = makeStyles(() => {
119119
return {
120120
autocomplete: {
121121
width: "300px",
@@ -126,13 +126,6 @@ export const useStyles = makeStyles((theme) => {
126126

127127
"& .MuiInputBase-root": {
128128
width: "100%",
129-
// Match button small height
130-
height: 36,
131-
},
132-
133-
"& input": {
134-
fontSize: 14,
135-
padding: `${theme.spacing(0, 0.5, 0, 0.5)} !important`,
136129
},
137130
},
138131
}

site/src/components/WorkspaceSchedule/WorkspaceSchedule.stories.tsx

Lines changed: 0 additions & 85 deletions
This file was deleted.

0 commit comments

Comments
 (0)