From dee71bec1177cd2c5d068b477efa4f9bb38ba48f Mon Sep 17 00:00:00 2001 From: Ceda EI Date: Fri, 20 Mar 2020 00:13:34 +0530 Subject: [PATCH] Add ScrollView and Portal.Host to Subjects. Add margin to last card. Move FAB inside Portal --- components/Subjects.js | 46 +++++++++++++++++++++++++++--------------- 1 file changed, 30 insertions(+), 16 deletions(-) diff --git a/components/Subjects.js b/components/Subjects.js index fb9d2ca..c06ef0e 100644 --- a/components/Subjects.js +++ b/components/Subjects.js @@ -4,10 +4,12 @@ import { Button, Card, FAB, + Portal, Text } from "react-native-paper"; import { + ScrollView, StyleSheet } from "react-native"; @@ -20,13 +22,23 @@ export default function Subjects({ subjects, addSubject, removeSubject }) { setShowDialog(false); } return ( - <> + {subjects.length === 0 ? - No Subjects added. Press + to add a subject. + + No Subjects added. Press + to add a subject. + : null } - {subjects.map(subject => ( - + {subjects.map((subject, idx) => ( +