mirror of https://gitlab.com/ceda_ei/sonzai.git
Add text when no subject is shown.
This commit is contained in:
parent
52360965c2
commit
635dbbf709
|
@ -4,6 +4,7 @@ import {
|
||||||
Button,
|
Button,
|
||||||
Card,
|
Card,
|
||||||
FAB,
|
FAB,
|
||||||
|
Text
|
||||||
} from "react-native-paper";
|
} from "react-native-paper";
|
||||||
|
|
||||||
import {
|
import {
|
||||||
|
@ -20,6 +21,10 @@ export default function Subjects({ subjects, addSubject, removeSubject }) {
|
||||||
}
|
}
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
|
{subjects.length === 0 ?
|
||||||
|
<Text style={style.text}>No Subjects added. Press + to add a subject.</Text>
|
||||||
|
: null
|
||||||
|
}
|
||||||
{subjects.map(subject => (
|
{subjects.map(subject => (
|
||||||
<Card key={subject.id} style={style.card}>
|
<Card key={subject.id} style={style.card}>
|
||||||
<Card.Title title={subject.name} />
|
<Card.Title title={subject.name} />
|
||||||
|
@ -62,5 +67,9 @@ Subjects.propTypes = {
|
||||||
const style = StyleSheet.create({
|
const style = StyleSheet.create({
|
||||||
card: {
|
card: {
|
||||||
marginTop: 12,
|
marginTop: 12,
|
||||||
|
},
|
||||||
|
text: {
|
||||||
|
marginTop: 12,
|
||||||
|
textAlign: "center",
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue