Skip to content

Commit 2962d75

Browse files
authored
docs: add light mode (#328)
* docs: BAM => Theodo Apps * docs: upgrade docusaurus * docs: add back copy button on install commands * docs: add light mode * docs: add video component * test: fix flaky test
1 parent 4643b9a commit 2962d75

File tree

10 files changed

+243
-249
lines changed

10 files changed

+243
-249
lines changed

packages/commands/measure/src/__tests__/measure.test.tsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,10 @@ describe("flashlight measure interactive", () => {
9595
// Simulate measures being emitted on the device
9696
act(() => emitMeasures());
9797

98+
// We should now see 1000ms of measures: 3 measures at 0/500/1000ms
99+
await screen.findByText("1000 ms");
98100
// Find the score!
99-
await screen.findByText("47");
101+
screen.getByText("47");
100102

101103
// expand threads
102104
await screen.findByText("Other threads");
@@ -106,8 +108,8 @@ describe("flashlight measure interactive", () => {
106108

107109
// Stop measuring
108110
fireEvent.click(screen.getByText("Stop Measuring"));
109-
await waitFor(() => expect(aTraceMock.kill).toBeCalled());
110-
await waitFor(() => expect(perfProfilerMock.kill).toBeCalled());
111+
await waitFor(() => expect(aTraceMock.kill).toHaveBeenCalled());
112+
await waitFor(() => expect(perfProfilerMock.kill).toHaveBeenCalled());
111113

112114
// Close apps
113115

website/docs/cloud/pricing.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ sidebar_position: 15
44

55
# Pricing
66

7-
`flashlight cloud` and [flashlight.dev](https://app.flashlight.dev) are running with BAM's servers and AWS Device Farm account.
7+
`flashlight cloud` and [flashlight.dev](https://app.flashlight.dev) are running with Theodo's servers and AWS Device Farm account.
88

99
We offer those services **completely free** 🥳
10-
However, this means there can be a queue while waiting for devices to be available. (BAM's projects and clients also have priority.)
10+
However, this means there can be a queue while waiting for devices to be available. (Theodo's projects and clients also have priority.)
1111

1212
### Going further
1313

website/docs/index.md

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,13 @@ sidebar_position: 1
88

99
## Simple usage
1010

11-
🔌 Plug-in an Android device to your computer. Open any app.
11+
🔌 Plug-in an Android device to your computer. Open any app. Then the simplest way to get started is to run the `flashlight measure` command:
1212

13-
Then the simplest way to get started is to run the `flashlight measure` command:
13+
```bash
14+
flashlight measure
15+
```
1416

15-
<video autoPlay muted controls style={{width: "100%"}}>
16-
17-
<source src="https://github.com/bamlab/flashlight/assets/4534323/4038a342-f145-4c3b-8cde-17949bf52612"/>
18-
</video>
17+
<Video url="https://github.com/bamlab/flashlight/assets/4534323/4038a342-f145-4c3b-8cde-17949bf52612"/>
1918

2019
## Going further
2120

website/docusaurus.config.js

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,8 @@ const config = {
8383
logo: {
8484
href: "https://flashlight.dev",
8585
alt: "Flashlight",
86-
src: "img/logo.svg",
86+
src: "img/logo-black.svg",
87+
srcDark: "img/logo.svg",
8788
},
8889
items: [
8990
{
@@ -116,22 +117,16 @@ const config = {
116117
href: "https://github.com/bamlab/flashlight",
117118
},
118119
],
119-
copyright: `Copyright © ${new Date().getFullYear()} BAM. Built with Docusaurus.`,
120+
copyright: `Copyright © ${new Date().getFullYear()} Theodo Apps. Built with Docusaurus.`,
120121
},
121122

122123
prism: {
123124
darkTheme: themes.vsDark,
125+
additionalLanguages: ["bash", "powershell"],
124126
},
125127

126-
// forceDarkMode: true,
127-
// darkMode: true,
128128
colorMode: {
129-
// "light" | "dark"
130129
defaultMode: "dark",
131-
132-
// Hides the switch in the navbar
133-
// Useful if you want to support a single color mode
134-
disableSwitch: true,
135130
},
136131
}),
137132
};

website/package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,17 @@
1515
"typecheck": "tsc"
1616
},
1717
"dependencies": {
18-
"@docusaurus/core": "^3.1.1",
19-
"@docusaurus/preset-classic": "^3.1.1",
20-
"@docusaurus/theme-search-algolia": "^3.1.1",
18+
"@docusaurus/core": "^3.5.2",
19+
"@docusaurus/preset-classic": "^3.5.2",
20+
"@docusaurus/theme-search-algolia": "^3.5.2",
2121
"@mdx-js/react": "^3.0.1",
2222
"clsx": "^2.1.0",
23-
"prism-react-renderer": "^2.3.1",
23+
"prism-react-renderer": "^2.4.0",
2424
"react": "^18.2.0",
2525
"react-dom": "^18.2.0"
2626
},
2727
"devDependencies": {
28-
"@docusaurus/module-type-aliases": "3.5.2",
28+
"@docusaurus/module-type-aliases": "^3.5.2",
2929
"@tsconfig/docusaurus": "^2.0.2",
3030
"typescript": "^5.4.2"
3131
},

website/src/components/Install.mdx

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,10 @@ import CodeBlock from "@theme/CodeBlock";
88

99
<Tabs>
1010
<TabItem value="unix" label="macOS/Linux" default>
11-
<CodeBlock language="bash">curl https://get.flashlight.dev | bash</CodeBlock>
12-
</TabItem>
13-
<TabItem value="windows" label="Windows">
14-
<CodeBlock language="bash">iwr https://get.flashlight.dev/windows -useb | iex</CodeBlock>
15-
</TabItem>
16-
</Tabs>
11+
12+
```bash
13+
curl https://get.flashlight.dev | bash
14+
```
1715

1816
:::note macOS arm64 support
1917
On a macOS with arm64 architecture (Silicon), you'll need to install Rosetta if you don't have it:
@@ -22,3 +20,13 @@ On a macOS with arm64 architecture (Silicon), you'll need to install Rosetta if
2220

2321
More details [here](https://github.com/bamlab/flashlight/issues/199#issuecomment-2351870408)
2422
:::
23+
24+
</TabItem>
25+
<TabItem value="windows" label="Windows">
26+
27+
```powershell
28+
iwr https://get.flashlight.dev/windows -useb | iex
29+
```
30+
31+
</TabItem>
32+
</Tabs>

website/src/components/Video.tsx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import React from "react";
2+
3+
export const Video = ({ url }: { url: string }) => (
4+
<video autoPlay muted controls style={{ width: "100%" }}>
5+
<source src={url} />
6+
</video>
7+
);

website/src/css/custom.css

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
:root {
88
--ifm-code-font-size: 95%;
99
--docusaurus-highlighted-code-line-bg: rgba(0, 0, 0, 0.1);
10+
11+
--ifm-color-primary: #ff039b;
1012
}
1113

1214
/* For readability concerns, you should choose a lighter palette in dark mode. */
@@ -25,10 +27,10 @@
2527
--ifm-heading-color: rgba(255, 255, 255);
2628
--ifm-heading-font-family: "Merriweather", serif;
2729
--ifm-menu-color: rgba(200, 200, 200);
28-
}
2930

30-
.menu__link {
31-
color: rgba(255, 255, 255);
31+
.menu__link {
32+
color: rgba(255, 255, 255);
33+
}
3234
}
3335

3436
.menu__list .menu__list .menu__link {

website/src/theme/MDXComponents.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,13 @@
22
import MDXComponents from "@theme-original/MDXComponents";
33
import Contact from "@site/src/components/Contact.mdx";
44
import Install from "@site/src/components/Install.mdx";
5+
import { Video } from "@site/src/components/Video";
56

67
const _module = {
78
...MDXComponents,
89
Contact,
910
Install,
11+
Video,
1012
};
1113

1214
export default _module;

0 commit comments

Comments
 (0)