Tweak license badge and fix keyring dep

This commit is contained in:
Gregory Schier
2025-10-01 21:01:27 -07:00
parent 8662b230e7
commit 2152cf87d7
6 changed files with 37 additions and 31 deletions

View File

@@ -91,21 +91,21 @@ yaak-ws = { path = "yaak-ws" }
[workspace.dependencies] [workspace.dependencies]
chrono = "0.4.41" chrono = "0.4.41"
hex = "0.4.3" hex = "0.4.3"
keyring = { version = "3.6.3", features = ["apple-native", "windows-native", "sync-secret-service"] } keyring = "3.6.3"
reqwest = "0.12.20" reqwest = "0.12.20"
reqwest_cookie_store = "0.8.0"
rustls = { version = "0.23.27", default-features = false }
rustls-platform-verifier = "0.6.0"
serde = "1.0.219" serde = "1.0.219"
serde_json = "1.0.140" serde_json = "1.0.140"
sha2 = "0.10.9"
tauri = "2.8.5" tauri = "2.8.5"
tauri-plugin = "2.4.0" tauri-plugin = "2.4.0"
tauri-plugin-dialog = "2.4.0" tauri-plugin-dialog = "2.4.0"
tauri-plugin-shell = "2.3.1" tauri-plugin-shell = "2.3.1"
tokio = "1.45.1"
thiserror = "2.0.12" thiserror = "2.0.12"
tokio = "1.45.1"
ts-rs = "11.0.1" ts-rs = "11.0.1"
reqwest_cookie_store = "0.8.0"
rustls = { version = "0.23.27", default-features = false }
rustls-platform-verifier = "0.6.0"
sha2 = "0.10.9"
yaak-common = { path = "yaak-common" } yaak-common = { path = "yaak-common" }
yaak-crypto = { path = "yaak-crypto" } yaak-crypto = { path = "yaak-crypto" }
yaak-fonts = { path = "yaak-fonts" } yaak-fonts = { path = "yaak-fonts" }

View File

@@ -9,7 +9,7 @@ publish = false
base32 = "0.5.1" # For encoding human-readable key base32 = "0.5.1" # For encoding human-readable key
base64 = "0.22.1" # For encoding in the database base64 = "0.22.1" # For encoding in the database
chacha20poly1305 = "0.10.1" chacha20poly1305 = "0.10.1"
keyring = { workspace = true } keyring = { workspace = true, features = ["apple-native", "windows-native", "sync-secret-service"] }
log = "0.4.26" log = "0.4.26"
serde = { workspace = true, features = ["derive"] } serde = { workspace = true, features = ["derive"] }
tauri = { workspace = true } tauri = { workspace = true }

View File

@@ -7,8 +7,11 @@ publish = false
[dependencies] [dependencies]
base64 = "0.22.1" base64 = "0.22.1"
chrono = { workspace = true }
dunce = "1.0.4" dunce = "1.0.4"
futures-util = "0.3.30" futures-util = "0.3.30"
hex = { workspace = true }
keyring = { workspace = true, features = ["apple-native", "windows-native", "sync-secret-service"] }
log = "0.4.21" log = "0.4.21"
md5 = "0.7.0" md5 = "0.7.0"
path-slash = "0.2.1" path-slash = "0.2.1"
@@ -17,21 +20,18 @@ regex = "1.10.6"
reqwest = { workspace = true, features = ["json"] } reqwest = { workspace = true, features = ["json"] }
serde = { workspace = true, features = ["derive"] } serde = { workspace = true, features = ["derive"] }
serde_json = { workspace = true } serde_json = { workspace = true }
sha2 = { workspace = true }
tauri = { workspace = true } tauri = { workspace = true }
tauri-plugin-shell = { workspace = true } tauri-plugin-shell = { workspace = true }
thiserror = { workspace = true } thiserror = { workspace = true }
tokio = { workspace = true, features = ["macros", "rt-multi-thread", "process"] } tokio = { workspace = true, features = ["macros", "rt-multi-thread", "process"] }
tokio-tungstenite = "0.26.1" tokio-tungstenite = "0.26.1"
ts-rs = { workspace = true, features = ["import-esm"] } ts-rs = { workspace = true, features = ["import-esm"] }
sha2 = { workspace = true }
yaak-common = { workspace = true } yaak-common = { workspace = true }
yaak-crypto = { workspace = true } yaak-crypto = { workspace = true }
yaak-models = { workspace = true } yaak-models = { workspace = true }
yaak-templates = { workspace = true } yaak-templates = { workspace = true }
zip-extract = "0.4.0" zip-extract = "0.4.0"
chrono = { workspace = true }
hex = { workspace = true }
keyring = { workspace = true }
[build-dependencies] [build-dependencies]
tauri-plugin = { workspace = true, features = ["build"] } tauri-plugin = { workspace = true, features = ["build"] }

View File

@@ -15,7 +15,7 @@ const details: Record<
commercial_use: null, commercial_use: null,
invalid_license: { label: 'License Error', color: 'danger' }, invalid_license: { label: 'License Error', color: 'danger' },
personal_use: { label: 'Personal Use', color: 'notice' }, personal_use: { label: 'Personal Use', color: 'notice' },
trialing: { label: 'Personal Use', color: 'info' }, trialing: { label: 'Trialing', color: 'info' },
}; };
export function LicenseBadge() { export function LicenseBadge() {
@@ -46,11 +46,6 @@ function LicenseBadgeCmp() {
return null; return null;
} }
// User is trialing but has already seen the message, so hide badge
if (check.data.type === 'trialing') {
return null;
}
const detail = details[check.data.type]; const detail = details[check.data.type];
if (detail == null) { if (detail == null) {
return null; return null;
@@ -59,9 +54,7 @@ function LicenseBadgeCmp() {
return ( return (
<BadgeButton <BadgeButton
color={detail.color} color={detail.color}
onClick={async () => { onClick={() => openSettings.mutate('license')}
openSettings.mutate('license');
}}
> >
{detail.label} {detail.label}
</BadgeButton> </BadgeButton>

View File

@@ -35,17 +35,17 @@ function SettingsLicenseCmp() {
{check.data?.type === 'commercial_use' ? ( {check.data?.type === 'commercial_use' ? (
<Banner color="success">Your license is active 🥳</Banner> <Banner color="success">Your license is active 🥳</Banner>
) : check.data?.type == 'trialing' ? ( ) : check.data?.type == 'trialing' ? (
<Banner color="success" className="flex flex-col gap-3 max-w-lg"> <Banner color="info" className="flex flex-col gap-3 max-w-lg">
<p className="select-text"> <p>
<strong> <strong>
{pluralizeCount('day', differenceInDays(check.data.end, new Date()))} remaining {pluralizeCount('day', differenceInDays(check.data.end, new Date()))} remaining
</strong>{' '} </strong>{' '}
on trial on your commercial-use trial
</p> </p>
</Banner> </Banner>
) : check.data?.type == 'personal_use' ? ( ) : check.data?.type == 'personal_use' ? (
<Banner color="success" className="flex flex-col gap-3 max-w-lg"> <Banner color="notice" className="flex flex-col gap-3 max-w-lg">
<p>Your free trial has ended</p> <p>You are able to use Yaak for personal use only</p>
</Banner> </Banner>
) : null} ) : null}
@@ -98,16 +98,21 @@ function SettingsLicenseCmp() {
</HStack> </HStack>
) : ( ) : (
<HStack space={2}> <HStack space={2}>
<Button color="primary" size="sm" onClick={toggleActivateFormVisible}>
Activate
</Button>
<Button <Button
variant="border"
color="secondary" color="secondary"
size="sm" size="sm"
onClick={toggleActivateFormVisible}
>
Activate License
</Button>
<Button
size="sm"
color="primary"
onClick={() => openUrl('https://yaak.app/pricing?s=purchase&ref=app.yaak.desktop')} onClick={() => openUrl('https://yaak.app/pricing?s=purchase&ref=app.yaak.desktop')}
rightSlot={<Icon icon="external_link" />} rightSlot={<Icon icon="external_link" />}
> >
Purchase Purchase License
</Button> </Button>
</HStack> </HStack>
)} )}

View File

@@ -1,6 +1,14 @@
import classNames from 'classnames';
import type { ButtonProps } from './Button'; import type { ButtonProps } from './Button';
import { Button } from './Button'; import { Button } from './Button';
export function BadgeButton(props: ButtonProps) { export function BadgeButton({ className, ...props }: ButtonProps) {
return <Button size="2xs" variant="border" className="!rounded-full mx-1" {...props} />; return (
<Button
size="2xs"
variant="border"
className={classNames(className, '!rounded-full mx-1 !px-3')}
{...props}
/>
);
} }