Hyperlink activation

This commit is contained in:
emelko
2019-01-30 17:44:43 +01:00
parent b3a2713daf
commit ce3a81ad5f
2 changed files with 10 additions and 4 deletions
@@ -1,8 +1,11 @@
import React, { Component } from 'react' import React, { Component } from 'react'
import { ScrollView } from 'react-native' import { ScrollView } from 'react-native'
import Hyperlink from 'react-native-hyperlink'
import AppText from '../../app-text' import AppText from '../../app-text'
import * as labels from '../../../i18n/en/symptom-info.js' import labels from '../../../i18n/en/symptom-info.js'
import SettingsSegment from '../../settings/shared/settings-segment' import SettingsSegment from '../../settings/shared/settings-segment'
import styles from '../../../styles/index'
import replace from '../../helpers/replace-url-with-text'
export default class InfoSymptom extends Component { export default class InfoSymptom extends Component {
render() { render() {
@@ -11,6 +14,7 @@ export default class InfoSymptom extends Component {
BleedingEditView: 'bleeding', BleedingEditView: 'bleeding',
CervixEditView: 'cervix', CervixEditView: 'cervix',
DesireEditView: 'desire', DesireEditView: 'desire',
MoodEditView: 'mood',
MucusEditView: 'mucus', MucusEditView: 'mucus',
NoteEditView: 'note', NoteEditView: 'note',
PainEditView: 'pain', PainEditView: 'pain',
@@ -21,8 +25,10 @@ export default class InfoSymptom extends Component {
return ( return (
<ScrollView> <ScrollView>
<SettingsSegment title={labels.symptomTitle[currentSymptom]}> <SettingsSegment title={labels[currentSymptom].title}>
<AppText>{labels.symptomInfo[currentSymptom]}</AppText> <Hyperlink linkStyle={styles.link} linkText={replace} linkDefault>
<AppText>{labels[currentSymptom].text}</AppText>
</Hyperlink>
</SettingsSegment> </SettingsSegment>
</ScrollView> </ScrollView>
) )
+1 -1
View File
@@ -9,7 +9,7 @@ export const links = {
text: 'email' text: 'email'
}, },
wiki: { wiki: {
url: 'https://gitlab.com/bloodyhealth/drip/wikis/home', url: 'https://gitlab.com/bloodyhealth/drip/wikis/',
text: 'wiki' text: 'wiki'
}, },
website: { website: {