Commit 5c465c38 by tungnq

TODO : Test giao diện đơn giản của xem lịch rảnh sinh viên

parent c3bb2ba9
import React from 'react'; import React, { useState } from 'react';
import {Text, View, StyleSheet} from 'react-native'; import {Text, View, StyleSheet} from 'react-native';
import CompensateRegisterView from './view'; import CompensateRegisterView from './view';
const CompensateRegister = (props) => { const CompensateRegister = (props) => {
const [isShow, setShowSchedule] = useState(false);
return ( return (
<CompensateRegisterView /> <CompensateRegisterView
isShow={isShow}
setShowSchedule={setShowSchedule}
/>
); );
}; };
......
...@@ -8,7 +8,22 @@ import Dropdown from '../../../components/DropdownAlert/Dropdown'; ...@@ -8,7 +8,22 @@ import Dropdown from '../../../components/DropdownAlert/Dropdown';
import TextMulti from '../../../components/Input/TextMulti'; import TextMulti from '../../../components/Input/TextMulti';
import Button from '../../../components/Button'; import Button from '../../../components/Button';
const CompensateRegisterView = props => { const CompensateRegisterView = props => {
const {} = props; const {
isShow,
setShowSchedule,
} = props;
const handleToggleSchedule = () => {
setShowSchedule(prevState => !prevState);
};
const renderSchedule = (item) =>{
if (!isShow) return null;
return(
<View>
<Text> hi</Text>
</View>
)
}
return ( return (
<View style={styles.container}> <View style={styles.container}>
<Header title={'Đăng kí báo bù'} isBack /> <Header title={'Đăng kí báo bù'} isBack />
...@@ -94,9 +109,9 @@ const CompensateRegisterView = props => { ...@@ -94,9 +109,9 @@ const CompensateRegisterView = props => {
/> />
<View style={styles.btnRegister}> <View style={styles.btnRegister}>
<Button <Button
title={'Xem lịch rảnh SV'} title={isShow ? 'Đóng' : 'Xem lịch rảnh SV'}
textColor={R.colors.white} textColor={R.colors.white}
onPress={() => {}} onPress={handleToggleSchedule}
backgroundColor={R.colors.blue} backgroundColor={R.colors.blue}
fontSize={R.sizes.sm} fontSize={R.sizes.sm}
fontFamily={R.fonts.fontMedium} fontFamily={R.fonts.fontMedium}
...@@ -105,6 +120,8 @@ const CompensateRegisterView = props => { ...@@ -105,6 +120,8 @@ const CompensateRegisterView = props => {
/> />
</View> </View>
{renderSchedule()}
</View> </View>
</View> </View>
); );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment