Skip to content

Commit

Permalink
Some Quick Changes I Thought Of
Browse files Browse the repository at this point in the history
  • Loading branch information
rhit-villencr committed Jan 16, 2025
1 parent 7468f14 commit d989e05
Show file tree
Hide file tree
Showing 11 changed files with 11 additions and 18 deletions.
6 changes: 3 additions & 3 deletions app/_layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ const CustomTopBar = ({ navigation }: StackHeaderProps) => {
<TouchableOpacity onPress={() => navigation.navigate('mainMealTracker')}>
<Ionicons name="fast-food-outline" size={28} color="black" />
</TouchableOpacity>
<TouchableOpacity onPress={() => navigation.navigate('accountSetting')}>
<Ionicons name="person-circle-outline" size={28} color="black" />
</TouchableOpacity>
<TouchableOpacity onPress={() => navigation.navigate('mainFinanceTracker')}>
<Ionicons name="wallet-outline" size={28} color="black" />
</TouchableOpacity>
Expand All @@ -45,9 +48,6 @@ const CustomTopBar = ({ navigation }: StackHeaderProps) => {
<TouchableOpacity onPress={() => navigation.navigate('notes')}>
<Ionicons name="pencil-outline" size={28} color="black" />
</TouchableOpacity>
<TouchableOpacity onPress={() => navigation.navigate('accountSetting')}>
<Ionicons name="person-circle-outline" size={28} color="black" />
</TouchableOpacity>
</View>
);
};
Expand Down
1 change: 0 additions & 1 deletion app/addCalendarEvents.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ export default function AddCalendarEvents() {
fields={calendarFields}
mainPage="mainCalendarEvents"
updateEndpoint={`/add_calendar_event`}
method="POST"
/>
);
}
1 change: 0 additions & 1 deletion app/addFinanceEvents.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ export default function AddFinanceEvents() {
fields={financeFields}
mainPage='mainFinanceTracker'
updateEndpoint={`/add_finance_events`}
method="POST"
/>
);
}
1 change: 0 additions & 1 deletion app/addHealthEvents.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ export default function AddHealthEvents() {
fields={healthFields}
mainPage='mainHealthTracker'
updateEndpoint={`/add_health_events`}
method="POST"
/>
);
}
1 change: 0 additions & 1 deletion app/addMeals.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ export default function AddMeals() {
updateEndpoint={`/add_meal_events`}
fetchEndpoint={`/get_ingredients`}
keyValue={{'key':"id", "value":"ingredientName"}}
method="POST"
/>
);
};
Expand Down
8 changes: 3 additions & 5 deletions app/genericAddViewEventPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,17 @@ import AsyncStorage from '@react-native-async-storage/async-storage';
import { verifyToken } from '@/constants/constants';
import { call } from '../components/apiCall';

const GenericAddViewPageForm: React.FC<GenericEventPageProps> = ({ title, initialData = {}, fields, mainPage, updateEndpoint, fetchEndpoint, keyValue, method }) => {
const GenericAddViewPageForm: React.FC<GenericEventPageProps> = ({ title, initialData = {}, fields, mainPage, updateEndpoint, fetchEndpoint, keyValue, method="POST" }) => {
const [showDatePicker, setShowDatePicker] = useState(false);
const [showTimePicker, setShowTimePicker] = useState(false);
const [additionalData, setAdditionalData] = useState<any>([]);
const [currentField, setCurrentField] = useState<string | null>(null);
const route = useRoute<RouteProp<RootStackParamList, any>>();
const navigation = useNavigation<StackNavigationProp<RootStackParamList>>();
cLog("Initial Data:");
cLog(initialData);
cLog({"Initial Data": initialData});
let event = initialData.event ? initialData.event : initialData;
if(route.params)event = route.params?.event.event;
cLog("Event:");
cLog(event);
cLog({"Event":event});
const [formData, setFormData] = useState({
...event,
event_date: event.event_date ? new Date(event.event_date) : new Date(),
Expand Down
5 changes: 2 additions & 3 deletions app/genericMainPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ const GenericMainPageForm: React.FC<FormProps> = ({
if (route.thisPage === 'index') {
route.thisPage = getPageFromEventType(route.event.event_type) as keyof RootStackParamList;
}
cLog("Route:", route);
cLog({"Route": route});
navigation.navigate(getPageName(route.thisPage) as any, { event: route });
}

Expand Down Expand Up @@ -85,8 +85,7 @@ const GenericMainPageForm: React.FC<FormProps> = ({
setIsGoogleCalendarLinked(googleCalendarLinked);
}
const eventsArray = Array.isArray(events) ? events : response.data;
cLog(`eventsArray:`);
cLog(eventsArray);
cLog({'eventsArray':eventsArray});
const formattedEvents = eventsArray.map((event: any) => ({
id: eventIdFunc(event),
title: eventTitleFunc(event),
Expand Down
2 changes: 1 addition & 1 deletion backend/.idea/dataSources.local.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file modified backend/omniplanner.db
Binary file not shown.
2 changes: 1 addition & 1 deletion components/Types.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ export type GenericEventPageProps = {
fetchEndpoint?: string;
mainPage: string;
keyValue?: { key: string; value: string };
method: string;
method?: string;
};

export type EventParams = {
Expand Down
2 changes: 1 addition & 1 deletion components/apiCall.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { cLog } from './log';

export const call = async (endpoint: string, method: string, headers?: string, data?: any): Promise<AxiosResponse<any>> => {
const fullUrl = `${IPAddr}${endpoint}`;
cLog('Full URL:', fullUrl);
cLog('API Call URL:', fullUrl);

try {
const response = await axios({
Expand Down

0 comments on commit d989e05

Please sign in to comment.