[WIP] Encryption for secure values (#183)

This commit is contained in:
Gregory Schier
2025-04-15 07:18:26 -07:00
committed by GitHub
parent e114a85c39
commit 2e55a1bd6d
208 changed files with 4063 additions and 28698 deletions

View File

@@ -2,9 +2,10 @@ import type { LicenseCheckStatus } from '@yaakapp-internal/license';
import { useLicense } from '@yaakapp-internal/license';
import type { ReactNode } from 'react';
import { openSettings } from '../commands/openSettings';
import { appInfo } from '../hooks/useAppInfo';
import { useLicenseConfirmation } from '../hooks/useLicenseConfirmation';
import { BadgeButton } from './core/BadgeButton';
import type { ButtonProps } from './core/Button';
import { Button } from './core/Button';
import { SettingsTab } from './Settings/SettingsTab';
const details: Record<
@@ -21,11 +22,15 @@ export function LicenseBadge() {
const { check } = useLicense();
const [licenseDetails, setLicenseDetails] = useLicenseConfirmation();
if (appInfo.isDev) {
return null;
}
if (check.error) {
return (
<LicenseBadgeButton color="danger" onClick={() => openSettings.mutate(SettingsTab.License)}>
<BadgeButton color="danger" onClick={() => openSettings.mutate(SettingsTab.License)}>
License Error
</LicenseBadgeButton>
</BadgeButton>
);
}
@@ -50,7 +55,7 @@ export function LicenseBadge() {
}
return (
<LicenseBadgeButton
<BadgeButton
color={detail.color}
onClick={async () => {
if (check.data.type === 'trialing') {
@@ -63,10 +68,6 @@ export function LicenseBadge() {
}}
>
{detail.label}
</LicenseBadgeButton>
</BadgeButton>
);
}
function LicenseBadgeButton({ ...props }: ButtonProps) {
return <Button size="2xs" variant="border" className="!rounded-full mx-1" {...props} />;
}