From 36ebfc38aa200393480c1168d5c9a44513a2bd31 Mon Sep 17 00:00:00 2001
From: ivic00 <102467664+ivic00@users.noreply.github.com>
Date: Thu, 24 Oct 2024 21:34:12 +0200
Subject: [PATCH 1/5] added tablet view
---
app/(auth)/_layout.tsx | 15 +++-
app/(auth)/calendar/index.tsx | 6 +-
app/(auth)/todos/index.tsx | 5 +-
assets/svgs/MenuIcon.tsx | 4 +-
assets/svgs/NavBrainDumpIcon.tsx | 19 +++--
assets/svgs/NavCalendarIcon.tsx | 12 +--
assets/svgs/NavGroceryIcon.tsx | 9 +-
assets/svgs/NavToDosIcon.tsx | 2 +-
.../pages/(tablet_pages)/ViewSwitch.tsx | 83 +++++++++++++++++++
.../calendar/TabletCalendarPage.tsx | 56 +++++++++++++
.../chores/TabletChoresPage.tsx | 27 ++++++
package.json | 1 +
yarn.lock | 5 ++
13 files changed, 213 insertions(+), 31 deletions(-)
create mode 100644 components/pages/(tablet_pages)/ViewSwitch.tsx
create mode 100644 components/pages/(tablet_pages)/calendar/TabletCalendarPage.tsx
create mode 100644 components/pages/(tablet_pages)/chores/TabletChoresPage.tsx
diff --git a/app/(auth)/_layout.tsx b/app/(auth)/_layout.tsx
index 2b7927b..5edd485 100644
--- a/app/(auth)/_layout.tsx
+++ b/app/(auth)/_layout.tsx
@@ -6,7 +6,7 @@ import {
DrawerItem,
DrawerItemList,
} from "@react-navigation/drawer";
-import { Button, View, Text, ButtonSize } from "react-native-ui-lib";
+import { Button, View, Text, ButtonSize, Constants } from "react-native-ui-lib";
import { StyleSheet } from "react-native";
import Feather from "@expo/vector-icons/Feather";
import DrawerButton from "@/components/shared/DrawerButton";
@@ -23,6 +23,7 @@ import NavToDosIcon from "@/assets/svgs/NavToDosIcon";
import NavBrainDumpIcon from "@/assets/svgs/NavBrainDumpIcon";
import NavCalendarIcon from "@/assets/svgs/NavCalendarIcon";
import NavSettingsIcon from "@/assets/svgs/NavSettingsIcon";
+import ViewSwitch from "@/components/pages/(tablet_pages)/ViewSwitch";
export default function TabLayout() {
const { mutateAsync: signOut } = useSignOut();
@@ -33,6 +34,12 @@ export default function TabLayout() {
detachInactiveScreens
screenOptions={{
headerShown: true,
+ headerRight: () =>
+ Constants.isTablet ? (
+
+ ) : (
+ <>>
+ ),
drawerStyle: {
width: "90%",
backgroundColor: "#f9f8f7",
@@ -203,7 +210,7 @@ const styles = StyleSheet.create({
label: { fontFamily: "Poppins_400Medium", fontSize: 15 },
title: {
fontSize: 26.13,
- fontFamily: 'Manrope_600SemiBold',
- color: "#262627"
- }
+ fontFamily: "Manrope_600SemiBold",
+ color: "#262627",
+ },
});
diff --git a/app/(auth)/calendar/index.tsx b/app/(auth)/calendar/index.tsx
index 1b239ac..8d47936 100644
--- a/app/(auth)/calendar/index.tsx
+++ b/app/(auth)/calendar/index.tsx
@@ -1,8 +1,8 @@
import React from "react";
import CalendarPage from "@/components/pages/calendar/CalendarPage";
+import { Constants } from "react-native-ui-lib";
+import TabletCalendarPage from "@/components/pages/(tablet_pages)/calendar/TabletCalendarPage";
export default function Screen() {
- return (
-
- );
+ return <>{Constants.isTablet ? : }>;
}
diff --git a/app/(auth)/todos/index.tsx b/app/(auth)/todos/index.tsx
index 7ccb813..518f346 100644
--- a/app/(auth)/todos/index.tsx
+++ b/app/(auth)/todos/index.tsx
@@ -1,3 +1,4 @@
+import TabletChoresPage from "@/components/pages/(tablet_pages)/chores/TabletChoresPage";
import AddChore from "@/components/pages/todos/AddChore";
import ProgressCard from "@/components/pages/todos/ProgressCard";
import ToDoItem from "@/components/pages/todos/ToDoItem";
@@ -8,12 +9,12 @@ import { useAuthContext } from "@/contexts/AuthContext";
import { ToDosContextProvider, useToDosContext } from "@/contexts/ToDosContext";
import { AntDesign } from "@expo/vector-icons";
import { ScrollView } from "react-native-gesture-handler";
-import { Button, ButtonSize, View, Text } from "react-native-ui-lib";
+import { Button, ButtonSize, View, Text, Constants } from "react-native-ui-lib";
export default function Screen() {
return (
-
+ {Constants.isTablet ? : }
);
}
diff --git a/assets/svgs/MenuIcon.tsx b/assets/svgs/MenuIcon.tsx
index ad114a9..f54091a 100644
--- a/assets/svgs/MenuIcon.tsx
+++ b/assets/svgs/MenuIcon.tsx
@@ -7,8 +7,8 @@ interface MenuIconProps extends SvgProps {
const MenuIcon: React.FC = (props) => (