Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 38 additions & 22 deletions apps/desktop/src/components/views/settings/SettingsSyncPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ type Labels = {
cloudProvider: string;
cloudProviderSelfHosted: string;
cloudProviderDropbox: string;
cloudProviderCloudkit: string;
cloudkitDesc: string;
dropboxAppKey: string;
dropboxAppKeyHint: string;
dropboxRedirectUri: string;
Expand Down Expand Up @@ -379,29 +381,20 @@ export function SettingsSyncPage({
{t.syncBackendWebdav}
</button>
<button
onClick={() => onSetSyncBackend('cloud')}
onClick={() => {
if (syncBackend !== 'cloud' && syncBackend !== 'cloudkit') {
onSetSyncBackend('cloud');
}
}}
className={cn(
"px-3 py-1.5 rounded-md text-sm font-medium transition-colors border",
syncBackend === 'cloud'
syncBackend === 'cloud' || syncBackend === 'cloudkit'
? "bg-primary/10 text-primary border-primary ring-1 ring-primary"
: "bg-muted/50 text-muted-foreground border-border hover:bg-muted hover:text-foreground",
)}
>
{t.syncBackendCloud}
</button>
{isMacOS && (
<button
onClick={() => onSetSyncBackend('cloudkit')}
className={cn(
"px-3 py-1.5 rounded-md text-sm font-medium transition-colors border",
syncBackend === 'cloudkit'
? "bg-primary/10 text-primary border-primary ring-1 ring-primary"
: "bg-muted/50 text-muted-foreground border-border hover:bg-muted hover:text-foreground",
)}
>
{t.syncBackendCloudkit}
</button>
)}
</div>
</div>

Expand Down Expand Up @@ -516,37 +509,56 @@ export function SettingsSyncPage({
</div>
)}

{syncBackend === 'cloud' && (
{(syncBackend === 'cloud' || syncBackend === 'cloudkit') && (
<div className="space-y-4">
<div className="flex items-center justify-between gap-4">
<span className="text-sm font-medium">{t.cloudProvider}</span>
<div className="flex gap-2">
<button
onClick={() => onCloudProviderChange('selfhosted')}
onClick={() => {
onCloudProviderChange('selfhosted');
if (syncBackend !== 'cloud') onSetSyncBackend('cloud');
}}
className={cn(
"px-3 py-1.5 rounded-md text-sm font-medium transition-colors border",
cloudProvider === 'selfhosted'
syncBackend === 'cloud' && cloudProvider === 'selfhosted'
? "bg-primary/10 text-primary border-primary ring-1 ring-primary"
: "bg-muted/50 text-muted-foreground border-border hover:bg-muted hover:text-foreground",
)}
>
{t.cloudProviderSelfHosted}
</button>
<button
onClick={() => onCloudProviderChange('dropbox')}
onClick={() => {
onCloudProviderChange('dropbox');
if (syncBackend !== 'cloud') onSetSyncBackend('cloud');
}}
className={cn(
"px-3 py-1.5 rounded-md text-sm font-medium transition-colors border",
cloudProvider === 'dropbox'
syncBackend === 'cloud' && cloudProvider === 'dropbox'
? "bg-primary/10 text-primary border-primary ring-1 ring-primary"
: "bg-muted/50 text-muted-foreground border-border hover:bg-muted hover:text-foreground",
)}
>
{t.cloudProviderDropbox}
</button>
{isMacOS && (
<button
onClick={() => onSetSyncBackend('cloudkit')}
className={cn(
"px-3 py-1.5 rounded-md text-sm font-medium transition-colors border",
syncBackend === 'cloudkit'
? "bg-primary/10 text-primary border-primary ring-1 ring-primary"
: "bg-muted/50 text-muted-foreground border-border hover:bg-muted hover:text-foreground",
)}
>
{t.cloudProviderCloudkit}
</button>
)}
</div>
</div>

{cloudProvider === 'selfhosted' && (
{syncBackend === 'cloud' && cloudProvider === 'selfhosted' && (
<div className="space-y-3">
<div className="flex flex-col gap-2">
<label className="text-sm font-medium">{t.cloudUrl}</label>
Expand Down Expand Up @@ -588,7 +600,11 @@ export function SettingsSyncPage({
</div>
)}

{cloudProvider === 'dropbox' && (
{syncBackend === 'cloudkit' && (
<p className="text-sm text-muted-foreground">{t.cloudkitDesc}</p>
)}

{syncBackend === 'cloud' && cloudProvider === 'dropbox' && (
<div className="space-y-3">
<div className="flex flex-col gap-2">
<label className="text-sm font-medium">{t.dropboxAppKey}</label>
Expand Down
8 changes: 6 additions & 2 deletions apps/desktop/src/components/views/settings/labels.ts
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ export const labelFallback = {
syncBackendOff: 'Off',
syncBackendFile: 'File',
syncBackendWebdav: 'WebDAV',
syncBackendCloud: 'Self-Hosted',
syncBackendCloud: 'Cloud',
syncBackendCloudkit: 'iCloud',
syncPreferences: 'Settings sync options',
syncPreferencesDesc: 'Choose which preferences stay in sync across devices.',
Expand Down Expand Up @@ -244,6 +244,8 @@ export const labelFallback = {
cloudProvider: 'Cloud provider',
cloudProviderSelfHosted: 'Self-hosted',
cloudProviderDropbox: 'Dropbox',
cloudProviderCloudkit: 'iCloud',
cloudkitDesc: 'Syncs your tasks, projects, and areas across Apple devices using iCloud. No setup required.',
dropboxAppKey: 'Dropbox account',
dropboxAppKeyHint: 'Dropbox app key is injected at build/release time.',
dropboxRedirectUri: 'Redirect URI',
Expand Down Expand Up @@ -521,7 +523,7 @@ export const labelFallback = {
syncBackendOff: '关闭',
syncBackendFile: '文件',
syncBackendWebdav: 'WebDAV',
syncBackendCloud: '自托管',
syncBackendCloud: '云端',
syncBackendCloudkit: 'iCloud',
syncPreferences: '设置同步选项',
syncPreferencesDesc: '选择要在设备间同步的偏好设置。',
Expand Down Expand Up @@ -574,6 +576,8 @@ export const labelFallback = {
cloudProvider: '云服务提供方',
cloudProviderSelfHosted: '自托管',
cloudProviderDropbox: 'Dropbox',
cloudProviderCloudkit: 'iCloud',
cloudkitDesc: '通过 iCloud 在 Apple 设备间同步您的任务、项目和领域。无需额外设置。',
dropboxAppKey: 'Dropbox 账号',
dropboxAppKeyHint: 'Dropbox App Key 在构建/发布时注入。',
dropboxRedirectUri: '回调地址',
Expand Down