Better dropdown menu

This commit is contained in:
Gregory Schier
2023-11-14 10:56:56 -08:00
parent edb820c7d9
commit 8839a0b7af
5 changed files with 14 additions and 5 deletions

View File

@@ -17,8 +17,9 @@ jobs:
target: x86_64-apple-darwin target: x86_64-apple-darwin
- os: windows-2022 - os: windows-2022
target: x86_64-pc-windows-msvc target: x86_64-pc-windows-msvc
- os: ubuntu-20.04 # # Re-enable Linux when context menu is supported
target: x86_64-unknown-linux-gnu # - os: ubuntu-20.04
# target: x86_64-unknown-linux-gnu
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}

View File

@@ -41,7 +41,7 @@ impl YaakUpdater {
if dialog::blocking::ask( if dialog::blocking::ask(
None::<&Window>, None::<&Window>,
"Update available", "Update available",
"An update is available. Would you like to download and install it now?", format!("{} is available. Would you like to download and install it now?", update.latest_version()),
) { ) {
_ = update.download_and_install().await; _ = update.download_and_install().await;
} }

View File

@@ -8,7 +8,7 @@
}, },
"package": { "package": {
"productName": "Yaak", "productName": "Yaak",
"version": "2023.3.0-beta.1" "version": "2023.3.0-beta.2"
}, },
"tauri": { "tauri": {
"windows": [], "windows": [],

View File

@@ -3,6 +3,7 @@ import classNames from 'classnames';
import { memo, useMemo } from 'react'; import { memo, useMemo } from 'react';
import { useActiveWorkspace } from '../hooks/useActiveWorkspace'; import { useActiveWorkspace } from '../hooks/useActiveWorkspace';
import { useAppRoutes } from '../hooks/useAppRoutes'; import { useAppRoutes } from '../hooks/useAppRoutes';
import { useAppVersion } from '../hooks/useAppVersion';
import { useCreateWorkspace } from '../hooks/useCreateWorkspace'; import { useCreateWorkspace } from '../hooks/useCreateWorkspace';
import { useDeleteWorkspace } from '../hooks/useDeleteWorkspace'; import { useDeleteWorkspace } from '../hooks/useDeleteWorkspace';
import { useExportData } from '../hooks/useExportData'; import { useExportData } from '../hooks/useExportData';
@@ -40,6 +41,7 @@ export const WorkspaceActionsDropdown = memo(function WorkspaceActionsDropdown({
const dialog = useDialog(); const dialog = useDialog();
const prompt = usePrompt(); const prompt = usePrompt();
const routes = useAppRoutes(); const routes = useAppRoutes();
const appVersion = useAppVersion();
const [updateMode, setUpdateMode] = useUpdateMode(); const [updateMode, setUpdateMode] = useUpdateMode();
const items: DropdownItem[] = useMemo(() => { const items: DropdownItem[] = useMemo(() => {
@@ -159,7 +161,7 @@ export const WorkspaceActionsDropdown = memo(function WorkspaceActionsDropdown({
leftSlot: <Icon icon="upload" />, leftSlot: <Icon icon="upload" />,
onSelect: () => exportData.mutate(), onSelect: () => exportData.mutate(),
}, },
{ type: 'separator' }, { type: 'separator', label: `v${appVersion.data}` },
{ {
key: 'appearance', key: 'appearance',
label: 'Toggle Theme', label: 'Toggle Theme',

View File

@@ -0,0 +1,6 @@
import { useQuery } from '@tanstack/react-query';
import { getVersion } from '@tauri-apps/api/app';
export function useAppVersion() {
return useQuery<string>(['appVersion'], getVersion);
}