Skip to content

Commit 9700acf

Browse files
committed
fix: background + secu
1 parent 694822c commit 9700acf

File tree

3 files changed

+16
-15
lines changed

3 files changed

+16
-15
lines changed

App.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,12 @@ import {LogBox} from 'react-native';
1414
LogBox.ignoreAllLogs();
1515

1616
const NavigationTheme = {
17-
...DefaultTheme,
17+
dark: true,
1818
colors: {
1919
...DefaultTheme.colors,
2020
card: theme.colors.background,
2121
text: theme.colors.text,
22+
background: theme.colors.background,
2223
},
2324
};
2425

src/components/Medocomponent.tsx

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import {Button} from 'native-base';
1212
import {TextMl} from './Textml';
1313
import {InAppBrowser} from 'react-native-inappbrowser-reborn';
1414
import {theme} from '../theme';
15+
import {Config} from '../config';
1516

1617
type Props = {
1718
generalData: any;
@@ -77,10 +78,7 @@ export function Medocomponent(props: Props) {
7778
<Button
7879
style={styles.button}
7980
onPress={() => {
80-
onPress(
81-
'http://m.base-donnees-publique.medicaments.gouv.fr/#!info-' +
82-
item.cis,
83-
);
81+
onPress(Config.baseUrl.informations(item.cis));
8482
}}>
8583
<Text style={styles.textButton}>Informations</Text>
8684
</Button>
@@ -92,22 +90,14 @@ export function Medocomponent(props: Props) {
9290
},
9391
])}
9492
onPress={() => {
95-
onPress(
96-
'http://m.base-donnees-publique.medicaments.gouv.fr/#!rcp-' +
97-
item.cis +
98-
'-0',
99-
);
93+
onPress(Config.baseUrl.characteristics(item.cis));
10094
}}>
10195
<Text style={styles.textButton}>Caractéristiques</Text>
10296
</Button>
10397
<Button
10498
style={styles.button}
10599
onPress={() => {
106-
onPress(
107-
'http://m.base-donnees-publique.medicaments.gouv.fr/#!notice-' +
108-
item.cis +
109-
'-0',
110-
);
100+
onPress(Config.baseUrl.notice(item.cis));
111101
}}>
112102
<Text style={styles.textButton}>Notice</Text>
113103
</Button>

src/config/index.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,16 @@ export enum StorageKey {
1616
}
1717

1818
export const Config = {
19+
baseUrl: {
20+
informations: (v: string) =>
21+
'https://m.base-donnees-publique.medicaments.gouv.fr/#!info-' + v,
22+
characteristics: (v: string) =>
23+
'https://m.base-donnees-publique.medicaments.gouv.fr/#!rcp-' + v + '-0',
24+
notice: (v: string) =>
25+
'https://m.base-donnees-publique.medicaments.gouv.fr/#!notice-' +
26+
v +
27+
'-0',
28+
},
1929
downloadUrl: [
2030
{
2131
url: 'https://base-donnees-publique.medicaments.gouv.fr/telechargement.php?fichier=CIS_bdpm.txt',

0 commit comments

Comments
 (0)