feat(links): add appui soutien
This commit is contained in:
parent
5e67e81f0a
commit
43bc7f6f63
4 changed files with 27 additions and 3 deletions
BIN
src/assets/img/links/logo-appui-soutien.png
Normal file
BIN
src/assets/img/links/logo-appui-soutien.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 7.4 KiB |
|
|
@ -4,11 +4,12 @@ import { TouchableRipple } from "react-native-paper";
|
|||
import { createStyles } from "~/theme";
|
||||
import Text from "~/components/Text";
|
||||
|
||||
export default function AppButton({
|
||||
export default function WebButton({
|
||||
logo,
|
||||
label,
|
||||
description,
|
||||
url,
|
||||
tel,
|
||||
style,
|
||||
buttonStyle,
|
||||
labelTextStyle,
|
||||
|
|
@ -17,8 +18,17 @@ export default function AppButton({
|
|||
const styles = useStyles();
|
||||
|
||||
const openPress = useCallback(async () => {
|
||||
Linking.openURL(url);
|
||||
}, [url]);
|
||||
if (tel) {
|
||||
const cleanTel = tel.replace(/\s+/g, "");
|
||||
const target = cleanTel.startsWith("tel:") ? cleanTel : `tel:${cleanTel}`;
|
||||
await Linking.openURL(target);
|
||||
return;
|
||||
}
|
||||
|
||||
if (url) {
|
||||
await Linking.openURL(url);
|
||||
}
|
||||
}, [tel, url]);
|
||||
|
||||
return (
|
||||
<View style={[styles.container, style]}>
|
||||
|
|
|
|||
12
src/containers/Links/WebLinks/AppuiSoutien.js
Normal file
12
src/containers/Links/WebLinks/AppuiSoutien.js
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
import WebButton from "~/components/Links/WebButton";
|
||||
|
||||
export default function WebLinkAppuiSoutien() {
|
||||
return (
|
||||
<WebButton
|
||||
logo={require("~/assets/img/links/logo-appui-soutien.png")}
|
||||
label="Appui Soutien – Montjean (16)"
|
||||
description="Véhicule d’appui bénévole pour les petites communes dans un rayon d’environ 30 km autour de Montjean (16240) : renfort aux secours, dégagement de la voie publique, soutien logistique et aux sinistrés. Astreinte : 06 84 38 16 31."
|
||||
tel="+33684381631"
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
|
@ -28,6 +28,7 @@ import WebLinkEmerga from "~/containers/Links/WebLinks/Emerga";
|
|||
import WebLinkDeltaPlane from "~/containers/Links/WebLinks/DeltaPlane";
|
||||
import WebLinkDroguesInfoService from "~/containers/Links/WebLinks/DroguesInfoService";
|
||||
import WebLinkIJP from "~/containers/Links/WebLinks/IJP";
|
||||
import WebLinkAppuiSoutien from "~/containers/Links/WebLinks/AppuiSoutien";
|
||||
|
||||
export default function Links() {
|
||||
const styles = useStyles();
|
||||
|
|
@ -56,6 +57,7 @@ export default function Links() {
|
|||
<WebLinkIJP />
|
||||
<WebLinkDroguesInfoService />
|
||||
<WebLinkDeltaPlane />
|
||||
<WebLinkAppuiSoutien />
|
||||
</View>
|
||||
<Title style={styles.title}>S'engager</Title>
|
||||
<View style={styles.section}>
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue