Skip to content

Commit

Permalink
fix: help & feedback links on mobile (#1849)
Browse files Browse the repository at this point in the history
  • Loading branch information
amanharwara committed Oct 20, 2022
1 parent 050fa9c commit fb72c2f
Show file tree
Hide file tree
Showing 6 changed files with 130 additions and 82 deletions.
4 changes: 4 additions & 0 deletions packages/mobile/android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@
<action android:name="android.intent.action.VIEW" />
<data android:scheme="https"/>
</intent>
<intent>
<action android:name="android.intent.action.VIEW" />
<data android:scheme="mailto"/>
</intent>
</queries>

</manifest>
1 change: 1 addition & 0 deletions packages/mobile/ios/StandardNotes/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@
<array>
<string>http</string>
<string>https</string>
<string>mailto</string>
</array>
<key>LSRequiresIPhoneOS</key>
<true/>
Expand Down
1 change: 1 addition & 0 deletions packages/mobile/ios/StandardNotesDev-Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
<array>
<string>http</string>
<string>https</string>
<string>mailto</string>
</array>
<key>LSRequiresIPhoneOS</key>
<true/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ const PaneSelector: FunctionComponent<PreferencesProps & { menu: PreferencesMenu
case 'get-free-month':
return null
case 'help-feedback':
return <HelpAndFeedback />
return <HelpAndFeedback application={application} />
default:
return (
<General
Expand Down
Original file line number Diff line number Diff line change
@@ -1,86 +1,127 @@
import { FunctionComponent } from 'react'
import { Title, Subtitle, Text, LinkButton } from '@/Components/Preferences/PreferencesComponents/Content'
import HorizontalSeparator from '@/Components/Shared/HorizontalSeparator'
import PreferencesPane from '../PreferencesComponents/PreferencesPane'
import PreferencesGroup from '../PreferencesComponents/PreferencesGroup'
import PreferencesSegment from '../PreferencesComponents/PreferencesSegment'
import { WebApplication } from '@/Application/Application'
import { MouseEventHandler } from 'react'

const HelpAndFeedback: FunctionComponent = () => (
<PreferencesPane>
<PreferencesGroup>
<PreferencesSegment>
<Title>Frequently asked questions</Title>
<div className="h-2 w-full" />
<Subtitle>Who can read my private notes?</Subtitle>
<Text>
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{' '}
<a target="_blank" href="https://standardnotes.com/privacy">
Privacy Manifesto.
</a>
</Text>
</PreferencesSegment>
<HorizontalSeparator classes="my-4" />
<PreferencesSegment>
<Subtitle>Can I collaborate with others on a note?</Subtitle>
<Text>
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.
</Text>
</PreferencesSegment>
<HorizontalSeparator classes="my-4" />
<PreferencesSegment>
<Subtitle>Can I use Standard Notes totally offline?</Subtitle>
<Text>
Standard Notes can be used totally offline without an account, and without an internet connection. You can
find{' '}
<a target="_blank" href="https://standardnotes.com/help/59/can-i-use-standard-notes-totally-offline">
more details here.
</a>
</Text>
</PreferencesSegment>
<HorizontalSeparator classes="my-4" />
<PreferencesSegment>
<Subtitle>Can’t find your question here?</Subtitle>
<LinkButton className="mt-3" label="Open FAQ" link="https://standardnotes.com/help" />
</PreferencesSegment>
</PreferencesGroup>
<PreferencesGroup>
<PreferencesSegment>
<Title>Community forum</Title>
<Text>
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{' '}
<a target="_blank" href="https://standardnotes.com/longevity/">
Longevity statement
</a>{' '}
before advocating for a feature request.
</Text>
<LinkButton className="mt-3" label="Go to the forum" link="https://forum.standardnotes.org/" />
</PreferencesSegment>
</PreferencesGroup>
<PreferencesGroup>
<PreferencesSegment>
<Title>Community groups</Title>
<Text>
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.
</Text>
<LinkButton className="mt-3" link="https://standardnotes.com/slack" label="Join our Slack" />
<LinkButton className="mt-3" link="https://standardnotes.com/discord" label="Join our Discord" />
</PreferencesSegment>
</PreferencesGroup>
<PreferencesGroup>
<PreferencesSegment>
<Title>Account related issue?</Title>
<Text>Send an email to help@standardnotes.com and we’ll sort it out.</Text>
<LinkButton className="mt-3" link="mailto: help@standardnotes.com" label="Email us" />
</PreferencesSegment>
</PreferencesGroup>
</PreferencesPane>
)
const HelpAndFeedback = ({ application }: { application: WebApplication }) => {
const openLinkOnMobile = (link: string) => {
if (application.isNativeMobileWeb()) {
application.mobileDevice().openUrl(link)
}
}

const handleClick: MouseEventHandler<HTMLAnchorElement> = (event) => {
if (application.isNativeMobileWeb()) {
event.preventDefault()
openLinkOnMobile(event.currentTarget.href)
}
}

return (
<PreferencesPane>
<PreferencesGroup>
<PreferencesSegment>
<Title>Frequently asked questions</Title>
<div className="h-2 w-full" />
<Subtitle>Who can read my private notes?</Subtitle>
<Text>
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{' '}
<a
target="_blank"
className="underline hover:no-underline"
href="https://standardnotes.com/privacy"
onClick={handleClick}
>
Privacy Manifesto.
</a>
</Text>
</PreferencesSegment>
<HorizontalSeparator classes="my-4" />
<PreferencesSegment>
<Subtitle>Can I collaborate with others on a note?</Subtitle>
<Text>
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.
</Text>
</PreferencesSegment>
<HorizontalSeparator classes="my-4" />
<PreferencesSegment>
<Subtitle>Can I use Standard Notes totally offline?</Subtitle>
<Text>
Standard Notes can be used totally offline without an account, and without an internet connection. You can
find{' '}
<a
target="_blank"
className="underline hover:no-underline"
href="https://standardnotes.com/help/59/can-i-use-standard-notes-totally-offline"
onClick={handleClick}
>
more details here.
</a>
</Text>
</PreferencesSegment>
<HorizontalSeparator classes="my-4" />
<PreferencesSegment>
<Subtitle>Can’t find your question here?</Subtitle>
<LinkButton className="mt-3" label="Open FAQ" link="https://standardnotes.com/help" onClick={handleClick} />
</PreferencesSegment>
</PreferencesGroup>
<PreferencesGroup>
<PreferencesSegment>
<Title>Community forum</Title>
<Text>
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{' '}
<a target="_blank" className="underline hover:no-underline" href="https://standardnotes.com/longevity/">
Longevity statement
</a>{' '}
before advocating for a feature request.
</Text>
<LinkButton
className="mt-3"
label="Go to the forum"
link="https://forum.standardnotes.org/"
onClick={handleClick}
/>
</PreferencesSegment>
</PreferencesGroup>
<PreferencesGroup>
<PreferencesSegment>
<Title>Community groups</Title>
<Text>
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.
</Text>
<LinkButton
className="mt-3"
link="https://standardnotes.com/slack"
label="Join our Slack"
onClick={handleClick}
/>
<LinkButton
className="mt-3"
link="https://standardnotes.com/discord"
label="Join our Discord"
onClick={handleClick}
/>
</PreferencesSegment>
</PreferencesGroup>
<PreferencesGroup>
<PreferencesSegment>
<Title>Account related issue?</Title>
<Text>Send an email to help@standardnotes.com and we’ll sort it out.</Text>
<LinkButton className="mt-3" link="mailto: help@standardnotes.com" label="Email us" onClick={handleClick} />
</PreferencesSegment>
</PreferencesGroup>
</PreferencesPane>
)
}

export default HelpAndFeedback
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { classNames } from '@/Utils/ConcatenateClassNames'
import { FunctionComponent, ReactNode } from 'react'
import { FunctionComponent, MouseEventHandler, ReactNode } from 'react'

type Props = {
className?: string
Expand Down Expand Up @@ -31,8 +31,9 @@ export const LinkButton: FunctionComponent<{
label: string
link: string
className?: string
}> = ({ label, link, className }) => (
<a target="_blank" className={`${className} ${buttonClasses}`} href={link}>
onClick?: MouseEventHandler<HTMLAnchorElement>
}> = ({ label, link, className, onClick }) => (
<a target="_blank" className={`${className} ${buttonClasses}`} href={link} onClick={onClick}>
{label}
</a>
)

0 comments on commit fb72c2f

Please sign in to comment.