From 7425b566d53793a37581da6361816075f9814e30 Mon Sep 17 00:00:00 2001 From: Ceda EI Date: Sun, 29 Mar 2020 13:45:27 +0530 Subject: [PATCH] Do not show Timetable till subjects are not added. --- components/Timetable.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/components/Timetable.js b/components/Timetable.js index 2f4ac5c..c424042 100644 --- a/components/Timetable.js +++ b/components/Timetable.js @@ -2,6 +2,7 @@ import React from "react"; import PropTypes from "prop-types"; import { Portal, + Text, } from "react-native-paper"; import { createStackNavigator } from "@react-navigation/stack"; @@ -12,6 +13,17 @@ const Stack = createStackNavigator(); export default function Timetable({ addTimetableEntry, removeTimetableEntry, timetable, subjects }) { const days = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"]; + if (subjects.length === 0) { + return ( + + No Subjects added. Add Subjects first. + ); + } return (