mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-04-24 01:28:35 +02:00
Better dropdown menu
This commit is contained in:
5
.github/workflows/artifacts.yml
vendored
5
.github/workflows/artifacts.yml
vendored
@@ -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 }}
|
||||||
|
|
||||||
|
|||||||
@@ -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;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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": [],
|
||||||
|
|||||||
@@ -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',
|
||||||
|
|||||||
6
src-web/hooks/useAppVersion.ts
Normal file
6
src-web/hooks/useAppVersion.ts
Normal 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);
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user