From 036dce924732a3fd68f42db3f4f8f7de6d049e64 Mon Sep 17 00:00:00 2001 From: Naveen Date: Tue, 26 Dec 2023 15:32:04 +0530 Subject: [PATCH 01/22] initial commit --- components/AudioPlayer.tsx | 41 -------------------------------------- package.json | 1 - 2 files changed, 42 deletions(-) delete mode 100644 components/AudioPlayer.tsx diff --git a/components/AudioPlayer.tsx b/components/AudioPlayer.tsx deleted file mode 100644 index 5029883..0000000 --- a/components/AudioPlayer.tsx +++ /dev/null @@ -1,41 +0,0 @@ -import Ionicons from "@expo/vector-icons/Ionicons"; -import React, { useState } from "react"; -import { TouchableOpacity } from "react-native"; - -import { View } from "./Themed"; - -interface AudioPlayerProps { - url: string; - state: "playing" | "stopped"; -} - -export function AudioPlayer({ url, state }: AudioPlayerProps) { - const [isPlaying, setPlaying] = useState(state === "playing"); - - return ( - - - { - setPlaying(!isPlaying); - }} - > - - - {Array.from({ length: 20 }, (_, index) => { - const randomNumber = Math.floor(Math.random() * 10) * 2; - const styles = { - height: randomNumber, - }; - return ( - - ); - })} - - - ); -} diff --git a/package.json b/package.json index 1fa067f..644914c 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,6 @@ "android": "expo start --android", "ios": "expo start --ios", "web": "expo start --web", - "test": "jest --watchAll", "format": "prettier . --write", "format-check": "prettier --check \"**/*.{ts,tsx}\"", "type-check": "tsc --pretty --noEmit", From f24f74383141619cc63b370c37979ead79edb15f Mon Sep 17 00:00:00 2001 From: Naveen Date: Wed, 27 Dec 2023 11:32:37 +0530 Subject: [PATCH 02/22] removing unwanted files --- .env.sample | 1 - README.md | 4 +- app.json | 18 +- app/(tabs)/_layout.tsx | 56 ++ app/(tabs)/index.tsx | 32 + app/(tabs)/two.tsx | 32 + app/+html.tsx | 4 +- app/ChatCard.tsx | 78 -- app/Footer.tsx | 53 -- app/[...missing].tsx | 38 +- app/_layout.tsx | 33 +- app/index.tsx | 33 - app/input/Camera.tsx | 108 --- app/input/CameraScreen.tsx | 13 - app/input/Gallery.tsx | 33 - app/input/talk.tsx | 28 - app/modal.tsx | 36 + components/AudioPlayer.tsx | 41 - components/MessageBlob.tsx | 59 -- components/RoundedButton.tsx | 54 -- package.json | 7 +- yarn.lock | 1489 +++++++++++++++++++++++++++------- 22 files changed, 1406 insertions(+), 844 deletions(-) create mode 100644 app/(tabs)/_layout.tsx create mode 100644 app/(tabs)/index.tsx create mode 100644 app/(tabs)/two.tsx delete mode 100644 app/ChatCard.tsx delete mode 100644 app/Footer.tsx delete mode 100644 app/index.tsx delete mode 100644 app/input/Camera.tsx delete mode 100644 app/input/CameraScreen.tsx delete mode 100644 app/input/Gallery.tsx delete mode 100644 app/input/talk.tsx create mode 100644 app/modal.tsx delete mode 100644 components/AudioPlayer.tsx delete mode 100644 components/MessageBlob.tsx delete mode 100644 components/RoundedButton.tsx diff --git a/.env.sample b/.env.sample index 0f0730b..e69de29 100644 --- a/.env.sample +++ b/.env.sample @@ -1 +0,0 @@ -OPENAI_API_KEY="..." \ No newline at end of file diff --git a/README.md b/README.md index 7fdbe4c..91fe21e 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Ella +# vvsales # TODOs @@ -25,5 +25,5 @@ yarn run ios --clear # Troubleshooting ```txt -watchman watch-del 'project location/Ella' ; watchman watch-project 'project location/Ella' +watchman watch-del 'project location/vvsales' ; watchman watch-project 'project location/vvsales' ``` diff --git a/app.json b/app.json index 639c8b0..7c4b661 100644 --- a/app.json +++ b/app.json @@ -1,7 +1,7 @@ { "expo": { - "name": "ella", - "slug": "DrElla", + "name": "vvsales", + "slug": "vvsales", "version": "1.0.0", "orientation": "portrait", "icon": "./assets/images/icon.png", @@ -12,17 +12,23 @@ "resizeMode": "contain", "backgroundColor": "#ffffff" }, - "assetBundlePatterns": ["**/*"], + "assetBundlePatterns": [ + "**/*" + ], "ios": { "supportsTablet": true, - "bundleIdentifier": "com.technoculture.ella" + "bundleIdentifier": "com.technoculture.vvsales" }, "android": { "adaptiveIcon": { "foregroundImage": "./assets/images/adaptive-icon.png", "backgroundColor": "#ffffff" }, - "package": "com.technoculture.ella" + "package": "com.technoculture.vvsales", + "permissions": [ + "android.permission.CAMERA", + "android.permission.RECORD_AUDIO" + ] }, "web": { "bundler": "metro", @@ -53,7 +59,7 @@ "origin": false }, "eas": { - "projectId" :"dfde4001-b00b-4a77-a028-7d966b8f9e3d" + "projectId": "a463d91b-3ec0-4653-837a-93a87a5b687d" } }, "owner": "technoculture" diff --git a/app/(tabs)/_layout.tsx b/app/(tabs)/_layout.tsx new file mode 100644 index 0000000..f4a0d9d --- /dev/null +++ b/app/(tabs)/_layout.tsx @@ -0,0 +1,56 @@ +import FontAwesome from '@expo/vector-icons/FontAwesome'; +import { Link, Tabs } from 'expo-router'; +import { Pressable, useColorScheme } from 'react-native'; + +import Colors from '../../constants/Colors'; +import React from 'react'; + +/** + * You can explore the built-in icon families and icons on the web at https://icons.expo.fyi/ + */ +function TabBarIcon(props: { + name: React.ComponentProps['name']; + color: string; +}) { + return ; +} + +export default function TabLayout() { + const colorScheme = useColorScheme(); + + return ( + + , + headerRight: () => ( + + + {({ pressed }) => ( + + )} + + + ), + }} + /> + , + }} + /> + + ); +} diff --git a/app/(tabs)/index.tsx b/app/(tabs)/index.tsx new file mode 100644 index 0000000..128e3ca --- /dev/null +++ b/app/(tabs)/index.tsx @@ -0,0 +1,32 @@ +import { StyleSheet } from 'react-native'; + +import EditScreenInfo from '../../components/EditScreenInfo'; +import { Text, View } from '../../components/Themed'; +import React from 'react'; + +export default function TabOneScreen() { + return ( + + Tasks + + + + ); +} + +const styles = StyleSheet.create({ + container: { + flex: 1, + alignItems: 'center', + justifyContent: 'center', + }, + title: { + fontSize: 20, + fontWeight: 'bold', + }, + separator: { + marginVertical: 30, + height: 1, + width: '80%', + }, +}); diff --git a/app/(tabs)/two.tsx b/app/(tabs)/two.tsx new file mode 100644 index 0000000..e6b30b6 --- /dev/null +++ b/app/(tabs)/two.tsx @@ -0,0 +1,32 @@ +import { StyleSheet } from 'react-native'; + +import EditScreenInfo from '../../components/EditScreenInfo'; +import { Text, View } from '../../components/Themed'; +import React from 'react'; + +export default function TabTwoScreen() { + return ( + + Logs + + + + ); +} + +const styles = StyleSheet.create({ + container: { + flex: 1, + alignItems: 'center', + justifyContent: 'center', + }, + title: { + fontSize: 20, + fontWeight: 'bold', + }, + separator: { + marginVertical: 30, + height: 1, + width: '80%', + }, +}); diff --git a/app/+html.tsx b/app/+html.tsx index 2442e89..7f7df7c 100644 --- a/app/+html.tsx +++ b/app/+html.tsx @@ -1,5 +1,5 @@ -import { ScrollViewStyleReset } from "expo-router/html"; -import React from "react"; +import { ScrollViewStyleReset } from 'expo-router/html'; +import React from 'react'; // This file is web-only and used to configure the root HTML for every // web page during static rendering. diff --git a/app/ChatCard.tsx b/app/ChatCard.tsx deleted file mode 100644 index f673431..0000000 --- a/app/ChatCard.tsx +++ /dev/null @@ -1,78 +0,0 @@ -/* eslint-disable @typescript-eslint/no-unused-vars */ -import { FlashList } from "@shopify/flash-list"; -import React, { useState } from "react"; -import { TouchableOpacity, useWindowDimensions } from "react-native"; -import { getStatusBarHeight } from "react-native-safearea-height"; - -import { talk } from "./input/talk"; -import { MessageBlob } from "../components/MessageBlob"; -import { View } from "../components/Themed"; - -export function ChatCard() { - const [msgs, setMsgs] = useState([ - { - type: "human", - text: "Hi", - audio: "https://d7ftvotrexusa.cloudfront.net/chataudio/1340/G4mv3Y9.mpeg", - }, - { type: "ai", text: "Hi Human!" }, - { - type: "human", - text: "Hi", - audio: "https://d7ftvotrexusa.cloudfront.net/chataudio/1340/G4mv3Y9.mpeg", - }, - { type: "ai", text: "Hi Human!" }, - { - type: "human", - text: "Hi", - audio: "https://d7ftvotrexusa.cloudfront.net/chataudio/1340/G4mv3Y9.mpeg", - }, - { type: "ai", text: "Hi Human!" }, - { type: "human", text: "Nice to meet you" }, - { type: "ai", text: "Hi Human!" }, - { - type: "human", - text: "Hi", - audio: "https://d7ftvotrexusa.cloudfront.net/chataudio/1340/G4mv3Y9.mpeg", - }, - { type: "ai", text: "Hi Human!" }, - { type: "human", text: "Nice to meet you" }, - { type: "ai", text: "Hi Human!" }, - { - type: "human", - text: "Hi", - audio: "https://d7ftvotrexusa.cloudfront.net/chataudio/1340/G4mv3Y9.mpeg", - }, - { type: "ai", text: "Hi Human!" }, - { type: "human", text: "Nice to meet you" }, - ]); - - async function handleTalk() { - await talk(setMsgs, msgs); - } - - const { height } = useWindowDimensions(); - const screenHeight = height; - const safeScreenHeight = height - getStatusBarHeight(true); - const footerHeight = 160; - const canvasHeight = safeScreenHeight - footerHeight; - - return ( - - - - ( - - )} - estimatedItemSize={50} - data={msgs} - contentContainerStyle={{ padding: 15 }} - /> - - - ); -} diff --git a/app/Footer.tsx b/app/Footer.tsx deleted file mode 100644 index 611685c..0000000 --- a/app/Footer.tsx +++ /dev/null @@ -1,53 +0,0 @@ -// Footer.tsx -import { CameraType } from "expo-camera"; -import React, { useState } from "react"; -import { View, Modal, TouchableOpacity, Text } from "react-native"; - -import { CameraComponent } from "./input/Camera"; -import { Gallery } from "./input/Gallery"; -import { RoundedButton } from "../components/RoundedButton"; - -interface FooterProps { - onCallPress: () => Promise; - onCameraPress: (cameraType: CameraType) => void; - onFilePick: (uri: string) => void; -} - -export function Footer({ - onCallPress, - onCameraPress, - onFilePick, -}: FooterProps): React.JSX.Element { - const [isCameraModalVisible, setCameraModalVisible] = useState(false); - - const handleCameraPress = () => { - setCameraModalVisible(true); - }; - - const closeCameraModal = () => { - setCameraModalVisible(false); - }; - - return ( - - - await onCallPress()} - /> - - - - onCameraPress(type)} /> - - Close Camera - - - - ); -} diff --git a/app/[...missing].tsx b/app/[...missing].tsx index 0b231dc..d97efc7 100644 --- a/app/[...missing].tsx +++ b/app/[...missing].tsx @@ -1,19 +1,41 @@ -import { Link, Stack } from "expo-router"; -import React from "react"; +import { Link, Stack } from 'expo-router'; +import { StyleSheet } from 'react-native'; -import { Text, View } from "../components/Themed"; +import { Text, View } from '../components/Themed'; +import React from 'react'; export default function NotFoundScreen() { return ( <> - - - This screen doesn't exist. + + + This screen doesn't exist. - - Go to home screen! + + Go to home screen! ); } + +const styles = StyleSheet.create({ + container: { + flex: 1, + alignItems: 'center', + justifyContent: 'center', + padding: 20, + }, + title: { + fontSize: 20, + fontWeight: 'bold', + }, + link: { + marginTop: 15, + paddingVertical: 15, + }, + linkText: { + fontSize: 14, + color: '#2e78b7', + }, +}); diff --git a/app/_layout.tsx b/app/_layout.tsx index 571e436..316a3d3 100644 --- a/app/_layout.tsx +++ b/app/_layout.tsx @@ -1,19 +1,19 @@ -import "react-native-url-polyfill/auto"; - -import FontAwesome from "@expo/vector-icons/FontAwesome"; -import { - DarkTheme, - DefaultTheme, - ThemeProvider, -} from "@react-navigation/native"; -import { useFonts } from "expo-font"; -import { SplashScreen, Stack } from "expo-router"; -import React, { useEffect } from "react"; -import { useColorScheme } from "react-native"; +import FontAwesome from '@expo/vector-icons/FontAwesome'; +import { DarkTheme, DefaultTheme, ThemeProvider } from '@react-navigation/native'; +import { useFonts } from 'expo-font'; +import { SplashScreen, Stack } from 'expo-router'; +import React from 'react'; +import { useEffect } from 'react'; +import { useColorScheme } from 'react-native'; + +export { + // Catch any errors thrown by the Layout component. + ErrorBoundary, +} from 'expo-router'; export const unstable_settings = { // Ensure that reloading on `/modal` keeps a back button present. - initialRouteName: "index", + initialRouteName: '(tabs)', }; // Prevent the splash screen from auto-hiding before asset loading is complete. @@ -21,7 +21,7 @@ SplashScreen.preventAutoHideAsync(); export default function RootLayout() { const [loaded, error] = useFonts({ - SpaceMono: require("../assets/fonts/SpaceMono-Regular.ttf"), + SpaceMono: require('../assets/fonts/SpaceMono-Regular.ttf'), ...FontAwesome.font, }); @@ -47,9 +47,10 @@ function RootLayoutNav() { const colorScheme = useColorScheme(); return ( - + - + + ); diff --git a/app/index.tsx b/app/index.tsx deleted file mode 100644 index c2ac680..0000000 --- a/app/index.tsx +++ /dev/null @@ -1,33 +0,0 @@ -/* eslint-disable @typescript-eslint/no-unused-vars */ -import OpenAI from "openai"; -import React, { useState } from "react"; -import { useWindowDimensions, SafeAreaView } from "react-native"; - -import { ChatCard } from "./ChatCard"; -import { Footer } from "./Footer"; -import { talk } from "./input/talk"; -import { View } from "../components/Themed"; - -export default function HomeScreen() { - const { height } = useWindowDimensions(); - const screenHeight = height; - const [msgs, setMsgs] = useState([]); - - return ( - - - - -