From 635dbbf7091322f7ad4e428967336b578ef2f6c7 Mon Sep 17 00:00:00 2001 From: Ceda EI Date: Mon, 16 Mar 2020 20:43:14 +0530 Subject: [PATCH] Add text when no subject is shown. --- components/Subjects.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/components/Subjects.js b/components/Subjects.js index 0194d1a..75e85bd 100644 --- a/components/Subjects.js +++ b/components/Subjects.js @@ -4,6 +4,7 @@ import { Button, Card, FAB, + Text } from "react-native-paper"; import { @@ -20,6 +21,10 @@ export default function Subjects({ subjects, addSubject, removeSubject }) { } return ( <> + {subjects.length === 0 ? + No Subjects added. Press + to add a subject. + : null + } {subjects.map(subject => ( @@ -62,5 +67,9 @@ Subjects.propTypes = { const style = StyleSheet.create({ card: { marginTop: 12, + }, + text: { + marginTop: 12, + textAlign: "center", } });