Skip to content

Commit b87a195

Browse files
committed
feat: external icon settings
1 parent 4f433e7 commit b87a195

File tree

25 files changed

+366
-80
lines changed

25 files changed

+366
-80
lines changed

examples/templates/aws-devcontainer/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
display_name: AWS EC2 (Devcontainer)
33
description: Provision AWS EC2 VMs with a devcontainer as Coder workspaces
4-
icon: ../../../site/static/icon/aws.png
4+
icon: ../../../site/static/icon/aws.svg
55
maintainer_github: coder
66
verified: true
77
tags: [vm, linux, aws, persistent, devcontainer]

examples/templates/aws-linux/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
display_name: AWS EC2 (Linux)
33
description: Provision AWS EC2 VMs as Coder workspaces
4-
icon: ../../../site/static/icon/aws.png
4+
icon: ../../../site/static/icon/aws.svg
55
maintainer_github: coder
66
verified: true
77
tags: [vm, linux, aws, persistent-vm]

examples/templates/aws-windows/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
display_name: AWS EC2 (Windows)
33
description: Provision AWS EC2 VMs as Coder workspaces
4-
icon: ../../../site/static/icon/aws.png
4+
icon: ../../../site/static/icon/aws.svg
55
maintainer_github: coder
66
verified: true
77
tags: [vm, windows, aws]

site/src/AppRouter.tsx

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,6 @@ import WorkspacesPage from "./pages/WorkspacesPage/WorkspacesPage";
2121
import UserSettingsLayout from "./pages/UserSettingsPage/Layout";
2222
import { TemplateSettingsLayout } from "./pages/TemplateSettingsPage/TemplateSettingsLayout";
2323
import { WorkspaceSettingsLayout } from "./pages/WorkspaceSettingsPage/WorkspaceSettingsLayout";
24-
import { ThemeOverride } from "contexts/ThemeProvider";
25-
import themes from "theme";
2624

2725
// Lazy load pages
2826
// - Pages that are secondary, not in the main navigation or not usually accessed
@@ -414,11 +412,7 @@ export const AppRouter: FC = () => {
414412
/>
415413
<Route
416414
path="/:username/:workspace/terminal"
417-
element={
418-
<ThemeOverride theme={themes.dark}>
419-
<TerminalPage />
420-
</ThemeOverride>
421-
}
415+
element={<TerminalPage />}
422416
/>
423417
<Route path="/cli-auth" element={<CliAuthenticationPage />} />
424418
<Route path="/icons" element={<IconsPage />} />

site/src/__mocks__/react-markdown.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { FC, PropsWithChildren } from "react";
22

3-
const ReactMarkdown: FC<PropsWithChildren<unknown>> = ({ children }) => {
3+
const ReactMarkdown: FC<PropsWithChildren> = ({ children }) => {
44
return <div data-testid="markdown">{children}</div>;
55
};
66

site/src/components/Avatar/Avatar.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,11 @@ export const AvatarIcon: FC<AvatarIconProps> = ({ src, alt }) => {
8686
<img
8787
src={src}
8888
alt=""
89-
css={{ maxWidth: "50%" }}
89+
css={{
90+
maxWidth: "50%",
91+
// filter: "grayscale(100%) contrast(0%)",
92+
filter: "grayscale(100%) contrast(0%) brightness(2)",
93+
}}
9094
aria-labelledby={avatarId}
9195
/>
9296
<div id={avatarId} css={{ ...visuallyHidden }}>

site/src/components/RichParameterInput/RichParameterInput.stories.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ export const Options: Story = {
9696
name: "Third option",
9797
value: "third_option",
9898
description: "",
99-
icon: "/icon/aws.png",
99+
icon: "/icon/aws.svg",
100100
},
101101
],
102102
}),
@@ -138,7 +138,7 @@ Very big.
138138
139139
> Wow, that description is straight up large. –Some guy, probably
140140
`,
141-
icon: "/icon/aws.png",
141+
icon: "/icon/aws.svg",
142142
},
143143
],
144144
}),
Lines changed: 30 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,48 @@
11
import { type FC, type PropsWithChildren } from "react";
2-
import { useTheme } from "@emotion/react";
2+
import { type Interpolation, type Theme, useTheme } from "@emotion/react";
33
import { CoderIcon } from "../Icons/CoderIcon";
44

5-
const Language = {
6-
defaultMessage: (
7-
<>
8-
Welcome to <strong>Coder</strong>
9-
</>
10-
),
11-
};
12-
13-
export const Welcome: FC<
14-
PropsWithChildren<{ message?: JSX.Element | string }>
15-
> = ({ message = Language.defaultMessage }) => {
5+
export const Welcome: FC<PropsWithChildren> = ({ children }) => {
166
const theme = useTheme();
177

188
return (
199
<div>
20-
<div
21-
css={{
22-
display: "flex",
23-
justifyContent: "center",
24-
}}
25-
>
10+
<div css={styles.iconContainer}>
2611
<CoderIcon
2712
css={{
2813
color: theme.palette.text.primary,
2914
fontSize: 64,
3015
}}
3116
/>
3217
</div>
33-
<h1
34-
css={{
35-
textAlign: "center",
36-
fontSize: 32,
37-
fontWeight: 400,
38-
margin: 0,
39-
marginTop: 16,
40-
marginBottom: 32,
41-
lineHeight: 1.25,
42-
43-
"& strong": {
44-
fontWeight: 600,
45-
},
46-
}}
47-
>
48-
{message}
18+
<h1 css={styles.header}>
19+
{children ?? (
20+
<>
21+
Welcome to <strong>Coder</strong>
22+
</>
23+
)}
4924
</h1>
5025
</div>
5126
);
5227
};
28+
29+
const styles = {
30+
iconContainer: {
31+
display: "flex",
32+
justifyContent: "center",
33+
},
34+
35+
header: {
36+
textAlign: "center",
37+
fontSize: 32,
38+
fontWeight: 400,
39+
margin: 0,
40+
marginTop: 16,
41+
marginBottom: 32,
42+
lineHeight: 1.25,
43+
44+
"& strong": {
45+
fontWeight: 600,
46+
},
47+
},
48+
} satisfies Record<string, Interpolation<Theme>>;

site/src/pages/CliAuthPage/CliAuthPageView.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export const CliAuthPageView: FC<CliAuthPageViewProps> = ({ sessionToken }) => {
2020

2121
return (
2222
<SignInLayout>
23-
<Welcome message="Session token" />
23+
<Welcome>Session token</Welcome>
2424

2525
<p
2626
css={{

site/src/pages/ExternalAuthPage/ExternalAuthPage.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ const ExternalAuthPage: FC = () => {
6969
// show an error there?
7070
return (
7171
<SignInLayout>
72-
<Welcome message="Failed to validate oauth access token" />
72+
<Welcome>Failed to validate oauth access token</Welcome>
7373
<p css={{ textAlign: "center" }}>
7474
Attempted to validate the user&apos;s oauth access token from the
7575
authentication flow. This situation may occur as a result of an

0 commit comments

Comments
 (0)