fix: help & feedback links on mobile (#1849)

This commit is contained in:
Aman Harwara
2022-10-20 14:10:23 +05:30
committed by GitHub
parent 050fa9cabc
commit fb72c2fdae
6 changed files with 130 additions and 82 deletions

View File

@@ -49,6 +49,10 @@
<action android:name="android.intent.action.VIEW" /> <action android:name="android.intent.action.VIEW" />
<data android:scheme="https"/> <data android:scheme="https"/>
</intent> </intent>
<intent>
<action android:name="android.intent.action.VIEW" />
<data android:scheme="mailto"/>
</intent>
</queries> </queries>
</manifest> </manifest>

View File

@@ -74,6 +74,7 @@
<array> <array>
<string>http</string> <string>http</string>
<string>https</string> <string>https</string>
<string>mailto</string>
</array> </array>
<key>LSRequiresIPhoneOS</key> <key>LSRequiresIPhoneOS</key>
<true/> <true/>

View File

@@ -52,6 +52,7 @@
<array> <array>
<string>http</string> <string>http</string>
<string>https</string> <string>https</string>
<string>mailto</string>
</array> </array>
<key>LSRequiresIPhoneOS</key> <key>LSRequiresIPhoneOS</key>
<true/> <true/>

View File

@@ -50,7 +50,7 @@ const PaneSelector: FunctionComponent<PreferencesProps & { menu: PreferencesMenu
case 'get-free-month': case 'get-free-month':
return null return null
case 'help-feedback': case 'help-feedback':
return <HelpAndFeedback /> return <HelpAndFeedback application={application} />
default: default:
return ( return (
<General <General

View File

@@ -1,86 +1,127 @@
import { FunctionComponent } from 'react'
import { Title, Subtitle, Text, LinkButton } from '@/Components/Preferences/PreferencesComponents/Content' import { Title, Subtitle, Text, LinkButton } from '@/Components/Preferences/PreferencesComponents/Content'
import HorizontalSeparator from '@/Components/Shared/HorizontalSeparator' import HorizontalSeparator from '@/Components/Shared/HorizontalSeparator'
import PreferencesPane from '../PreferencesComponents/PreferencesPane' import PreferencesPane from '../PreferencesComponents/PreferencesPane'
import PreferencesGroup from '../PreferencesComponents/PreferencesGroup' import PreferencesGroup from '../PreferencesComponents/PreferencesGroup'
import PreferencesSegment from '../PreferencesComponents/PreferencesSegment' import PreferencesSegment from '../PreferencesComponents/PreferencesSegment'
import { WebApplication } from '@/Application/Application'
import { MouseEventHandler } from 'react'
const HelpAndFeedback: FunctionComponent = () => ( const HelpAndFeedback = ({ application }: { application: WebApplication }) => {
<PreferencesPane> const openLinkOnMobile = (link: string) => {
<PreferencesGroup> if (application.isNativeMobileWeb()) {
<PreferencesSegment> application.mobileDevice().openUrl(link)
<Title>Frequently asked questions</Title> }
<div className="h-2 w-full" /> }
<Subtitle>Who can read my private notes?</Subtitle>
<Text> const handleClick: MouseEventHandler<HTMLAnchorElement> = (event) => {
Quite simply: no one but you. Not us, not your ISP, not a hacker, and not a government agency. As long as you if (application.isNativeMobileWeb()) {
keep your password safe, and your password is reasonably strong, then you are the only person in the world event.preventDefault()
with the ability to decrypt your notes. For more on how we handle your privacy and security, check out our openLinkOnMobile(event.currentTarget.href)
easy to read{' '} }
<a target="_blank" href="https://standardnotes.com/privacy"> }
Privacy Manifesto.
</a> return (
</Text> <PreferencesPane>
</PreferencesSegment> <PreferencesGroup>
<HorizontalSeparator classes="my-4" /> <PreferencesSegment>
<PreferencesSegment> <Title>Frequently asked questions</Title>
<Subtitle>Can I collaborate with others on a note?</Subtitle> <div className="h-2 w-full" />
<Text> <Subtitle>Who can read my private notes?</Subtitle>
Because of our encrypted architecture, Standard Notes does not currently provide a real-time collaboration <Text>
solution. Multiple users can share the same account however, but editing at the same time may result in sync Quite simply: no one but you. Not us, not your ISP, not a hacker, and not a government agency. As long as
conflicts, which may result in the duplication of notes. you keep your password safe, and your password is reasonably strong, then you are the only person in the
</Text> world with the ability to decrypt your notes. For more on how we handle your privacy and security, check out
</PreferencesSegment> our easy to read{' '}
<HorizontalSeparator classes="my-4" /> <a
<PreferencesSegment> target="_blank"
<Subtitle>Can I use Standard Notes totally offline?</Subtitle> className="underline hover:no-underline"
<Text> href="https://standardnotes.com/privacy"
Standard Notes can be used totally offline without an account, and without an internet connection. You can onClick={handleClick}
find{' '} >
<a target="_blank" href="https://standardnotes.com/help/59/can-i-use-standard-notes-totally-offline"> Privacy Manifesto.
more details here. </a>
</a> </Text>
</Text> </PreferencesSegment>
</PreferencesSegment> <HorizontalSeparator classes="my-4" />
<HorizontalSeparator classes="my-4" /> <PreferencesSegment>
<PreferencesSegment> <Subtitle>Can I collaborate with others on a note?</Subtitle>
<Subtitle>Cant find your question here?</Subtitle> <Text>
<LinkButton className="mt-3" label="Open FAQ" link="https://standardnotes.com/help" /> Because of our encrypted architecture, Standard Notes does not currently provide a real-time collaboration
</PreferencesSegment> solution. Multiple users can share the same account however, but editing at the same time may result in sync
</PreferencesGroup> conflicts, which may result in the duplication of notes.
<PreferencesGroup> </Text>
<PreferencesSegment> </PreferencesSegment>
<Title>Community forum</Title> <HorizontalSeparator classes="my-4" />
<Text> <PreferencesSegment>
If you have an issue, found a bug or want to suggest a feature, you can browse or post to the forum. Its <Subtitle>Can I use Standard Notes totally offline?</Subtitle>
recommended for non-account related issues. Please read our{' '} <Text>
<a target="_blank" href="https://standardnotes.com/longevity/"> Standard Notes can be used totally offline without an account, and without an internet connection. You can
Longevity statement find{' '}
</a>{' '} <a
before advocating for a feature request. target="_blank"
</Text> className="underline hover:no-underline"
<LinkButton className="mt-3" label="Go to the forum" link="https://forum.standardnotes.org/" /> href="https://standardnotes.com/help/59/can-i-use-standard-notes-totally-offline"
</PreferencesSegment> onClick={handleClick}
</PreferencesGroup> >
<PreferencesGroup> more details here.
<PreferencesSegment> </a>
<Title>Community groups</Title> </Text>
<Text> </PreferencesSegment>
Want to meet other passionate note-takers and privacy enthusiasts? Want to share your feedback with us? Join <HorizontalSeparator classes="my-4" />
the Standard Notes community groups for discussions on security, themes, editors and more. <PreferencesSegment>
</Text> <Subtitle>Cant find your question here?</Subtitle>
<LinkButton className="mt-3" link="https://standardnotes.com/slack" label="Join our Slack" /> <LinkButton className="mt-3" label="Open FAQ" link="https://standardnotes.com/help" onClick={handleClick} />
<LinkButton className="mt-3" link="https://standardnotes.com/discord" label="Join our Discord" /> </PreferencesSegment>
</PreferencesSegment> </PreferencesGroup>
</PreferencesGroup> <PreferencesGroup>
<PreferencesGroup> <PreferencesSegment>
<PreferencesSegment> <Title>Community forum</Title>
<Title>Account related issue?</Title> <Text>
<Text>Send an email to help@standardnotes.com and well sort it out.</Text> If you have an issue, found a bug or want to suggest a feature, you can browse or post to the forum. Its
<LinkButton className="mt-3" link="mailto: help@standardnotes.com" label="Email us" /> recommended for non-account related issues. Please read our{' '}
</PreferencesSegment> <a target="_blank" className="underline hover:no-underline" href="https://standardnotes.com/longevity/">
</PreferencesGroup> Longevity statement
</PreferencesPane> </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 well sort it out.</Text>
<LinkButton className="mt-3" link="mailto: help@standardnotes.com" label="Email us" onClick={handleClick} />
</PreferencesSegment>
</PreferencesGroup>
</PreferencesPane>
)
}
export default HelpAndFeedback export default HelpAndFeedback

View File

@@ -1,5 +1,5 @@
import { classNames } from '@/Utils/ConcatenateClassNames' import { classNames } from '@/Utils/ConcatenateClassNames'
import { FunctionComponent, ReactNode } from 'react' import { FunctionComponent, MouseEventHandler, ReactNode } from 'react'
type Props = { type Props = {
className?: string className?: string
@@ -31,8 +31,9 @@ export const LinkButton: FunctionComponent<{
label: string label: string
link: string link: string
className?: string className?: string
}> = ({ label, link, className }) => ( onClick?: MouseEventHandler<HTMLAnchorElement>
<a target="_blank" className={`${className} ${buttonClasses}`} href={link}> }> = ({ label, link, className, onClick }) => (
<a target="_blank" className={`${className} ${buttonClasses}`} href={link} onClick={onClick}>
{label} {label}
</a> </a>
) )