Skip to content

Commit 8688ed7

Browse files
committed
feat(web): data link
1 parent 5b54203 commit 8688ed7

2 files changed

Lines changed: 10 additions & 14 deletions

File tree

‎packages/console/app/src/component/header.tsx‎

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,9 @@ import copyLogoSvgLight from "../asset/lander/opencode-logo-light.svg"
1313
import copyLogoSvgDark from "../asset/lander/opencode-logo-dark.svg"
1414
import copyWordmarkSvgLight from "../asset/lander/opencode-wordmark-light.svg"
1515
import copyWordmarkSvgDark from "../asset/lander/opencode-wordmark-dark.svg"
16-
import { A, createAsync, useNavigate } from "@solidjs/router"
16+
import { A, useNavigate } from "@solidjs/router"
1717
import { createMemo, Match, Show, Switch } from "solid-js"
1818
import { createStore } from "solid-js/store"
19-
import { github } from "~/lib/github"
2019
import { createEffect, onCleanup } from "solid-js"
2120
import { config } from "~/config"
2221
import { useI18n } from "~/context/i18n"
@@ -40,16 +39,6 @@ export function Header(props: { zen?: boolean; go?: boolean; hideGetStarted?: bo
4039
const navigate = useNavigate()
4140
const i18n = useI18n()
4241
const language = useLanguage()
43-
const githubData = createAsync(() => github())
44-
const starCount = createMemo(() =>
45-
githubData()?.stars
46-
? new Intl.NumberFormat("en-US", {
47-
notation: "compact",
48-
compactDisplay: "short",
49-
maximumFractionDigits: 0,
50-
}).format(githubData()?.stars)
51-
: config.github.starsFormatted.compact,
52-
)
5342

5443
const [store, setStore] = createStore({
5544
mobileMenuOpen: false,
@@ -155,12 +144,15 @@ export function Header(props: { zen?: boolean; go?: boolean; hideGetStarted?: bo
155144
<ul>
156145
<li>
157146
<a href={config.github.repoUrl} target="_blank" style="white-space: nowrap;">
158-
{i18n.t("nav.github")} <span>[{starCount()}]</span>
147+
{i18n.t("nav.github")}
159148
</a>
160149
</li>
161150
<li>
162151
<a href={language.route("/docs")}>{i18n.t("nav.docs")}</a>
163152
</li>
153+
<li>
154+
<a href={language.route("/data")}>{i18n.t("nav.data")}</a>
155+
</li>
164156
<li>
165157
<A href={language.route("/zen")}>{i18n.t("nav.zen")}</A>
166158
</li>
@@ -252,12 +244,15 @@ export function Header(props: { zen?: boolean; go?: boolean; hideGetStarted?: bo
252244
</li>
253245
<li>
254246
<a href={config.github.repoUrl} target="_blank" style="white-space: nowrap;">
255-
{i18n.t("nav.github")} <span>[{starCount()}]</span>
247+
{i18n.t("nav.github")}
256248
</a>
257249
</li>
258250
<li>
259251
<a href={language.route("/docs")}>{i18n.t("nav.docs")}</a>
260252
</li>
253+
<li>
254+
<a href={language.route("/data")}>{i18n.t("nav.data")}</a>
255+
</li>
261256
<Show when={!props.zen}>
262257
<li>
263258
<A href={language.route("/zen")}>{i18n.t("nav.zen")}</A>

‎packages/console/app/src/i18n/en.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
export const dict = {
22
"nav.github": "GitHub",
33
"nav.docs": "Docs",
4+
"nav.data": "Data",
45
"nav.changelog": "Changelog",
56
"nav.discord": "Discord",
67
"nav.x": "X",

0 commit comments

Comments
 (0)