Skip to content

Commit

Permalink
Merge pull request #47 from Naveen-g09/clean
Browse files Browse the repository at this point in the history
Clean and major fixing
  • Loading branch information
Naveen-g09 authored Jun 19, 2024
2 parents d2b5fe7 + 7bdf9e6 commit 68494cd
Show file tree
Hide file tree
Showing 14 changed files with 1,373 additions and 1,803 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ yarn-error.*
# typescript
*.tsbuildinfo

# @generated expo-cli sync-b5df6a44d8735348b729920a7406b633cfb74d4c
# @generated expo-cli sync-91d8b50c41c737a5b873fc41ad99a1197d2d2bad
# The following patterns were generated by expo-cli

# Learn more https://docs.github.com/en/get-started/getting-started-with-git/ignoring-files
Expand Down Expand Up @@ -73,4 +73,5 @@ yarn-error.*
# typescript
*.tsbuildinfo

expo-env.d.ts
# @end expo-cli
6 changes: 0 additions & 6 deletions app/(auth)/_layout.tsx

This file was deleted.

120 changes: 0 additions & 120 deletions app/(auth)/login.tsx

This file was deleted.

83 changes: 0 additions & 83 deletions app/(settings)/index.tsx

This file was deleted.

36 changes: 0 additions & 36 deletions app/(tabs)/[id].tsx

This file was deleted.

5 changes: 2 additions & 3 deletions app/(tabs)/_layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ function TabBarIcon(props: {

export default function RootLayout() {
return (
<Tabs>
<Tabs initialRouteName="home">
<Tabs.Screen
name="index"
name="home"
options={{
title: "Home",
tabBarIcon: (props) => <TabBarIcon {...props} name="home" />,
Expand Down Expand Up @@ -64,7 +64,6 @@ export default function RootLayout() {
headerShown: false,
}}
/>
<Tabs.Screen name="[id]" options={{ headerShown: false, href: null }} />
</Tabs>
);
}
29 changes: 3 additions & 26 deletions app/(tabs)/account.tsx
Original file line number Diff line number Diff line change
@@ -1,17 +1,10 @@
import { BottomSheetModal, useBottomSheetModal } from "@gorhom/bottom-sheet";
import { Link } from "expo-router";
import React, { useEffect, useState, useRef } from "react";
import {
Text,
TouchableOpacity,
StyleSheet,
Alert,
ScrollView,
} from "react-native";
import React, { useState, useRef } from "react";
import { Text, TouchableOpacity, StyleSheet, ScrollView } from "react-native";

import AccountSheet from "../../components/bottomSheet";

import { supabase } from "@/app/lib/supabase-client";
import Admin from "@/components/adminBottomSheet";
import CalenderSheet from "@/components/calenderBS";
import Transaction from "@/components/transactionBottomSheet";
Expand All @@ -38,24 +31,8 @@ const Account = () => {
const handleUtilityPress = () => utilityBottomSheetRef.current?.present();

const [user, setUser] = useState(null);

Check warning on line 33 in app/(tabs)/account.tsx

View workflow job for this annotation

GitHub Actions / lint

'user' is assigned a value but never used. Allowed unused vars must match /^_/u

Check warning on line 33 in app/(tabs)/account.tsx

View workflow job for this annotation

GitHub Actions / lint

'user' is assigned a value but never used

Check warning on line 33 in app/(tabs)/account.tsx

View workflow job for this annotation

GitHub Actions / lint

'setUser' is assigned a value but never used. Allowed unused vars must match /^_/u

Check warning on line 33 in app/(tabs)/account.tsx

View workflow job for this annotation

GitHub Actions / lint

'setUser' is assigned a value but never used
useEffect(() => {
supabase.auth
.getUser()
.then(({ data: { user } }: { data: { user: any } }) => {
if (user) {
setUser(user);
} else {
Alert.alert("Error Accessing User");
}
});
}, []);

const doLogout = async () => {
const { error } = await supabase.auth.signOut();
if (error) {
Alert.alert("Error Signing Out User", error.message);
}
};
const doLogout = async () => {};

return (
<ScrollView contentContainerStyle={styles.container}>
Expand Down
24 changes: 8 additions & 16 deletions app/(tabs)/index.tsx → app/(tabs)/home.tsx
Original file line number Diff line number Diff line change
@@ -1,24 +1,14 @@
import { Link } from "expo-router";
import React, { useEffect } from "react";
import { Text, ScrollView, TouchableOpacity, StyleSheet } from "react-native";

import { storage } from "@/utils/mmkvHelpers";
import React from "react";
import { Text, TouchableOpacity, ScrollView, StyleSheet } from "react-native";

//TODO: this is homepage of the app
//TODO: add a notification icon
//TODO: it will have details of the society, details of the resident, details of the flat, details of the family members, details of the parking, details of the utilities, details of the maintenance, details of the bills, details of the orders, details of the payments, details of the receipts, details of the complaints, details of the suggestions, details of the feedbacks, details of the polls, details of the announcements, details of the notices, details of the chats, details of the events, details of the posts, details of the category, details of the community, details of the account, details of the index
//TODO: options of payment dues, gate updates, guest notification, help, etc
//TODO: in notification component it will push notifications of payment dues, gate updates, guest notification, help, etc

export const Index = () => {
useEffect(() => {
// storage.clearAll();
const keys = storage.getAllKeys();
//fetch keys as per chatcard id
if (!keys.length) {
}
});

const Home = () => {
return (
<ScrollView contentContainerStyle={styles.container}>
<Link href="/visitor" asChild>
Expand All @@ -33,18 +23,18 @@ export const Index = () => {
</TouchableOpacity>
</Link>

{/* <Link href="/news" asChild>
<Link href="/news" asChild>
<TouchableOpacity style={styles.button}>
<Text style={styles.buttonText}>News</Text>
</TouchableOpacity>
</Link> */}
</Link>

<Link href="/payment" asChild>
<TouchableOpacity style={styles.button}>
<Text style={styles.buttonText}>Payment Dues</Text>
</TouchableOpacity>
</Link>
{/* <Text>Gate Updates</Text> */}

<Link href="/news" asChild>
<TouchableOpacity style={styles.button}>
<Text style={styles.buttonText}>News</Text>
Expand Down Expand Up @@ -96,3 +86,5 @@ const styles = StyleSheet.create({
fontWeight: "bold",
},
});

export default Home;
2 changes: 1 addition & 1 deletion app/[...missing].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export default function NotFoundScreen() {
<Stack.Screen options={{ title: "Oops!" }} />
<View style={styles.container}>
<Text style={styles.title}>This screen doesn't exist.</Text>
<Link href="/" style={styles.link}>
<Link href="/(tabs)/home" style={styles.link}>
<Text style={styles.linkText}>Go to home screen!</Text>
</Link>
</View>
Expand Down
Loading

0 comments on commit 68494cd

Please sign in to comment.