Skip to content

Commit

Permalink
Merge pull request #8 from davidchalifoux/main
Browse files Browse the repository at this point in the history
Show version in settings
  • Loading branch information
davidchalifoux authored Feb 19, 2024
2 parents 9fc9ee9 + fc0fe34 commit fe4d061
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src-tauri/tauri.conf.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
},
"package": {
"productName": "Keylight Commander",
"version": "0.0.5"
"version": "0.0.6"
},
"tauri": {
"updater": {
Expand Down
15 changes: 14 additions & 1 deletion src/components/SettingsModal.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import { Button, Checkbox, Group, Modal, Stack } from "@mantine/core";
import { Button, Checkbox, Group, Modal, Stack, Text } from "@mantine/core";
import React from "react";
import { useSettingsStore } from "../lib/hooks/useSettingsStore";
import { useQuery } from "@tanstack/react-query";
import { getVersion } from "@tauri-apps/api/app";

type Props = {
onClose: () => void;
Expand All @@ -10,6 +12,13 @@ type Props = {
export const SettingsModal: React.FC<Props> = (props) => {
const settingsStore = useSettingsStore();

const versionQuery = useQuery({
queryKey: ["version"],
queryFn: () => {
return getVersion();
},
});

return (
<Modal opened={props.isOpen} onClose={props.onClose} title="Settings">
<Stack>
Expand All @@ -19,6 +28,10 @@ export const SettingsModal: React.FC<Props> = (props) => {
onChange={() => settingsStore.toggleSync()}
/>

<Text c={"dimmed"} size="sm">
Version: {versionQuery.data}
</Text>

<Group justify="end">
<Button onClick={() => props.onClose()}>Done</Button>
</Group>
Expand Down

0 comments on commit fe4d061

Please sign in to comment.