Commit 24444ce9 authored by Florent Chehab's avatar Florent Chehab
Browse files

Perf +

parent 488ad34a
...@@ -25,8 +25,12 @@ import ScholarshipsTab from './tabs/ScholarshipsTab'; ...@@ -25,8 +25,12 @@ import ScholarshipsTab from './tabs/ScholarshipsTab';
import MoreTab from './tabs/MoreTab'; import MoreTab from './tabs/MoreTab';
function TabContainer(props) { function TabContainer(props) {
let style = { padding: 8 * 3 };
if (!props.display) {
style = { display: 'none' }
}
return ( return (
<Typography component="div" style={{ padding: 8 * 3 }}> <Typography component="div" style={style}>
{props.children} {props.children}
</Typography> </Typography>
); );
...@@ -87,7 +91,7 @@ class UniversityTemplate extends React.Component { ...@@ -87,7 +91,7 @@ class UniversityTemplate extends React.Component {
<Tab label="Autres" icon={<MoreHorizIcon />} /> <Tab label="Autres" icon={<MoreHorizIcon />} />
</Tabs> </Tabs>
</AppBar> </AppBar>
{value === 0 && <TabContainer> <GeneralInfoTab univId={univId} /> </TabContainer>} <TabContainer display={value === 0}> <GeneralInfoTab univId={univId} visible={value === 0}/> </TabContainer>
{/* {value === 1 && <TabContainer> <UniversityMoreTab univId={univId} /> </TabContainer>} */} {/* {value === 1 && <TabContainer> <UniversityMoreTab univId={univId} /> </TabContainer>} */}
{/* {value === 2 && <TabContainer> <PreviousDeparturesTab univId={univId} /> </TabContainer>} */} {/* {value === 2 && <TabContainer> <PreviousDeparturesTab univId={univId} /> </TabContainer>} */}
{/* {value === 3 && <TabContainer> <ScholarshipsTab univId={univId} /> </TabContainer>} */} {/* {value === 3 && <TabContainer> <ScholarshipsTab univId={univId} /> </TabContainer>} */}
......
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