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]
chrono = "0.4.41"
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_cookie_store = "0.8.0"
rustls = { version = "0.23.27", default-features = false }
rustls-platform-verifier = "0.6.0"
serde = "1.0.219"
serde_json = "1.0.140"
sha2 = "0.10.9"
tauri = "2.8.5"
tauri-plugin = "2.4.0"
tauri-plugin-dialog = "2.4.0"
tauri-plugin-shell = "2.3.1"
tokio = "1.45.1"
thiserror = "2.0.12"
tokio = "1.45.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-crypto = { path = "yaak-crypto" }
yaak-fonts = { path = "yaak-fonts" }

View File

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

View File

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

View File

@@ -15,7 +15,7 @@ const details: Record<
commercial_use: null,
invalid_license: { label: 'License Error', color: 'danger' },
personal_use: { label: 'Personal Use', color: 'notice' },
trialing: { label: 'Personal Use', color: 'info' },
trialing: { label: 'Trialing', color: 'info' },
};
export function LicenseBadge() {
@@ -46,11 +46,6 @@ function LicenseBadgeCmp() {
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];
if (detail == null) {
return null;
@@ -59,9 +54,7 @@ function LicenseBadgeCmp() {
return (
<BadgeButton
color={detail.color}
onClick={async () => {
openSettings.mutate('license');
}}
onClick={() => openSettings.mutate('license')}
>
{detail.label}
</BadgeButton>

View File

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

View File

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