Improve linking and link more things
This commit is contained in:
@@ -0,0 +1,6 @@
|
||||
import {links} from '../../i18n/en/settings'
|
||||
|
||||
export default function(url) {
|
||||
const link = Object.values(links).find(link => link.url === url)
|
||||
return link ? link.text : url
|
||||
}
|
||||
@@ -1,13 +0,0 @@
|
||||
import React from 'react'
|
||||
import { Linking } from 'react-native'
|
||||
import AppText from "./app-text"
|
||||
import styles from '../styles';
|
||||
|
||||
export default function Link(props) {
|
||||
return (
|
||||
<AppText
|
||||
style={styles.link}
|
||||
onPress={() => Linking.openURL(props.href)}
|
||||
>{props.text}</AppText>
|
||||
)
|
||||
}
|
||||
@@ -1,16 +1,20 @@
|
||||
import React, { Component } from 'react'
|
||||
import { ScrollView } from 'react-native'
|
||||
import Hyperlink from 'react-native-hyperlink'
|
||||
import AppText from '../app-text'
|
||||
import SettingsSegment from './settings-segment'
|
||||
import styles from '../../styles/index'
|
||||
import labels from '../../i18n/en/settings'
|
||||
import replace from '../helpers/replace-url-with-text'
|
||||
|
||||
export default class AboutSection extends Component {
|
||||
render() {
|
||||
return (
|
||||
<ScrollView>
|
||||
<SettingsSegment title={`${labels.aboutSection.title} `}>
|
||||
<AppText>{`${labels.aboutSection.segmentExplainer} `}</AppText>
|
||||
<Hyperlink linkStyle={styles.link} linkText={replace}>
|
||||
<AppText>{`${labels.aboutSection.segmentExplainer} `}</AppText>
|
||||
</Hyperlink>
|
||||
</SettingsSegment>
|
||||
<SettingsSegment title={`${labels.credits.title} `} style={styles.settingsSegmentLast}>
|
||||
<AppText>{`${labels.credits.note}`}</AppText>
|
||||
|
||||
@@ -2,13 +2,14 @@ import React, { Component } from 'react'
|
||||
import {
|
||||
ScrollView, View
|
||||
} from 'react-native'
|
||||
import Hyperlink from 'react-native-hyperlink'
|
||||
import styles, { iconStyles } from '../../../styles'
|
||||
import labels from '../../../i18n/en/settings'
|
||||
import AppText from '../../app-text'
|
||||
import TempSlider from './temp-slider'
|
||||
import UseCervixSetting from './use-cervix'
|
||||
import Icon from 'react-native-vector-icons/Entypo'
|
||||
import Link from '../../link'
|
||||
import replaceUrlWithText from '../../helpers/replace-url-with-text'
|
||||
|
||||
export default class Settings extends Component {
|
||||
constructor(props) {
|
||||
@@ -32,11 +33,9 @@ export default class Settings extends Component {
|
||||
<Icon name="info-with-circle" style={iconStyles.infoInHeading}/>
|
||||
<AppText style={styles.settingsSegmentTitle}>{`${labels.preOvu.title} `}</AppText>
|
||||
</View>
|
||||
<AppText>
|
||||
{labels.preOvu.note1}
|
||||
<Link text={labels.preOvu.link} href="https://gitlab.com/bloodyhealth/drip/wikis/home" />
|
||||
{labels.preOvu.note2}
|
||||
</AppText>
|
||||
<Hyperlink linkStyle={styles.link} linkText={replaceUrlWithText}>
|
||||
<AppText>{labels.preOvu.note}</AppText>
|
||||
</Hyperlink>
|
||||
</View>
|
||||
</ScrollView>
|
||||
)
|
||||
|
||||
+18
-5
@@ -1,4 +1,19 @@
|
||||
|
||||
export const links = {
|
||||
gitlab: {
|
||||
url: 'https://gitlab.com/bloodyhealth/drip',
|
||||
text: 'GitLab'
|
||||
},
|
||||
email: {
|
||||
url: 'mailto:bl00dyhealth@mailbox.org',
|
||||
text: 'email'
|
||||
},
|
||||
wiki: {
|
||||
url: 'https://gitlab.com/bloodyhealth/drip/wikis/home',
|
||||
text: 'wiki'
|
||||
}
|
||||
}
|
||||
|
||||
export default {
|
||||
menuTitles: {
|
||||
reminders: 'Reminders',
|
||||
@@ -93,16 +108,14 @@ export default {
|
||||
},
|
||||
aboutSection: {
|
||||
title: 'About',
|
||||
segmentExplainer: 'Please note that your data is stored locally on your phone and not on a server. We want to ensure that you stay in control of those sensitive information. If you are planning to switch or reset your phone, please remember to export your data before doing so. You can reinstall the app afterwards and import your data.\n\nIf you encounter any technical issues, don\'t hesitate to contact us via email (bl00dyhealth@mailbox.org). You can also contribute to the code base on GitLab (https://gitlab.com/bloodyhealth/drip/).',
|
||||
segmentExplainer: `Please note that your data is stored locally on your phone and not on a server. We want to ensure that you stay in control of your own data. If you are planning to switch or reset your phone, please remember to export your data before doing so. You can reinstall the app afterwards and import your data.\n\nIf you encounter any technical issues, don't hesitate to contact via ${links.email.url}. You can also contribute to the code base on ${links.gitlab.url}`,
|
||||
},
|
||||
preOvu: {
|
||||
title: 'Infertile days at cycle start',
|
||||
note1: "drip applies NFP's rules for calculating infertile days at the start of the cycle (see the ",
|
||||
link: 'wiki',
|
||||
note2: " for more info). However, drip does not currently apply the so called 20-day-rule, which determines infertile days at the cycle start from past cycle lengths in case no past symptothermal info is available."
|
||||
note: `drip applies NFP's rules for calculating infertile days at the start of the cycle (see the ${links.wiki.url} for more info). However, drip does not currently apply the so called 20-day-rule, which determines infertile days at the cycle start from past cycle lengths in case no past symptothermal info is available.`
|
||||
},
|
||||
credits: {
|
||||
title: 'Credits',
|
||||
note: 'Thanks and lots of <3 to all of our contributors, as well as, and especially, Susanne Umscheid for the wonderful visual and logo design, and Paula Härtel for the symptom icons'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Generated
+41
-14
@@ -806,7 +806,7 @@
|
||||
},
|
||||
"ansi-colors": {
|
||||
"version": "1.1.0",
|
||||
"resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-1.1.0.tgz",
|
||||
"resolved": "http://registry.npmjs.org/ansi-colors/-/ansi-colors-1.1.0.tgz",
|
||||
"integrity": "sha512-SFKX67auSNoVR38N3L+nvsPjOE0bybKTYbkf5tRvushrAPQ9V75huw0ZxBkKVeRU9kqH3d6HA4xTckbwZ4ixmA==",
|
||||
"requires": {
|
||||
"ansi-wrap": "^0.1.0"
|
||||
@@ -3323,7 +3323,7 @@
|
||||
},
|
||||
"event-target-shim": {
|
||||
"version": "1.1.1",
|
||||
"resolved": "https://registry.npmjs.org/event-target-shim/-/event-target-shim-1.1.1.tgz",
|
||||
"resolved": "http://registry.npmjs.org/event-target-shim/-/event-target-shim-1.1.1.tgz",
|
||||
"integrity": "sha1-qG5e5r2qFgVEddp5fM3fDFVphJE="
|
||||
},
|
||||
"eventemitter3": {
|
||||
@@ -3363,7 +3363,7 @@
|
||||
},
|
||||
"expand-range": {
|
||||
"version": "1.8.2",
|
||||
"resolved": "https://registry.npmjs.org/expand-range/-/expand-range-1.8.2.tgz",
|
||||
"resolved": "http://registry.npmjs.org/expand-range/-/expand-range-1.8.2.tgz",
|
||||
"integrity": "sha1-opnv/TNf4nIeuujiV+x5ZE/IUzc=",
|
||||
"requires": {
|
||||
"fill-range": "^2.1.0"
|
||||
@@ -3652,7 +3652,7 @@
|
||||
},
|
||||
"fs-extra": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-1.0.0.tgz",
|
||||
"resolved": "http://registry.npmjs.org/fs-extra/-/fs-extra-1.0.0.tgz",
|
||||
"integrity": "sha1-zTzl9+fLYUWIP8rjGR6Yd/hYeVA=",
|
||||
"requires": {
|
||||
"graceful-fs": "^4.1.2",
|
||||
@@ -4409,7 +4409,7 @@
|
||||
},
|
||||
"http-errors": {
|
||||
"version": "1.6.3",
|
||||
"resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.6.3.tgz",
|
||||
"resolved": "http://registry.npmjs.org/http-errors/-/http-errors-1.6.3.tgz",
|
||||
"integrity": "sha1-i1VoC7S+KDoLW/TqLjhYC+HZMg0=",
|
||||
"requires": {
|
||||
"depd": "~1.1.2",
|
||||
@@ -4950,7 +4950,7 @@
|
||||
},
|
||||
"jsonfile": {
|
||||
"version": "2.4.0",
|
||||
"resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-2.4.0.tgz",
|
||||
"resolved": "http://registry.npmjs.org/jsonfile/-/jsonfile-2.4.0.tgz",
|
||||
"integrity": "sha1-NzaitCi4e72gzIO1P6PWM6NcKug=",
|
||||
"requires": {
|
||||
"graceful-fs": "^4.1.6"
|
||||
@@ -4990,7 +4990,7 @@
|
||||
},
|
||||
"kind-of": {
|
||||
"version": "1.1.0",
|
||||
"resolved": "https://registry.npmjs.org/kind-of/-/kind-of-1.1.0.tgz",
|
||||
"resolved": "http://registry.npmjs.org/kind-of/-/kind-of-1.1.0.tgz",
|
||||
"integrity": "sha1-FAo9LUGjbS78+pN3tiwk+ElaXEQ="
|
||||
},
|
||||
"klaw": {
|
||||
@@ -5024,6 +5024,14 @@
|
||||
"type-check": "~0.3.2"
|
||||
}
|
||||
},
|
||||
"linkify-it": {
|
||||
"version": "1.2.4",
|
||||
"resolved": "http://registry.npmjs.org/linkify-it/-/linkify-it-1.2.4.tgz",
|
||||
"integrity": "sha1-B3NSbDF8j9E71TTuHRgP+Iq/iBo=",
|
||||
"requires": {
|
||||
"uc.micro": "^1.0.1"
|
||||
}
|
||||
},
|
||||
"load-json-file": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-2.0.0.tgz",
|
||||
@@ -5137,6 +5145,11 @@
|
||||
"resolved": "https://registry.npmjs.org/math-random/-/math-random-1.0.1.tgz",
|
||||
"integrity": "sha1-izqsWIuKZuSXXjzepn97sylgH6w="
|
||||
},
|
||||
"mdurl": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/mdurl/-/mdurl-1.0.1.tgz",
|
||||
"integrity": "sha1-/oWy7HWlkDfyrf7BAP1sYBdhFS4="
|
||||
},
|
||||
"mem": {
|
||||
"version": "1.1.0",
|
||||
"resolved": "https://registry.npmjs.org/mem/-/mem-1.1.0.tgz",
|
||||
@@ -5285,12 +5298,12 @@
|
||||
},
|
||||
"mime-db": {
|
||||
"version": "1.23.0",
|
||||
"resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.23.0.tgz",
|
||||
"resolved": "http://registry.npmjs.org/mime-db/-/mime-db-1.23.0.tgz",
|
||||
"integrity": "sha1-oxtAcK2uon1zLqMzdApk0OyaZlk="
|
||||
},
|
||||
"mime-types": {
|
||||
"version": "2.1.11",
|
||||
"resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.11.tgz",
|
||||
"resolved": "http://registry.npmjs.org/mime-types/-/mime-types-2.1.11.tgz",
|
||||
"integrity": "sha1-wlnEcb2oCKhdbNGTtDCl+uRHOzw=",
|
||||
"requires": {
|
||||
"mime-db": "~1.23.0"
|
||||
@@ -6037,7 +6050,7 @@
|
||||
},
|
||||
"opn": {
|
||||
"version": "3.0.3",
|
||||
"resolved": "https://registry.npmjs.org/opn/-/opn-3.0.3.tgz",
|
||||
"resolved": "http://registry.npmjs.org/opn/-/opn-3.0.3.tgz",
|
||||
"integrity": "sha1-ttmec5n3jWXDuq/+8fsojpuFJDo=",
|
||||
"requires": {
|
||||
"object-assign": "^4.0.1"
|
||||
@@ -6309,7 +6322,7 @@
|
||||
},
|
||||
"pretty-format": {
|
||||
"version": "4.3.1",
|
||||
"resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-4.3.1.tgz",
|
||||
"resolved": "http://registry.npmjs.org/pretty-format/-/pretty-format-4.3.1.tgz",
|
||||
"integrity": "sha1-UwvlxCs8BbNkFKeipDN6qArNDo0="
|
||||
},
|
||||
"private": {
|
||||
@@ -6566,6 +6579,15 @@
|
||||
"utf8": "^2.1.1"
|
||||
}
|
||||
},
|
||||
"react-native-hyperlink": {
|
||||
"version": "0.0.14",
|
||||
"resolved": "https://registry.npmjs.org/react-native-hyperlink/-/react-native-hyperlink-0.0.14.tgz",
|
||||
"integrity": "sha1-E4u/5bQQZn0eN/BKK0cTFjqw7YE=",
|
||||
"requires": {
|
||||
"linkify-it": "^1.2.0",
|
||||
"mdurl": "^1.0.0"
|
||||
}
|
||||
},
|
||||
"react-native-modal": {
|
||||
"version": "3.1.0",
|
||||
"resolved": "https://registry.npmjs.org/react-native-modal/-/react-native-modal-3.1.0.tgz",
|
||||
@@ -7122,7 +7144,7 @@
|
||||
},
|
||||
"safe-regex": {
|
||||
"version": "1.1.0",
|
||||
"resolved": "https://registry.npmjs.org/safe-regex/-/safe-regex-1.1.0.tgz",
|
||||
"resolved": "http://registry.npmjs.org/safe-regex/-/safe-regex-1.1.0.tgz",
|
||||
"integrity": "sha1-QKNmnzsHfR6UPURinhV91IAjvy4=",
|
||||
"requires": {
|
||||
"ret": "~0.1.10"
|
||||
@@ -7475,7 +7497,7 @@
|
||||
},
|
||||
"serialize-error": {
|
||||
"version": "2.1.0",
|
||||
"resolved": "https://registry.npmjs.org/serialize-error/-/serialize-error-2.1.0.tgz",
|
||||
"resolved": "http://registry.npmjs.org/serialize-error/-/serialize-error-2.1.0.tgz",
|
||||
"integrity": "sha1-ULZ51WNc34Rme9yOWa9OW4HV9go="
|
||||
},
|
||||
"serve-static": {
|
||||
@@ -8288,6 +8310,11 @@
|
||||
"resolved": "https://registry.npmjs.org/ua-parser-js/-/ua-parser-js-0.7.18.tgz",
|
||||
"integrity": "sha512-LtzwHlVHwFGTptfNSgezHp7WUlwiqb0gA9AALRbKaERfxwJoiX0A73QbTToxteIAuIaFshhgIZfqK8s7clqgnA=="
|
||||
},
|
||||
"uc.micro": {
|
||||
"version": "1.0.5",
|
||||
"resolved": "https://registry.npmjs.org/uc.micro/-/uc.micro-1.0.5.tgz",
|
||||
"integrity": "sha512-JoLI4g5zv5qNyT09f4YAvEZIIV1oOjqnewYg5D38dkQljIzpPT296dbIGvKro3digYI1bkb7W6EP1y4uDlmzLg=="
|
||||
},
|
||||
"uglify-es": {
|
||||
"version": "3.3.9",
|
||||
"resolved": "https://registry.npmjs.org/uglify-es/-/uglify-es-3.3.9.tgz",
|
||||
@@ -8657,7 +8684,7 @@
|
||||
},
|
||||
"xmlbuilder": {
|
||||
"version": "9.0.7",
|
||||
"resolved": "https://registry.npmjs.org/xmlbuilder/-/xmlbuilder-9.0.7.tgz",
|
||||
"resolved": "http://registry.npmjs.org/xmlbuilder/-/xmlbuilder-9.0.7.tgz",
|
||||
"integrity": "sha1-Ey7mPS7FVlxVfiD0wi35rKaGsQ0="
|
||||
},
|
||||
"xmldoc": {
|
||||
|
||||
@@ -33,6 +33,7 @@
|
||||
"react-native-calendars": "^1.19.3",
|
||||
"react-native-document-picker": "^2.1.0",
|
||||
"react-native-fs": "^2.10.14",
|
||||
"react-native-hyperlink": "0.0.14",
|
||||
"react-native-modal-datetime-picker-nevo": "^4.11.0",
|
||||
"react-native-push-notification": "^3.1.1",
|
||||
"react-native-restart": "0.0.7",
|
||||
|
||||
Reference in New Issue
Block a user