From fb72c2fdae277cb4e348ce5ee550f0545f281dcd Mon Sep 17 00:00:00 2001 From: Aman Harwara Date: Thu, 20 Oct 2022 14:10:23 +0530 Subject: [PATCH] fix: help & feedback links on mobile (#1849) --- .../android/app/src/main/AndroidManifest.xml | 4 + packages/mobile/ios/StandardNotes/Info.plist | 1 + .../mobile/ios/StandardNotesDev-Info.plist | 1 + .../Components/Preferences/PaneSelector.tsx | 2 +- .../Preferences/Panes/HelpFeedback.tsx | 197 +++++++++++------- .../PreferencesComponents/Content.tsx | 7 +- 6 files changed, 130 insertions(+), 82 deletions(-) diff --git a/packages/mobile/android/app/src/main/AndroidManifest.xml b/packages/mobile/android/app/src/main/AndroidManifest.xml index 4207f3fdf..16dc7bce7 100644 --- a/packages/mobile/android/app/src/main/AndroidManifest.xml +++ b/packages/mobile/android/app/src/main/AndroidManifest.xml @@ -49,6 +49,10 @@ + + + + diff --git a/packages/mobile/ios/StandardNotes/Info.plist b/packages/mobile/ios/StandardNotes/Info.plist index f2f4823a5..e67578d1b 100644 --- a/packages/mobile/ios/StandardNotes/Info.plist +++ b/packages/mobile/ios/StandardNotes/Info.plist @@ -74,6 +74,7 @@ http https + mailto LSRequiresIPhoneOS diff --git a/packages/mobile/ios/StandardNotesDev-Info.plist b/packages/mobile/ios/StandardNotesDev-Info.plist index d1d5a0df9..98055f141 100644 --- a/packages/mobile/ios/StandardNotesDev-Info.plist +++ b/packages/mobile/ios/StandardNotesDev-Info.plist @@ -52,6 +52,7 @@ http https + mailto LSRequiresIPhoneOS diff --git a/packages/web/src/javascripts/Components/Preferences/PaneSelector.tsx b/packages/web/src/javascripts/Components/Preferences/PaneSelector.tsx index f249c6849..c05375287 100644 --- a/packages/web/src/javascripts/Components/Preferences/PaneSelector.tsx +++ b/packages/web/src/javascripts/Components/Preferences/PaneSelector.tsx @@ -50,7 +50,7 @@ const PaneSelector: FunctionComponent + return default: return ( ( - - - - Frequently asked questions -
- Who can read my private notes? - - Quite simply: no one but you. Not us, not your ISP, not a hacker, and not a government agency. As long as you - keep your password safe, and your password is reasonably strong, then you are the only person in the world - with the ability to decrypt your notes. For more on how we handle your privacy and security, check out our - easy to read{' '} - - Privacy Manifesto. - - - - - - Can I collaborate with others on a note? - - Because of our encrypted architecture, Standard Notes does not currently provide a real-time collaboration - solution. Multiple users can share the same account however, but editing at the same time may result in sync - conflicts, which may result in the duplication of notes. - - - - - Can I use Standard Notes totally offline? - - Standard Notes can be used totally offline without an account, and without an internet connection. You can - find{' '} - - more details here. - - - - - - Can’t find your question here? - - - - - - Community forum - - If you have an issue, found a bug or want to suggest a feature, you can browse or post to the forum. It’s - recommended for non-account related issues. Please read our{' '} - - Longevity statement - {' '} - before advocating for a feature request. - - - - - - - Community groups - - Want to meet other passionate note-takers and privacy enthusiasts? Want to share your feedback with us? Join - the Standard Notes community groups for discussions on security, themes, editors and more. - - - - - - - - Account related issue? - Send an email to help@standardnotes.com and we’ll sort it out. - - - - -) +const HelpAndFeedback = ({ application }: { application: WebApplication }) => { + const openLinkOnMobile = (link: string) => { + if (application.isNativeMobileWeb()) { + application.mobileDevice().openUrl(link) + } + } + + const handleClick: MouseEventHandler = (event) => { + if (application.isNativeMobileWeb()) { + event.preventDefault() + openLinkOnMobile(event.currentTarget.href) + } + } + + return ( + + + + Frequently asked questions +
+ Who can read my private notes? + + Quite simply: no one but you. Not us, not your ISP, not a hacker, and not a government agency. As long as + you keep your password safe, and your password is reasonably strong, then you are the only person in the + world with the ability to decrypt your notes. For more on how we handle your privacy and security, check out + our easy to read{' '} + + Privacy Manifesto. + + + + + + Can I collaborate with others on a note? + + Because of our encrypted architecture, Standard Notes does not currently provide a real-time collaboration + solution. Multiple users can share the same account however, but editing at the same time may result in sync + conflicts, which may result in the duplication of notes. + + + + + Can I use Standard Notes totally offline? + + Standard Notes can be used totally offline without an account, and without an internet connection. You can + find{' '} + + more details here. + + + + + + Can’t find your question here? + + + + + + Community forum + + If you have an issue, found a bug or want to suggest a feature, you can browse or post to the forum. It’s + recommended for non-account related issues. Please read our{' '} + + Longevity statement + {' '} + before advocating for a feature request. + + + + + + + Community groups + + Want to meet other passionate note-takers and privacy enthusiasts? Want to share your feedback with us? Join + the Standard Notes community groups for discussions on security, themes, editors and more. + + + + + + + + Account related issue? + Send an email to help@standardnotes.com and we’ll sort it out. + + + + + ) +} export default HelpAndFeedback diff --git a/packages/web/src/javascripts/Components/Preferences/PreferencesComponents/Content.tsx b/packages/web/src/javascripts/Components/Preferences/PreferencesComponents/Content.tsx index dbada4974..dcfb81c53 100644 --- a/packages/web/src/javascripts/Components/Preferences/PreferencesComponents/Content.tsx +++ b/packages/web/src/javascripts/Components/Preferences/PreferencesComponents/Content.tsx @@ -1,5 +1,5 @@ import { classNames } from '@/Utils/ConcatenateClassNames' -import { FunctionComponent, ReactNode } from 'react' +import { FunctionComponent, MouseEventHandler, ReactNode } from 'react' type Props = { className?: string @@ -31,8 +31,9 @@ export const LinkButton: FunctionComponent<{ label: string link: string className?: string -}> = ({ label, link, className }) => ( - + onClick?: MouseEventHandler +}> = ({ label, link, className, onClick }) => ( + {label} )