Skip to content

Commit

Permalink
Add Feedback Links in Error Page, Settings, and Home Page Card
Browse files Browse the repository at this point in the history
  • Loading branch information
consindo committed Jan 6, 2020
1 parent 88da4f4 commit aa9aa3e
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 26 deletions.
1 change: 0 additions & 1 deletion js/stores/UiStore.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { createBrowserHistory } from 'history'

import Events from './Events'
import { iOS } from '../helpers/ios.js'

class UIStore extends Events {
constructor(props) {
Expand Down
16 changes: 13 additions & 3 deletions js/views/pages/Settings.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { Text, View, StyleSheet, TouchableOpacity } from 'react-native'

import { paragraphStyles, vars } from '../../styles.js'
import { t } from '../../stores/translationStore.js'
import UiStore from '../../stores/UiStore.js'

import Header from '../reusable/Header.jsx'
import LinkedScroll from '../reusable/LinkedScroll.jsx'
Expand All @@ -11,6 +12,7 @@ import Toggle from '../reusable/Toggle.jsx'
import ClockIcon from '../../../dist/icons/clock.svg'
import LongnamesIcon from '../../../dist/icons/longnames.svg'
import FeedbackIcon from '../../../dist/icons/feedback.svg'
import SponsorIcon from '../../../dist/icons/patron.svg'
import CreditsIcon from '../../../dist/icons/credits.svg'

let styles
Expand Down Expand Up @@ -56,7 +58,7 @@ const Settings = () => {
{ fontSize: vars.smallFontSize, marginTop: 0 },
]}
>
Build {process.env.VERSION}-{process.env.BRANCH}
Build {process.env.VERSION}
</Text>
<Text style={paragraphStyles.p}>
{t('settings.license')} {t('settings.contributions')}
Expand Down Expand Up @@ -85,13 +87,21 @@ const Settings = () => {
<TouchableOpacity>
<View
style={styles.button}
accessibilityRole="link"
href="https://twitter.com/dymajoltd"
onClick={() => UiStore.safePush('/feedback')}
>
<FeedbackIcon />
<Text style={styles.buttonText}>{t('settings.more.feedback')}</Text>
</View>
</TouchableOpacity>
<TouchableOpacity>
<View
style={styles.button}
onClick={() => UiStore.safePush('/sponsor')}
>
<SponsorIcon />
<Text style={styles.buttonText}>{t('settings.more.sponsor')}</Text>
</View>
</TouchableOpacity>
{credits ? (
<View>
<Text style={paragraphStyles.p}>
Expand Down
20 changes: 4 additions & 16 deletions js/views/root/Content.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -117,11 +117,11 @@ class RootContent extends React.Component {
description={t('onboarding.city.description')}
/>,
<Sidebar
key="sponsor"
url="/sponsor"
key="feedback"
url="/feedback"
icon="patron.svg"
name={t('onboarding.sponsor.name')}
description={t('onboarding.sponsor.description')}
name={t('onboarding.feedback.name')}
description={t('onboarding.feedback.description')}
/>,
]
if (!desktopLayout) {
Expand Down Expand Up @@ -150,18 +150,6 @@ class RootContent extends React.Component {
Aotearoa, and provide improved access for Māori communities.
</p>
<p>Kia Ora.</p>
<h3>What’s new in the latest version?</h3>
<p>
Version 2.3 is exciting. There’s now a new interface which gives you
access to the map at all times. We’ve also fixed a lot of bugs,
especially on iOS. Lastly, we’ve improved the lines view, allowing you
to see all the stops at once.
</p>
<p>
We’re all ready for the central new network in Auckland and Wellington
too.
</p>
<p>We hope you enjoy Waka 2.3!</p>
</div>
)
const onboarding = (
Expand Down
10 changes: 8 additions & 2 deletions js/views/shell/ErrorBoundary.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,17 @@ export class ErrorBoundary extends Component {
<Header title="Error!" hideClose />
<View style={styles.error}>
<Text style={styles.errorMessage}>
There was an unexpected error. You can either try reload this
page, or return home.
There was an unexpected error. You can send feedback, try reload
this page, or return home.
</Text>
<LinkButton
href={`/feedback?type=error-report&url=${window.location.toString()}`}
label="Send Feedback"
target="_self"
/>
<LinkButton
href={window.location.toString()}
color="secondary"
target="_self"
label="Reload Page"
/>
Expand Down
9 changes: 5 additions & 4 deletions translations/en.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ export default {
name: 'Switch City',
description: 'Get directions in another city',
},
sponsor: {
name: 'Become a Sponsor',
description: 'Contribute to help support development!',
feedback: {
name: 'Give Feedback',
description: 'Let us know how we can improve Waka!',
},
settings: {
name: 'Settings',
Expand Down Expand Up @@ -84,6 +84,7 @@ export default {
more: {
title: 'More',
feedback: 'Send Feedback',
sponsor: 'Support Waka',
credits: 'View Credits',
},
},
Expand Down Expand Up @@ -146,7 +147,7 @@ export default {
services: 'View Services',
},
feedback: {
header: 'Send Feedback',
header: 'Give Feedback',
generalFeedback:
'We would love to hear any feedback so we can improve Waka for you!',
errorReport:
Expand Down

0 comments on commit aa9aa3e

Please sign in to comment.