Skip to content

Commit

Permalink
fix: tab routing (#37)
Browse files Browse the repository at this point in the history
  • Loading branch information
natesawant authored Nov 18, 2024
1 parent 88397a1 commit fd32a5a
Show file tree
Hide file tree
Showing 11 changed files with 19 additions and 63 deletions.
12 changes: 0 additions & 12 deletions frontend/app/(app)/(tabs)/post.tsx

This file was deleted.

File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,19 +1,17 @@
import React, { useEffect, useState } from 'react';
import { View, Text, Modal, TouchableOpacity } from 'react-native';
import React, { useState } from 'react';
import { View, Text, Modal } from 'react-native';
import { useFormContext, Controller } from 'react-hook-form';
import ImagePicker from '../../../components/image-picker';
import BigText from '../../../components/bigtext';
import Input from '../../../components/input';
import Button from '../../../components/button';
import ImagePicker from '../../../../../components/image-picker';
import BigText from '../../../../../components/bigtext';
import Button from '../../../../../components/button';
import PageButton from './page-button';
import { router } from 'expo-router';
import Tag from '../../../components/tag';
import { apiConfig } from '../../../api/apiContext';
import { useAuthStore } from '../../../auth/authStore';
import Map from '../../../components/map';
import IconButton from '../../../components/icon-button';
import Tag from '../../../../../components/tag';
import { apiConfig } from '../../../../../api/apiContext';
import { useAuthStore } from '../../../../../auth/authStore';
import Map from '../../../../../components/map';
import IconButton from '../../../../../components/icon-button';
import { faAngleLeft } from '@fortawesome/free-solid-svg-icons';
import { number } from 'zod';
import { Location, FormFields } from '../_layout';

export default function PostCreationForm() {
Expand All @@ -33,6 +31,8 @@ export default function PostCreationForm() {
setValue('tags', newFish);
};

const API_BASE_URL = apiConfig;

const { control, trigger, handleSubmit } = useFormContext<FormFields>();

const getLocation = () => {
Expand All @@ -48,7 +48,7 @@ export default function PostCreationForm() {
}
console.log(postData);
try {
const response = await fetch('http://localhost:3000/divelog', {
const response = await fetch(`${API_BASE_URL}/divelog`, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
Expand Down Expand Up @@ -141,7 +141,7 @@ export default function PostCreationForm() {
outline="gray-400"
text="Choose Fish"
backgroundColor="white"
onPress={() => router.push('/tag-fish')}
onPress={() => router.push('./post/tag-fish')}
/>
) : (
<View className="flex flex-row border border-[#d2d9e2] rounded-md items-center pl-2 w-full min-h-[5vh] mb-5">
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';
import { View, Text, Image, TextInput } from 'react-native';
import { useFormContext } from 'react-hook-form';
import Tag from '../../components/tag';
import Tag from '../../../../components/tag';
import FishSearch from './components/fish-search';
import { Location, FormFields } from './_layout';

Expand Down Expand Up @@ -32,7 +32,7 @@ export default function TagFish() {
<View className="flex flex-row border border-[#d2d9e2] rounded-md items-center pl-2 w-full min-h-[5vh] mb-5">
<Image
className="h-[2.5vh] w-[2.5vh]"
source={require('../../assets/search.png')}
source={require('../../../../assets/search.png')}
/>
<View className="flex h-full w-full flex-row items-center flex-wrap items-center gap-2 p-2">
{tags.map((item, index) => {
Expand Down
1 change: 0 additions & 1 deletion frontend/app/(app)/_layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ const Layout = () => {
<Stack>
<Stack.Screen name="(tabs)" options={{ headerShown: false }} />
<Stack.Screen name="user" options={{ headerShown: false }} />
<Stack.Screen name="postcreation" options={{ headerShown: false }} />
<Stack.Screen name="divelog" options={{ headerShown: false }} />
</Stack>
);
Expand Down
32 changes: 0 additions & 32 deletions frontend/app/(app)/index.tsx

This file was deleted.

1 change: 0 additions & 1 deletion frontend/app/_layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,6 @@ const InitialLayout = () => {
<Stack>
<Stack.Screen name="(auth)" options={{ headerShown: false }} />
<Stack.Screen name="(app)" options={{ headerShown: false }} />
<Stack.Screen name="(postcreation)" />
</Stack>
);
};
Expand Down
4 changes: 3 additions & 1 deletion frontend/consts/onboarding.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { apiConfig } from "../api/apiContext";

export const ONBOARDING_DATA = [
{
title: 'Track and enhance your dives',
Expand All @@ -22,4 +24,4 @@ export const ONBOARDING_DATA = [
},
];

export const API_BASE_URL = 'http://localhost:3000';
export const API_BASE_URL = apiConfig;

0 comments on commit fd32a5a

Please sign in to comment.