separar vistas del guarda e inquilino
This commit is contained in:
parent
b7ee2a20a9
commit
51cdecd388
|
@ -44,6 +44,28 @@ function HomeTab({ route }) {
|
||||||
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function HomeTabGuarda({ route }) {
|
||||||
|
const { user } = useContext(UserContext);
|
||||||
|
const [selected, setSelected] = useState(0);
|
||||||
|
|
||||||
|
return (
|
||||||
|
|
||||||
|
<Tab.Navigator initialParams={user} initialRouteName="Comunicados" >
|
||||||
|
<Tab.Screen name="Comunicados" component={Home} initialParams={user} options={{headerStyle: {
|
||||||
|
backgroundColor: "#D7A86E"
|
||||||
|
}, tabBarIcon: () => (<Icon mb="2" as={<MaterialCommunityIcons name={selected === 0 ? 'home' : 'home-outline'} />} color="#D7A86E" size="md" />)}} onclick={() => setSelected(0)}
|
||||||
|
/>
|
||||||
|
<Tab.Screen name="Invitados" component={Invitados} initialParams={user} options={{headerStyle: {
|
||||||
|
backgroundColor: "#D7A86E"
|
||||||
|
}, tabBarIcon: () => (<Icon mb="2" as={<MaterialCommunityIcons name={selected === 1 ? 'contacts' : 'contacts-outline'} />} color="#D7A86E" size="md" />)} } onclick={() => setSelected(1)} />
|
||||||
|
<Tab.Screen name="Perfil" component={Profile} initialParams={user} options={{headerStyle: {
|
||||||
|
backgroundColor: "#D7A86E"
|
||||||
|
}, tabBarIcon: () => (<Icon mb="2" as={<MaterialCommunityIcons name={selected === 2 ? 'account' : 'account-outline'} />} color="#D7A86E" size="md" />)}} onclick={() => setSelected(2)} />
|
||||||
|
</Tab.Navigator>
|
||||||
|
|
||||||
|
)
|
||||||
|
}
|
||||||
export default function App() {
|
export default function App() {
|
||||||
return (
|
return (
|
||||||
<NativeBaseProvider>
|
<NativeBaseProvider>
|
||||||
|
@ -56,6 +78,7 @@ export default function App() {
|
||||||
}
|
}
|
||||||
}} />
|
}} />
|
||||||
<Stack.Screen name="Comunicados" component={HomeTab} options={{ headerShown: false }} />
|
<Stack.Screen name="Comunicados" component={HomeTab} options={{ headerShown: false }} />
|
||||||
|
<Stack.Screen name="ComunicadosGuarda" component={HomeTabGuarda} options={{ headerShown: false }} />
|
||||||
<Stack.Screen name="Password" component={RecoverPassword} />
|
<Stack.Screen name="Password" component={RecoverPassword} />
|
||||||
<Stack.Screen name="area" component={AreaComun} options={{
|
<Stack.Screen name="area" component={AreaComun} options={{
|
||||||
headerStyle: {
|
headerStyle: {
|
||||||
|
|
|
@ -24,8 +24,8 @@ export default function AreaComun({navigation}){
|
||||||
const [selectedMinutes, setSelectedMinutes] = useState(0);
|
const [selectedMinutes, setSelectedMinutes] = useState(0);
|
||||||
const [endSelectedHours, setEndSelectedHours] = useState(0);
|
const [endSelectedHours, setEndSelectedHours] = useState(0);
|
||||||
const [endSelectedMinutes, setEndSelectedMinutes] = useState(0);
|
const [endSelectedMinutes, setEndSelectedMinutes] = useState(0);
|
||||||
const [time, setTime] = useState(new Date(1598051730000))
|
const [time, setTime] = useState(new Date())
|
||||||
const [endTime, setEndTime] = useState(new Date(1598051730000))
|
const [endTime, setEndTime] = useState(new Date())
|
||||||
const date = new Date();
|
const date = new Date();
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
@ -144,13 +144,13 @@ export default function AreaComun({navigation}){
|
||||||
<FormControl isRequired>
|
<FormControl isRequired>
|
||||||
<FormControl.Label>Hora de inicio</FormControl.Label>
|
<FormControl.Label>Hora de inicio</FormControl.Label>
|
||||||
<View >
|
<View >
|
||||||
<DateTimePicker mode="time" is24Hour={true} value={time} onChangeStart={onChange}/>
|
<DateTimePicker mode="time" is24Hour={true} value={time} onChangeStart={onChangeStart}/>
|
||||||
</View>
|
</View>
|
||||||
</FormControl>
|
</FormControl>
|
||||||
<FormControl isRequired>
|
<FormControl isRequired>
|
||||||
<FormControl.Label>Hora de finalización</FormControl.Label>
|
<FormControl.Label>Hora de finalización</FormControl.Label>
|
||||||
<View >
|
<View >
|
||||||
<DateTimePicker mode="time" is24Hour={true} value={time} onChangeEnd={onChange}/>
|
<DateTimePicker mode="time" is24Hour={true} value={endTime} onChangeEnd={onChangeEnd}/>
|
||||||
</View>
|
</View>
|
||||||
|
|
||||||
</FormControl>
|
</FormControl>
|
||||||
|
|
|
@ -70,6 +70,7 @@ export default function Reservas({navigation}) {
|
||||||
startTime={item.start_time}
|
startTime={item.start_time}
|
||||||
endTime={item.finish_time}
|
endTime={item.finish_time}
|
||||||
status={item.status}
|
status={item.status}
|
||||||
|
name={item.common_area_name}
|
||||||
/>
|
/>
|
||||||
))
|
))
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,7 +11,7 @@ import PropTypes from 'prop-types';
|
||||||
|
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
|
||||||
export const ReservasCard = ({ date, startTime, endTime, status}) => {
|
export const ReservasCard = ({ date, startTime, endTime, status, name}) => {
|
||||||
const dateFormated = format(new Date(date), "dd LL yyyy")
|
const dateFormated = format(new Date(date), "dd LL yyyy")
|
||||||
|
|
||||||
|
|
||||||
|
@ -44,7 +44,7 @@ export const ReservasCard = ({ date, startTime, endTime, status}) => {
|
||||||
<Text bold={true} color='danger.50'> {status == 1 ? 'LIBRE' : 'RESERVADO'}</Text>
|
<Text bold={true} color='danger.50'> {status == 1 ? 'LIBRE' : 'RESERVADO'}</Text>
|
||||||
</Badge>
|
</Badge>
|
||||||
<Heading size="md" ml="-1">
|
<Heading size="md" ml="-1">
|
||||||
Reserva #1
|
{name}
|
||||||
</Heading>
|
</Heading>
|
||||||
<Text fontSize="xs" _light={{
|
<Text fontSize="xs" _light={{
|
||||||
color: "violet.500"
|
color: "violet.500"
|
||||||
|
|
Loading…
Reference in New Issue