Fix margin at bottom for Subjects, HomeScreen.

This commit is contained in:
Ceda EI 2020-03-21 13:34:18 +05:30
parent 0feabb5599
commit edba7c9458
2 changed files with 14 additions and 5 deletions

View File

@ -36,7 +36,7 @@ function Subjects({ theme, subjects, addSubject, removeSubject }) {
style={ style={
[ [
style.card, style.card,
{marginBottom: idx === subjects.length - 1 ? 12 : 0 } {marginBottom: idx === subjects.length - 1 ? 80 : 0 }
] ]
} }
> >

View File

@ -10,13 +10,22 @@ import {
import { import {
View, View,
StyleSheet StyleSheet,
ScrollView
} from "react-native"; } from "react-native";
function HomeScreen({ theme, timetable, subjects, navigation, days }) { function HomeScreen({ theme, timetable, subjects, navigation, days }) {
return (<> return (<ScrollView>
{timetable.map((day, dayIdx) => ( {timetable.map((day, dayIdx) => (
<Card key={dayIdx} style={style.card}> <Card
key={dayIdx}
style={
[
style.card,
{marginBottom: dayIdx === 6 ? 80 : 0 }
]
}
>
<Card.Title title={days[dayIdx]} /> <Card.Title title={days[dayIdx]} />
<Card.Content> <Card.Content>
{day.map((cls, idx) => { {day.map((cls, idx) => {
@ -37,7 +46,7 @@ function HomeScreen({ theme, timetable, subjects, navigation, days }) {
</Card.Actions> </Card.Actions>
</Card> </Card>
))} ))}
</>); </ScrollView>);
} }
HomeScreen.propTypes = { HomeScreen.propTypes = {