Skip to content

Commit

Permalink
feat: add about setting
Browse files Browse the repository at this point in the history
Signed-off-by: Innei <i@innei.in>
  • Loading branch information
Innei committed Jul 18, 2024
1 parent e6d5d0c commit 30ae847
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 0 deletions.
1 change: 1 addition & 0 deletions icons/mgc/information_cute_re.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
40 changes: 40 additions & 0 deletions src/renderer/src/modules/settings/tabs/about.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
import { repository } from "@pkg"
import { Logo } from "@renderer/components/icons/logo"
import { StyledButton } from "@renderer/components/ui/button"

export const SettingAbout = () => (
<div>
<section>
<div className="my-4 font-medium text-theme-foreground/60">
Version
</div>
<div className="flex gap-3">
<Logo className="size-[52px]" />

<div className="flex grow flex-col">
<div className="text-lg font-bold">
{APP_NAME}
{" "}
{!import.meta.env.PROD ? `(${import.meta.env.MODE})` : ""}
</div>
<div>
<span className="rounded bg-muted px-2 py-1 text-xs">
{APP_VERSION}
</span>
</div>
</div>

<div className="shrink-0">
<StyledButton
variant="outline"
onClick={() => {
window.open(`${repository.url}/releases`, "_blank")
}}
>
Changelog
</StyledButton>
</div>
</div>
</section>
</div>
)
9 changes: 9 additions & 0 deletions src/renderer/src/pages/settings/(settings)/about.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { SettingAbout } from "@renderer/modules/settings/tabs/about"
import { defineSettingPage } from "@renderer/modules/settings/utils"

export const loader = defineSettingPage({
iconName: "i-mgc-information-cute-re",
name: "About",
priority: 9999,
})
export const Component = () => <SettingAbout />

0 comments on commit 30ae847

Please sign in to comment.