From 82528cd3f98e2e75611dc78512fe69dc1eb4805f Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Fri, 3 Oct 2025 16:05:25 -0500 Subject: [PATCH] Conditional display of elements depending on if the app is running native --- src/components/OnboardingDialog.tsx | 13 +++++---- src/pages/DataSettings.tsx | 45 +++++++++++++++-------------- 2 files changed, 32 insertions(+), 26 deletions(-) diff --git a/src/components/OnboardingDialog.tsx b/src/components/OnboardingDialog.tsx index af3d8ec1..43d0e097 100644 --- a/src/components/OnboardingDialog.tsx +++ b/src/components/OnboardingDialog.tsx @@ -1,3 +1,4 @@ +import { Capacitor } from '@capacitor/core'; import { Decimal } from 'decimal.js'; import { useState, useEffect, useRef } from 'react'; import { generateSecretKey } from 'nostr-tools'; @@ -275,21 +276,23 @@ export function OnboardingDialog({ open, onOpenChange }: OnboardingDialogProps) {step === 'open-source' && (
-

Shakespeare is Open Source software that runs entirely in your web browser

+

+ Shakespeare is Open Source software that runs entirely {Capacitor.isNativePlatform() ? 'on your device' : 'in your web browser'} +

-

Your browser connects directly to third-party AI providers of your choice

+

Your device connects directly to third-party AI providers of your choice

-

Your files are stored on your device in your browser

+

Your files are stored on your device{Capacitor.isNativePlatform() ? '' : ' in your browser'}

-

Be careful not to delete your browser data or you may lose project files

+

Be careful not to delete your {Capacitor.isNativePlatform() ? 'app' : 'browser'} data or you may lose project files

@@ -303,7 +306,7 @@ export function OnboardingDialog({ open, onOpenChange }: OnboardingDialogProps)

- Shakespeare is not a cloud service. It's Open Source software that runs in your web browser. + Shakespeare is not a cloud service. It's Open Source software that runs on your device. You agree to the Terms of Service of AI providers you interact with. Shakespeare is provided "as is" without warranty of any kind.

diff --git a/src/pages/DataSettings.tsx b/src/pages/DataSettings.tsx index 11e1f393..e2e748af 100644 --- a/src/pages/DataSettings.tsx +++ b/src/pages/DataSettings.tsx @@ -1,3 +1,4 @@ +import { Capacitor } from '@capacitor/core'; import { useState, useEffect } from 'react'; import { useNavigate } from 'react-router-dom'; import { useTranslation } from 'react-i18next'; @@ -337,27 +338,29 @@ export function DataSettings() { )} {/* Persist Data */} - - - - - {t('persistData')} - - - {t('persistDataDescription')} - - - -
- -
-
-
+ {!Capacitor.isNativePlatform() && ( + + + + + {t('persistData')} + + + {t('persistDataDescription')} + + + +
+ +
+
+
+ )} {/* Export Files */}