mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-04-24 09:48:28 +02:00
[WIP] Encryption for secure values (#183)
This commit is contained in:
@@ -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} />;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user