Skip to content

Commit ebd5f67

Browse files
committed
Version string and better self promo
1 parent 66ac79a commit ebd5f67

File tree

3 files changed

+30
-7
lines changed

3 files changed

+30
-7
lines changed

src-tauri/tauri.conf.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
},
88
"package": {
99
"productName": "nomnom-unity-hub",
10-
"version": "0.0.0"
10+
"version": "1.0.0-beta"
1111
},
1212
"tauri": {
1313
"allowlist": {

src/components/main-sidebar.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { ButtonHTMLAttributes, useContext } from "react";
22
import { Context } from "../context/global-context";
3+
import { open } from "@tauri-apps/api/shell";
34

45
export default function MainSidebar() {
56
// async function getPath() {
@@ -58,13 +59,12 @@ function Options() {
5859

5960
<p className="text-sm text-stone-400 select-none px-3">
6061
Made by <br />
61-
<a
62-
href="https://github.com/nomnomab"
63-
target="_blank"
64-
className="text-stone-300 transition-colors hover:text-stone-50 hover:underline"
62+
<span
63+
className="text-stone-300 transition-colors hover:text-stone-50 hover:underline cursor-pointer"
64+
onClick={() => open("https://github.com/nomnomab")}
6565
>
6666
Andrew Burke
67-
</a>
67+
</span>
6868
</p>
6969
</div>
7070
);

src/components/settings-view.tsx

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { useContext, useEffect, useState } from "react";
1+
import { Suspense, useContext, useEffect, useState } from "react";
22
import {
33
ValidateInputContext,
44
ValidateInputWithButton,
@@ -7,6 +7,7 @@ import { invoke } from "@tauri-apps/api/tauri";
77
import FolderOpen from "./svg/folder-open";
88
import { open } from "@tauri-apps/api/dialog";
99
import { Context, Prefs } from "../context/global-context";
10+
import { getVersion } from "@tauri-apps/api/app";
1011

1112
type Props = {
1213
overrideClassName?: string;
@@ -26,6 +27,12 @@ function Header() {
2627
<div className="flex flex-row border-b border-b-stone-700 justify-center">
2728
<div className="flex flex-row w-full max-w-6xl px-8 py-8 items-center select-none">
2829
<h1 className="text-stone-50">Settings</h1>
30+
31+
<div className="ml-auto">
32+
<Suspense>
33+
<Version />
34+
</Suspense>
35+
</div>
2936
</div>
3037
</div>
3138
);
@@ -242,3 +249,19 @@ function Body() {
242249
</div>
243250
);
244251
}
252+
253+
function Version() {
254+
const [version, setVersion] = useState("-");
255+
const appVersionPromise = getVersion();
256+
257+
useEffect(() => {
258+
const wait = async () => {
259+
const version = await appVersionPromise;
260+
setVersion(version);
261+
};
262+
263+
wait();
264+
}, []);
265+
266+
return <div className="text-md text-stone-400 select-none">v{version}</div>;
267+
}

0 commit comments

Comments
 (0)