feat(web): data link
This commit is contained in:
parent
5b54203168
commit
8688ed7e3e
2 changed files with 10 additions and 14 deletions
|
|
@ -13,10 +13,9 @@ import copyLogoSvgLight from "../asset/lander/opencode-logo-light.svg"
|
||||||
import copyLogoSvgDark from "../asset/lander/opencode-logo-dark.svg"
|
import copyLogoSvgDark from "../asset/lander/opencode-logo-dark.svg"
|
||||||
import copyWordmarkSvgLight from "../asset/lander/opencode-wordmark-light.svg"
|
import copyWordmarkSvgLight from "../asset/lander/opencode-wordmark-light.svg"
|
||||||
import copyWordmarkSvgDark from "../asset/lander/opencode-wordmark-dark.svg"
|
import copyWordmarkSvgDark from "../asset/lander/opencode-wordmark-dark.svg"
|
||||||
import { A, createAsync, useNavigate } from "@solidjs/router"
|
import { A, useNavigate } from "@solidjs/router"
|
||||||
import { createMemo, Match, Show, Switch } from "solid-js"
|
import { createMemo, Match, Show, Switch } from "solid-js"
|
||||||
import { createStore } from "solid-js/store"
|
import { createStore } from "solid-js/store"
|
||||||
import { github } from "~/lib/github"
|
|
||||||
import { createEffect, onCleanup } from "solid-js"
|
import { createEffect, onCleanup } from "solid-js"
|
||||||
import { config } from "~/config"
|
import { config } from "~/config"
|
||||||
import { useI18n } from "~/context/i18n"
|
import { useI18n } from "~/context/i18n"
|
||||||
|
|
@ -40,16 +39,6 @@ export function Header(props: { zen?: boolean; go?: boolean; hideGetStarted?: bo
|
||||||
const navigate = useNavigate()
|
const navigate = useNavigate()
|
||||||
const i18n = useI18n()
|
const i18n = useI18n()
|
||||||
const language = useLanguage()
|
const language = useLanguage()
|
||||||
const githubData = createAsync(() => github())
|
|
||||||
const starCount = createMemo(() =>
|
|
||||||
githubData()?.stars
|
|
||||||
? new Intl.NumberFormat("en-US", {
|
|
||||||
notation: "compact",
|
|
||||||
compactDisplay: "short",
|
|
||||||
maximumFractionDigits: 0,
|
|
||||||
}).format(githubData()?.stars)
|
|
||||||
: config.github.starsFormatted.compact,
|
|
||||||
)
|
|
||||||
|
|
||||||
const [store, setStore] = createStore({
|
const [store, setStore] = createStore({
|
||||||
mobileMenuOpen: false,
|
mobileMenuOpen: false,
|
||||||
|
|
@ -155,12 +144,15 @@ export function Header(props: { zen?: boolean; go?: boolean; hideGetStarted?: bo
|
||||||
<ul>
|
<ul>
|
||||||
<li>
|
<li>
|
||||||
<a href={config.github.repoUrl} target="_blank" style="white-space: nowrap;">
|
<a href={config.github.repoUrl} target="_blank" style="white-space: nowrap;">
|
||||||
{i18n.t("nav.github")} <span>[{starCount()}]</span>
|
{i18n.t("nav.github")}
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<a href={language.route("/docs")}>{i18n.t("nav.docs")}</a>
|
<a href={language.route("/docs")}>{i18n.t("nav.docs")}</a>
|
||||||
</li>
|
</li>
|
||||||
|
<li>
|
||||||
|
<a href={language.route("/data")}>{i18n.t("nav.data")}</a>
|
||||||
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<A href={language.route("/zen")}>{i18n.t("nav.zen")}</A>
|
<A href={language.route("/zen")}>{i18n.t("nav.zen")}</A>
|
||||||
</li>
|
</li>
|
||||||
|
|
@ -252,12 +244,15 @@ export function Header(props: { zen?: boolean; go?: boolean; hideGetStarted?: bo
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<a href={config.github.repoUrl} target="_blank" style="white-space: nowrap;">
|
<a href={config.github.repoUrl} target="_blank" style="white-space: nowrap;">
|
||||||
{i18n.t("nav.github")} <span>[{starCount()}]</span>
|
{i18n.t("nav.github")}
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<a href={language.route("/docs")}>{i18n.t("nav.docs")}</a>
|
<a href={language.route("/docs")}>{i18n.t("nav.docs")}</a>
|
||||||
</li>
|
</li>
|
||||||
|
<li>
|
||||||
|
<a href={language.route("/data")}>{i18n.t("nav.data")}</a>
|
||||||
|
</li>
|
||||||
<Show when={!props.zen}>
|
<Show when={!props.zen}>
|
||||||
<li>
|
<li>
|
||||||
<A href={language.route("/zen")}>{i18n.t("nav.zen")}</A>
|
<A href={language.route("/zen")}>{i18n.t("nav.zen")}</A>
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
export const dict = {
|
export const dict = {
|
||||||
"nav.github": "GitHub",
|
"nav.github": "GitHub",
|
||||||
"nav.docs": "Docs",
|
"nav.docs": "Docs",
|
||||||
|
"nav.data": "Data",
|
||||||
"nav.changelog": "Changelog",
|
"nav.changelog": "Changelog",
|
||||||
"nav.discord": "Discord",
|
"nav.discord": "Discord",
|
||||||
"nav.x": "X",
|
"nav.x": "X",
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue