Merging branch 'userrole' to implement role management
This commit is contained in:
@@ -8,25 +8,31 @@ import { StyleSheet, View,Text } from 'react-native';
|
||||
import { useChantier } from '../ContextChantier';
|
||||
import Anomaly from '@/components/anomaly';
|
||||
|
||||
import { useUser } from '../ContextUser';
|
||||
|
||||
|
||||
|
||||
export default function Home() {
|
||||
const { chantier, setChantier } = useChantier();
|
||||
|
||||
const { role } = useUser();
|
||||
|
||||
|
||||
return(
|
||||
<ThemedView lvl={3} style={styles.back}>
|
||||
<View style={styles.container}>
|
||||
|
||||
<View style={{width:"100%", position: 'absolute',marginLeft:"50%"}}>
|
||||
<SetStatus></SetStatus>
|
||||
</View>
|
||||
<ChantierSummary style={styles.summary} data={{ chantier }} />
|
||||
<View style={{width:"100%", position: 'absolute'}}>
|
||||
<SelectChantier></SelectChantier>
|
||||
</View>
|
||||
<ChantierSummary style={styles.summary} data={{chantier}}/>
|
||||
<Anomaly style={styles.anomaly} data={{chantier}}/>
|
||||
{role === "chef" && (
|
||||
<View style={{width:"100%", position: 'absolute',marginLeft:"50%"}}>
|
||||
<SetStatus></SetStatus>
|
||||
</View>
|
||||
)}
|
||||
{role === "resp"}
|
||||
|
||||
</View>
|
||||
</ThemedView>
|
||||
)
|
||||
|
||||
@@ -42,12 +42,15 @@ const region = {
|
||||
style={styles.map}
|
||||
region={region}
|
||||
>
|
||||
{chantiers.map(chantier => (
|
||||
<Marker
|
||||
key={chantier.id}
|
||||
coordinate={{ latitude: chantier.latitude, longitude: chantier.longitude }}
|
||||
/>
|
||||
))}
|
||||
{Array.isArray(chantiers) &&
|
||||
chantiers.map(chantier => (
|
||||
<Marker
|
||||
key = {chantier.id}
|
||||
coordinate={{ latitude: chantier.latitude, longitude: chantier.longitude }}
|
||||
title={chantier.adresse}
|
||||
description={chantier.etat}
|
||||
/>
|
||||
))}
|
||||
</ThemedMapView>
|
||||
</View>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user