mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-04-23 09:08:32 +02:00
Git support (#143)
This commit is contained in:
@@ -3,18 +3,26 @@ import type { LicenseCheckStatus } from '@yaakapp-internal/license';
|
||||
import { useLicense } from '@yaakapp-internal/license';
|
||||
import type { ReactNode } from 'react';
|
||||
import { appInfo } from '../hooks/useAppInfo';
|
||||
import { useOpenSettings } from '../hooks/useOpenSettings';
|
||||
import type { ButtonProps } from './core/Button';
|
||||
import { Button } from './core/Button';
|
||||
import {HStack} from "./core/Stacks";
|
||||
import { SettingsTab } from './Settings/SettingsTab';
|
||||
import { Icon } from './core/Icon';
|
||||
import { HStack } from './core/Stacks';
|
||||
import { openSettings } from '../commands/openSettings';
|
||||
import {SettingsTab} from "./Settings/SettingsTab";
|
||||
|
||||
const details: Record<
|
||||
LicenseCheckStatus['type'] | 'dev' | 'beta',
|
||||
{ label: ReactNode; color: ButtonProps['color'] } | null
|
||||
> = {
|
||||
beta: { label: <HStack space={1}><span>Beta Feedback</span><Icon size="xs" icon='external_link'/></HStack>, color: 'info' },
|
||||
beta: {
|
||||
label: (
|
||||
<HStack space={1}>
|
||||
<span>Beta Feedback</span>
|
||||
<Icon size="xs" icon="external_link" />
|
||||
</HStack>
|
||||
),
|
||||
color: 'info',
|
||||
},
|
||||
dev: { label: 'Develop', color: 'secondary' },
|
||||
commercial_use: null,
|
||||
invalid_license: { label: 'License Error', color: 'danger' },
|
||||
@@ -23,7 +31,6 @@ const details: Record<
|
||||
};
|
||||
|
||||
export function LicenseBadge() {
|
||||
const openSettings = useOpenSettings(SettingsTab.License);
|
||||
const { check } = useLicense();
|
||||
|
||||
if (check.data == null) {
|
||||
@@ -49,7 +56,7 @@ export function LicenseBadge() {
|
||||
if (checkType === 'beta') {
|
||||
await openUrl('https://feedback.yaak.app');
|
||||
} else {
|
||||
openSettings.mutate();
|
||||
openSettings.mutate(SettingsTab.License);
|
||||
}
|
||||
}}
|
||||
color={detail.color}
|
||||
|
||||
Reference in New Issue
Block a user