-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: initial navigation and send feedback tested
- Loading branch information
1 parent
dcf44ba
commit 445b2d3
Showing
9 changed files
with
265 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
domains/Settings/SupportHome/SupportSettings/AboutUs/index.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import React, { useState } from 'react'; | ||
import { | ||
View | ||
} from 'react-native'; | ||
import { | ||
Button, Headline, IconButton, Text | ||
} from 'react-native-paper'; | ||
|
||
import styles from '../../../index.styles'; | ||
|
||
const AboutUs = ({ | ||
settingsView, setSettingsView, supportView, setSupportView | ||
}) => ( | ||
<View> | ||
<Text>About us</Text> | ||
</View> | ||
); | ||
|
||
export default AboutUs; |
44 changes: 44 additions & 0 deletions
44
domains/Settings/SupportHome/SupportSettings/Feedback/index.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
import React, { useState } from 'react'; | ||
import { | ||
View | ||
} from 'react-native'; | ||
import { | ||
Button, Headline, Text, TextInput | ||
} from 'react-native-paper'; | ||
|
||
import email from 'react-native-email' | ||
|
||
import styles from '../../../index.styles'; | ||
|
||
const Feedback = () => { | ||
const handleEmail = () => { | ||
const to = ['info@puente-dr.org'] // string or array of email addresses | ||
email(to, { | ||
// Optional additional arguments | ||
cc: [], // string or array of email addresses | ||
bcc: [], // string or array of email addresses | ||
subject: 'User Feedback', | ||
body: emailBody | ||
}).catch(console.error) | ||
} | ||
|
||
const [emailBody, setEmailBody] = useState(''); | ||
|
||
return ( | ||
<View style={styles.mainContainer}> | ||
<Headline>Feedback</Headline> | ||
<View style={styles.horizontalLinePrimary} /> | ||
<Text>Please enter your feedback in the input below and press the "Send Feedback" button. This will redirect you to your email where you can send your feedback.</Text> | ||
<View style={styles.horizontalLinePrimary} /> | ||
<TextInput multiline={true} onChangeText={(text) => setEmailBody(text)} | ||
placeholder={"Type your feedback here..."}> | ||
|
||
</TextInput> | ||
<View style={styles.languageContainer}> | ||
<Button mode="contained" onPress={() => handleEmail()}>Send Mail</Button> | ||
</View> | ||
</View> | ||
) | ||
}; | ||
|
||
export default Feedback; |
20 changes: 20 additions & 0 deletions
20
domains/Settings/SupportHome/SupportSettings/RateOurApp/index.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import React, { useState } from 'react'; | ||
import { | ||
View | ||
} from 'react-native'; | ||
import { | ||
Button, Headline, IconButton, Text | ||
} from 'react-native-paper'; | ||
|
||
import styles from '../../../index.styles'; | ||
|
||
const RateOurApp = ({ | ||
settingsView, setSettingsView, supportView, setSupportView | ||
}) => ( | ||
<View style={styles.mainContainer}> | ||
<Text>Rate our app</Text> | ||
|
||
</View> | ||
); | ||
|
||
export default RateOurApp; |
19 changes: 19 additions & 0 deletions
19
domains/Settings/SupportHome/SupportSettings/WhatsNew/index.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import React, { useState } from 'react'; | ||
import { | ||
View | ||
} from 'react-native'; | ||
import { | ||
Button, Headline, IconButton, Text | ||
} from 'react-native-paper'; | ||
|
||
import styles from '../../../index.styles'; | ||
|
||
const WhatsNew = ({ | ||
settingsView, setSettingsView, supportView, setSupportView | ||
}) => ( | ||
<View style={styles.mainContainer}> | ||
<Text>Whats new</Text> | ||
</View> | ||
); | ||
|
||
export default WhatsNew; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
import React, { useState } from 'react'; | ||
import { | ||
View | ||
} from 'react-native'; | ||
import { | ||
Button, Headline, IconButton, Text | ||
} from 'react-native-paper'; | ||
|
||
import AboutUs from './AboutUs'; | ||
import Feedback from './Feedback'; | ||
import RateOurApp from './RateOurApp'; | ||
import WhatsNew from './WhatsNew'; | ||
|
||
import styles from '../../index.styles'; | ||
|
||
const SupportSettings = ({ | ||
settingsView, setSettingsView, supportView, setSupportView | ||
}) => ( | ||
<View style={styles.mainContainer}> | ||
{supportView === 'aboutUs' && ( | ||
<AboutUs | ||
/> | ||
)} | ||
{supportView === 'feedback' && ( | ||
<Feedback /> | ||
)} | ||
{supportView === 'rateApp' && ( | ||
<RateOurApp /> | ||
)} | ||
{supportView === 'whatsNew' && ( | ||
<WhatsNew /> | ||
)} | ||
<Button onPress={() => { | ||
setSupportView(''); | ||
}} | ||
>Back</Button> | ||
|
||
</View> | ||
); | ||
|
||
export default SupportSettings; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,102 @@ | ||
import React, { useState } from 'react'; | ||
import { | ||
View | ||
} from 'react-native'; | ||
import { | ||
Button, Headline, IconButton, Text | ||
} from 'react-native-paper'; | ||
|
||
import SupportSettings from './SupportSettings'; | ||
import I18n from '../../../modules/i18n'; | ||
import { theme } from '../../../modules/theme'; | ||
|
||
import styles from '../index.styles' | ||
|
||
const SupportHome = ({ | ||
setView, prevView, logOut, settingsView, setSettingsView | ||
}) => { | ||
const [supportView, setSupportView] = useState(''); | ||
|
||
const inputs = [ | ||
{ | ||
key: 'whatsNew', | ||
label: 'What\'s New?', | ||
button: true | ||
}, | ||
{ | ||
key: 'aboutUs', | ||
label: 'About us', | ||
button: true | ||
}, | ||
{ | ||
key: 'feedback', | ||
label: 'Contact us / Feedback?', | ||
button: true | ||
}, | ||
{ | ||
key: 'rateApp', | ||
label: 'Rate our app', | ||
button: false | ||
} | ||
]; | ||
return ( | ||
<View> | ||
{settingsView === 'Support' && supportView === '' && ( | ||
<View> | ||
<View style={{ flexDirection: 'row', marginLeft: 'auto', marginRight: 'auto' }}> | ||
<View style={{ paddingRight: '5%' }}> | ||
<Button onPress={() => setSettingsView('Settings')}>{I18n.t('accountSettings.settings')}</Button> | ||
</View> | ||
<View style={{ paddingLeft: '5%' }}> | ||
<Button mode="contained"> | ||
{I18n.t('accountSettings.support')} | ||
</Button> | ||
</View> | ||
</View> | ||
<View style={{ paddingLeft: '5%', paddingRight: '5%', paddingTop: 20 }}> | ||
<Headline style={{ fontWeight: 'bold' }}>Help Center</Headline> | ||
<View style={styles.horizontalLineGray} /> | ||
{inputs.length > 0 && inputs.map((input) => ( | ||
<View> | ||
<View style={{ flexDirection: 'row' }}> | ||
<Text style={styles.text}>{input.label}</Text> | ||
{input.button && ( | ||
<IconButton | ||
icon="chevron-right" | ||
size={30} | ||
color={theme.colors.primary} | ||
style={{ marginLeft: 'auto', marginTop: -5, marginBottom: -10 }} | ||
onPress={() => { | ||
setSupportView(input.key); | ||
}} | ||
/> | ||
)} | ||
</View> | ||
<View style={styles.horizontalLineGray} /> | ||
</View> | ||
))} | ||
</View> | ||
<Button onPress={() => { | ||
setView(prevView); | ||
}} | ||
> | ||
{I18n.t('accountSettings.back')} | ||
</Button> | ||
<Button mode="contained" onPress={logOut} style={{ marginTop: 20, marginLeft: '5%', marginRight: '5%' }}>{I18n.t('accountSettings.logout')}</Button> | ||
</View> | ||
)} | ||
{supportView !== '' && ( | ||
<View> | ||
<SupportSettings | ||
settingsView={settingsView} | ||
setSettingsView={setSettingsView} | ||
supportView={supportView} | ||
setSupportView={setSupportView} | ||
/> | ||
</View> | ||
)} | ||
</View> | ||
); | ||
}; | ||
|
||
export default SupportHome; |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters