diff --git a/app/tabs/calorie.tsx b/app/tabs/calorie.tsx index cb1236b..86bd68d 100644 --- a/app/tabs/calorie.tsx +++ b/app/tabs/calorie.tsx @@ -2,7 +2,7 @@ import React, { useEffect, useState } from "react"; import { MaterialCommunityIcons } from "@expo/vector-icons"; import { H5, Input, ScrollView, Tabs, Text } from "tamagui"; -import { CardDemo } from "../../components/DemoCard"; +import { CardDemo } from "../../components/calorie/DemoCard"; import { MySafeAreaView } from "../../components/MySafeAreaView"; import { MyStack } from "../../components/MyStack"; import config from "../../env.json"; diff --git a/app/tabs/home.tsx b/app/tabs/home.tsx index 768186d..bcf14cb 100644 --- a/app/tabs/home.tsx +++ b/app/tabs/home.tsx @@ -1,214 +1,11 @@ import React, { useState } from "react"; -import { Animated, StyleSheet } from "react-native"; -import { FlatList, RectButton, Swipeable } from "react-native-gesture-handler"; -import { MaterialCommunityIcons } from "@expo/vector-icons"; -import { Trash } from "@tamagui/lucide-icons"; -import { ScrollView, Text, View, YStack } from "tamagui"; -import { Button, Card, H4, Paragraph, XStack } from "tamagui"; - +import { ScrollView, Text, YStack } from "tamagui"; +import { XStack } from "tamagui"; import HeaderBar from "../../components/HeaderBar"; import { MySafeAreaView } from "../../components/MySafeAreaView"; import { MyStack } from "../../components/MyStack"; -import SearchBar from "../../components/SearchBar"; -import { SheetDemo } from "../../components/SheetDemo"; - -const DemoCard = ({ text, iconText, iconColor, size, children, func }: any) => { - return ( - - - - -

{text}

- {children} -
-
- -
- ); -}; - -const CardParagraph = ({ text, iconText, iconColor }: any) => { - return ( - - {" "} - {text} - - ); -}; - -// const renderRightActions = (progress: any, dragAnimatedValue: any) => { -// const opacity = dragAnimatedValue.interpolate({ -// inputRange: [-100, 0], -// outputRange: [1, 0], -// extrapolate: "clamp" -// }); -// return ( -// -// -// Are you sure? -// -// -// -// -// -// ); -// }; - -const renderRightActions = (progress, dragAnimatedValue) => { - const trans = progress.interpolate({ - inputRange: [0, 1], - outputRange: [175, 0], - extrapolate: "clamp" - }); - const opacity = dragAnimatedValue.interpolate({ - inputRange: [-100, 0], - outputRange: [1, 0], - extrapolate: "clamp" - }); - // const pressHandler = () => { - // this.close(); - // alert(text); - // }; - return ( - - - - - - ); -}; - -const SheetCard = ({ text, iconText, iconColor, size, children }: any) => { - const [open, setOpen] = useState(false); - return ( - - - - setOpen(true)} - > - {children} - - - - - ); -}; - -const styles = StyleSheet.create({ - container: { - flex: 1, - minHeight: 300 - }, - row: { - flexDirection: "row", - flex: 1, - alignItems: "center", - paddingLeft: 5, - backgroundColor: "#efefef", - margin: 20, - minHeight: 50 - }, - swipedRow: { - flexDirection: "row", - flex: 1, - alignItems: "center", - paddingLeft: 5, - backgroundColor: "#818181", - margin: 20, - minHeight: 50 - }, - swipedConfirmationContainer: { - flex: 1 - }, - deleteConfirmationText: { - color: "#fcfcfc", - fontWeight: "bold" - }, - deleteButton: { - backgroundColor: "#b60000", - flexDirection: "column", - justifyContent: "center", - height: "100%" - }, - deleteButtonText: { - color: "#fcfcfc", - fontWeight: "bold", - padding: 3 - }, - rightAction: { - alignItems: "center", - paddingRight: 20, - paddingLeft: 20, - flex: 1, - justifyContent: "center" - } -}); +import SearchBar from "../../components/home/SearchBar"; +import { SheetCard } from "../../components/home/SheetCard"; export default function Home() { const [defaultItems, setDefaultItems] = useState([ @@ -262,8 +59,6 @@ export default function Home() { gap={30} padding={"5%"} paddingLeft={"4%"} - // marginTop={-10} - // margin={"$4"} > @@ -287,14 +82,9 @@ export default function Home() { - - */} - {/* */} - {/* */} - - {/* */} - {/* */} - {/* */} - - {/* */} - {/* */} - {/* */} - - {/* */} - {/* */} - {/* */} diff --git a/app/users/[user].tsx b/app/users/[user].tsx index afaa410..971a038 100644 --- a/app/users/[user].tsx +++ b/app/users/[user].tsx @@ -1,8 +1,8 @@ import { ArrowLeft } from "@tamagui/lucide-icons"; -import { useRouter, useSearchParams } from "expo-router"; +import { useRouter, useGlobalSearchParams } from "expo-router"; import { Button, H3, H6, XStack } from "tamagui"; -import DialogDemo from "../../components/DialogDemo"; +import DialogDemo from "../../components/profile/DialogDemo"; import { MyStack } from "../../components/MyStack"; import SelectDemo from "../../components/SelectDemo"; import SpinnerDemo from "../../components/SpinnerDemo"; @@ -10,7 +10,7 @@ import SwitchDemo from "../../components/SwitchDemo"; export default function User() { const router = useRouter(); - const params = useSearchParams(); + const params = useGlobalSearchParams(); return ( diff --git a/components/Action.tsx b/components/Action.tsx deleted file mode 100644 index bcdcb23..0000000 --- a/components/Action.tsx +++ /dev/null @@ -1,54 +0,0 @@ -import React from "react"; -import { StyleSheet, Text, View } from "react-native"; -import Animated, { - divide, - interpolate, - Extrapolate, - sub, - cond, - add, - lessThan, - multiply, -} from "react-native-reanimated"; -import { HEIGHT } from "./ItemLayout"; - -const styles = StyleSheet.create({ - remove: { - color: "white", - fontFamily: "UberMoveMedium", - fontSize: 14, - }, -}); - -interface ActionProps {} - -const Action = ({}: ActionProps) => { - return ( - - - - Remove - - - ); -}; - -export default Action; diff --git a/components/DemoCard.tsx b/components/calorie/DemoCard.tsx similarity index 100% rename from components/DemoCard.tsx rename to components/calorie/DemoCard.tsx diff --git a/components/home/CardParagraph.tsx b/components/home/CardParagraph.tsx new file mode 100644 index 0000000..5e65651 --- /dev/null +++ b/components/home/CardParagraph.tsx @@ -0,0 +1,19 @@ +import { MaterialCommunityIcons } from "@expo/vector-icons"; +import { Paragraph } from "tamagui"; + +export const CardParagraph = ({ text, iconText, iconColor }: any) => { + return ( + + {" "} + {text} + + ); +} \ No newline at end of file diff --git a/components/home/DemoCard.tsx b/components/home/DemoCard.tsx new file mode 100644 index 0000000..3bd49ec --- /dev/null +++ b/components/home/DemoCard.tsx @@ -0,0 +1,33 @@ +import React from "react"; +import { Card, YStack, H4 } from "tamagui"; +import { MaterialCommunityIcons } from "@expo/vector-icons"; + +export const DemoCard = ({ text, iconText, iconColor, size, children, func }: any) => { + return ( + + + + +

{text}

+ {children} +
+
+ +
+ ); + }; \ No newline at end of file diff --git a/components/SearchBar.tsx b/components/home/SearchBar.tsx similarity index 100% rename from components/SearchBar.tsx rename to components/home/SearchBar.tsx diff --git a/components/home/SheetCard.tsx b/components/home/SheetCard.tsx new file mode 100644 index 0000000..7ae0ad4 --- /dev/null +++ b/components/home/SheetCard.tsx @@ -0,0 +1,131 @@ +import { Trash } from "@tamagui/lucide-icons"; +import { useRef, useState } from "react"; +import { Animated, StyleSheet } from "react-native"; +import { RectButton, Swipeable } from "react-native-gesture-handler"; +import { DemoCard } from "./DemoCard"; +import {View} from "tamagui" +import { SheetDemo } from "./SheetDemo"; + +export const SheetCard = ({ text, iconText, iconColor, size, children }: any) => { + const swipe:any = useRef(null); + const [open, setOpen] = useState(false); + + const renderRightActions = (progress, dragAnimatedValue) => { + const trans = progress.interpolate({ + inputRange: [0, 1], + outputRange: [180, 0], + extrapolate: "clamp" + }); + const opacity = dragAnimatedValue.interpolate({ + inputRange: [-100, 0], + outputRange: [1, 0], + extrapolate: "clamp" + }); + const pressHandler = () => { + swipe.current.close(); + }; + return ( + + + + + + ); + }; + + + return ( + + + + setOpen(true)} + > + {children} + + + + + ); + }; + + const styles = StyleSheet.create({ + container: { + flex: 1, + minHeight: 300 + }, + row: { + flexDirection: "row", + flex: 1, + alignItems: "center", + paddingLeft: 5, + backgroundColor: "#efefef", + margin: 20, + minHeight: 50 + }, + swipedRow: { + flexDirection: "row", + flex: 1, + alignItems: "center", + paddingLeft: 5, + backgroundColor: "#818181", + margin: 20, + minHeight: 50 + }, + swipedConfirmationContainer: { + flex: 1 + }, + deleteConfirmationText: { + color: "#fcfcfc", + fontWeight: "bold" + }, + deleteButton: { + backgroundColor: "#b60000", + flexDirection: "column", + justifyContent: "center", + height: "100%" + }, + deleteButtonText: { + color: "#fcfcfc", + fontWeight: "bold", + padding: 3 + }, + rightAction: { + alignItems: "center", + paddingRight: 20, + paddingLeft: 20, + flex: 1, + justifyContent: "center" + } + }); \ No newline at end of file diff --git a/components/SheetDemo.tsx b/components/home/SheetDemo.tsx similarity index 100% rename from components/SheetDemo.tsx rename to components/home/SheetDemo.tsx diff --git a/components/DialogDemo.tsx b/components/profile/DialogDemo.tsx similarity index 98% rename from components/DialogDemo.tsx rename to components/profile/DialogDemo.tsx index fda5ac9..ed7daef 100644 --- a/components/DialogDemo.tsx +++ b/components/profile/DialogDemo.tsx @@ -11,7 +11,7 @@ import { YStack } from "tamagui"; -import SelectDemo from "./SelectDemo"; +import SelectDemo from "../SelectDemo"; export default function DialogDemo() { return ( diff --git a/components/arnold.py b/components/python/arnold.py similarity index 100% rename from components/arnold.py rename to components/python/arnold.py diff --git a/components/dietician.py b/components/python/dietician.py similarity index 100% rename from components/dietician.py rename to components/python/dietician.py diff --git a/components/genericCoach.py b/components/python/genericCoach.py similarity index 100% rename from components/genericCoach.py rename to components/python/genericCoach.py diff --git a/components/goggins.py b/components/python/goggins.py similarity index 100% rename from components/goggins.py rename to components/python/goggins.py diff --git a/components/mikementzer.py b/components/python/mikementzer.py similarity index 100% rename from components/mikementzer.py rename to components/python/mikementzer.py diff --git a/package.json b/package.json index 967e07f..1a66a8e 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,6 @@ "name": "fitgoat", "version": "1.0.0", "main": "expo-router/entry", - "type": "module", "scripts": { "start": "expo start", "android": "expo run:android",