forked from asimgope1/Ella
-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Single page app #3
Closed
Closed
Changes from all commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
036dce9
initial commit
Naveen-g09 f24f743
removing unwanted files
Naveen-g09 05ad85f
setupping up tab router
Naveen-g09 f70643a
Merge branch 'refactoring-ui' of https://github.com/Technoculture/VVS…
Naveen-g09 a5baabb
clearing naming conventions
Naveen-g09 becf363
configuring tailwind
Naveen-g09 c436415
twilio configuration
Naveen-g09 41be856
addition of react native call function
Naveen-g09 dfb67a3
call and logs feature
Naveen-g09 b4d4296
trying refcatoring call log
Naveen-g09 8f3f01c
commit before merge
Naveen-g09 4783c45
single page app
Naveen-g09 109d4c1
api-feature
Naveen-g09 e52fcda
pull-to-refresh
Naveen-g09 75c32d8
small lint fix
Naveen-g09 1b8c188
turso and drizzle configuration
Naveen-g09 0fd89d7
configured turso and drizzle
Naveen-g09 d7feedf
incomplete setup
Naveen-g09 dc7faef
multi-database setup
Naveen-g09 6d40012
chore: factoring index.tsx
Naveen-g09 4a58a87
chore: minor fixes
Naveen-g09 274657b
clouflare configuration
Naveen-g09 1939dda
chore: little fixing
Naveen-g09 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,6 @@ | ||
OPENAI_API_KEY="..." | ||
TURSO_DB_URL=YOUR_DB_URL | ||
TURSO_DB_AUTH_TOKEN=YOUR_DB_AUTH_TOKEN | ||
|
||
//connect to the cloudflare api endpoint | ||
|
||
API_URL=YOUR_API_URL |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
name: update | ||
on: | ||
push: | ||
push: | ||
branches: | ||
- release | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
import FontAwesome from "@expo/vector-icons/FontAwesome"; | ||
import { Link, Tabs } from "expo-router"; | ||
import React from "react"; | ||
import { Pressable, useColorScheme } from "react-native"; | ||
|
||
import Colors from "../../constants/Colors"; | ||
|
||
/** | ||
* You can explore the built-in icon families and icons on the web at https://icons.expo.fyi/ | ||
*/ | ||
function TabBarIcon(props: { | ||
name: React.ComponentProps<typeof FontAwesome>["name"]; | ||
color: string; | ||
}) { | ||
return <FontAwesome size={28} className="mb-[-3]" {...props} />; | ||
} | ||
|
||
export default function TabLayout() { | ||
const colorScheme = useColorScheme(); | ||
|
||
return ( | ||
<Tabs | ||
screenOptions={{ | ||
tabBarActiveTintColor: Colors[colorScheme ?? "light"].tint, | ||
}} | ||
> | ||
<Tabs.Screen | ||
name="index" | ||
options={{ | ||
title: "Tasks", | ||
tabBarIcon: ({ color }) => <TabBarIcon name="code" color={color} />, | ||
headerRight: () => ( | ||
<Link href="/inbox" asChild> | ||
<Pressable> | ||
{({ pressed }) => ( | ||
<FontAwesome | ||
name="info-circle" | ||
size={25} | ||
color={Colors[colorScheme ?? "light"].text} | ||
className={`mr-15 ${ | ||
pressed ? "opacity-50" : "opacity-100" | ||
}`} | ||
/> | ||
)} | ||
</Pressable> | ||
</Link> | ||
), | ||
}} | ||
/> | ||
</Tabs> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
/* eslint-disable @typescript-eslint/no-unused-vars */ | ||
import React, { useState, useEffect, useCallback } from "react"; | ||
import { FlatList, TouchableOpacity, RefreshControl } from "react-native"; | ||
import RNImmediatePhoneCall from "react-native-immediate-phone-call"; | ||
import call from "react-native-phone-call"; | ||
|
||
import { Text, View } from "../../components/Themed"; | ||
import { sync } from "../../lib/db_helpers"; | ||
|
||
interface Task { | ||
id: string; | ||
name: string; | ||
contactNumber: string; | ||
trials: number; | ||
city: string; | ||
state: string; | ||
} | ||
|
||
export default function TabOneScreen() { | ||
const [tasks, setTasks] = useState<Task[]>([]); | ||
const [refreshing, setRefreshing] = useState(false); | ||
|
||
const getTasks = async () => { | ||
const tasks = await fetch("API_URL" + "/tasks"); | ||
const json = await tasks.json(); | ||
return json; | ||
}; | ||
|
||
const fetchData = useCallback(async () => { | ||
const tasks = await getTasks(); | ||
setTasks(tasks); | ||
}, []); | ||
|
||
const updateTrials = async (taskId: string) => { | ||
const updatedTasks = tasks.map((task) => { | ||
if (task.id === taskId) { | ||
return { | ||
...task, | ||
trials: task.trials + 1, | ||
}; | ||
} | ||
return task; | ||
}); | ||
setTasks(updatedTasks); | ||
}; | ||
|
||
const handleRefresh = useCallback(() => { | ||
setRefreshing(true); | ||
sync(setTasks); | ||
setRefreshing(false); | ||
}, []); | ||
|
||
useEffect(() => { | ||
const intervalId = setInterval(() => { | ||
sync(setTasks); | ||
}, 120000); | ||
return () => clearInterval(intervalId); | ||
}, []); | ||
|
||
const handleCallPress = (contactNumber: string, taskId: string) => { | ||
const args = { | ||
number: contactNumber, | ||
prompt: false, | ||
}; | ||
updateTrials(taskId); | ||
// RNImmediatePhoneCall.immediatePhoneCall(contactNumber); | ||
|
||
call(args).catch(console.error); | ||
}; | ||
|
||
return ( | ||
<View className="flex-1 items-center justify-center"> | ||
<FlatList | ||
data={tasks} | ||
keyExtractor={(item) => item.id} | ||
renderItem={({ item }: { item: Task }) => ( | ||
<View> | ||
<Text>{`Name: ${item.name}`}</Text> | ||
<Text>{`Contact Number: ${item.contactNumber}`}</Text> | ||
<Text>{`Trials: ${item.trials}`}</Text> | ||
<Text>{`City: ${item.city}`}</Text> | ||
<Text>{`State: ${item.state}`}</Text> | ||
<Text>{`ID: ${item.id}`}</Text> | ||
<TouchableOpacity | ||
onPress={() => handleCallPress(item.contactNumber, item.id)} | ||
> | ||
<Text className="text-blue-500">Call</Text> | ||
</TouchableOpacity> | ||
<View className="border-b border-black mb-10" /> | ||
</View> | ||
)} | ||
refreshControl={ | ||
<RefreshControl refreshing={refreshing} onRefresh={handleRefresh} /> | ||
} | ||
/> | ||
</View> | ||
); | ||
} |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://github.com/dcastil/tailwind-merge