Skip to content

Commit

Permalink
orderpage
Browse files Browse the repository at this point in the history
status: pending
  • Loading branch information
miikii41 committed Feb 19, 2025
1 parent ffc9944 commit 6019eff
Show file tree
Hide file tree
Showing 8 changed files with 839 additions and 290 deletions.
64 changes: 33 additions & 31 deletions App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,36 +38,6 @@ const GlobalTheme = {
},
};

function App(): React.JSX.Element {
const [isSplashFinished, setIsSplashFinished] = useState(false);

const finishSplash = () => {
console.log('finished');
setIsSplashFinished(true);
};

return (
<BottomBarProvider>
<GestureHandlerRootView style={{ flex: 1 }}>
<LoginProvider>
<NavigationContainer theme={GlobalTheme}>
{!isSplashFinished ? (
<SplashScreen onFinish={finishSplash} />
) : (
<UserProvider>
<AppStack.Navigator screenOptions={{ headerShown: false }}>
<AppStack.Screen name="Main" component={MainTabNavigator} />
<AppStack.Screen name="Signin" component={SignIn} />
</AppStack.Navigator>
</UserProvider>
)}
</NavigationContainer>
</LoginProvider>
</GestureHandlerRootView>
</BottomBarProvider>
);
}

export type TabProps = {
UPCY: undefined;
MY: undefined;
Expand Down Expand Up @@ -185,4 +155,36 @@ const MainTabNavigator = () => {
);
};

export default App;

function App(): React.JSX.Element {
const [isSplashFinished, setIsSplashFinished] = useState(false);

const finishSplash = () => {
console.log('finished');
setIsSplashFinished(true);
};

return (
<BottomBarProvider>
<GestureHandlerRootView style={{ flex: 1 }}>
<LoginProvider>
<NavigationContainer theme={GlobalTheme}>
{!isSplashFinished ? (
<SplashScreen onFinish={finishSplash} />
) : (
<UserProvider>
<AppStack.Navigator screenOptions={{ headerShown: false }}>
<AppStack.Screen name="Main" component={MainTabNavigator} />
<AppStack.Screen name="Signin" component={SignIn} />
</AppStack.Navigator>
</UserProvider>
)}
</NavigationContainer>
</LoginProvider>
</GestureHandlerRootView>
</BottomBarProvider>
);
}


export default App;
13 changes: 9 additions & 4 deletions src/components/Auth/Upcyer/UpcyerMyPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,14 @@ import Login from '../../../components/Auth/Login';

import Request from '../../../common/requests';
import OrderPage from '../../../components/Home/Order/OrderPage';
import OrderManagement from '../../../components/Home/Order/OrderManagement';
import { CommonActions, useFocusEffect } from '@react-navigation/native';
import { print } from '@gorhom/bottom-sheet/lib/typescript/utilities/logger';
import { TabProps } from '../../../../App';
import { PhotoType } from '../../../hooks/useImagePicker';
import { MyPageStackParams, MypageStackProps } from '../../../pages/MyPage';
import DeleteModal from '../DeleteModal';
import { OrderStackParams } from '../Order/OrderManagement';

export const UpcyerMyPageMainScreen = ({ navigation, route }: MypageStackProps) => {
const ProfileSection = ({
Expand Down Expand Up @@ -128,6 +130,9 @@ export const UpcyerMyPageMainScreen = ({ navigation, route }: MypageStackProps)
setUserInfo(route.params.userInfo);
}
}, [route.params?.userInfo]);
useEffect(() => {
console.log(JSON.stringify(navigation.getState(), null, 2));
}, [navigation]);

const getProfile = async () => {
// 유저 프로필 가져오기-> setUserInfo로 관리
Expand Down Expand Up @@ -337,16 +342,16 @@ export const UpcyerMyPageMainScreen = ({ navigation, route }: MypageStackProps)
/>
)}>
{routes.map(route_ => (
(<Tabs.Tab key={route_.key} name={route_.title}>
{route_.key === 'order' && <OrderPage flatListRef={flatListRef} navigation={navigation} route={route} />}
<Tabs.Tab key={route_.key} name={route_.title}>
{route_.key === 'order' && <OrderPage />}
{/* {route.key === 'like' &&
<View>
<ReviewPage flatListRef={flatListRef} />
<ScrollToTopButton flatListRef={flatListRef} />
</View>}
</View>} */}
</Tabs.Tab>)
))}
)}
</Tabs.Container>
<DeleteModal
visible={modalVisible}
Expand All @@ -357,4 +362,4 @@ export const UpcyerMyPageMainScreen = ({ navigation, route }: MypageStackProps)
/>
</SafeAreaView>
);
};
};
11 changes: 9 additions & 2 deletions src/components/Home/Order/OrderManagement.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ import Rejection from '../Quotation/Rejection.tsx';
import SentRejection from '../Quotation/SentRejection.tsx';
import NewOrders from './NewOrders.tsx';
import QuotationForm from '../Quotation/QuotationForm.tsx';
import QuotationReview from '../Quotation/QuotationReview.tsx';
import { useCallback, useContext, useEffect, useRef, useState } from 'react';
import { LoginContext } from '../../../common/Context';
import { getUserRole } from '../../../common/storage';

// type OrderInfoType = {
// id: string;
Expand All @@ -33,6 +37,7 @@ export type OrderProps = {
navigation: any;
route: any;
flatListRef?: React.RefObject<FlatList<any>>;
QuotationReview: {order:any};
}

export type OrderStackParams = {
Expand All @@ -50,6 +55,7 @@ export type OrderStackParams = {
QuotationConfirm: undefined;
Rejection: undefined;
SentRejection: undefined;
QuotationReview: QuotationProps;
}

const OrderStack = createStackNavigator<OrderStackParams>();
Expand All @@ -71,7 +77,7 @@ const OrderStack = createStackNavigator<OrderStackParams>();
// }

const OrderManagement = ({
// navigation, route
// navigation, route
}: BottomTabScreenProps<TabProps, '주문관리'>) => {

return (
Expand Down Expand Up @@ -109,10 +115,11 @@ const OrderManagement = ({
<OrderStack.Screen name="QuotationConfirm" component={QuotationConfirm} />
<OrderStack.Screen name="Rejection" component={Rejection} />
<OrderStack.Screen name="SentRejection" component={SentRejection} />
<OrderStack.Screen name="QuotationReview" component={QuotationReview} />

</OrderStack.Navigator>
</SafeAreaView>
);
};

export default OrderManagement;
export default OrderManagement;
Loading

0 comments on commit 6019eff

Please sign in to comment.