Skip to content

Commit

Permalink
chore/fix: progressing modify recruit/fix create new recruit error - #1
Browse files Browse the repository at this point in the history
…, #15, #39
  • Loading branch information
byein committed Jan 20, 2023
1 parent d6fa841 commit a7718e6
Show file tree
Hide file tree
Showing 11 changed files with 184 additions and 230 deletions.
29 changes: 9 additions & 20 deletions baedalmate/src/components/atoms/CreateRecruit/CategorySelect.tsx
Original file line number Diff line number Diff line change
@@ -1,24 +1,8 @@
import React from 'react';
import {
Image,
NativeModules,
StyleSheet,
Text,
TextInput,
TouchableOpacity,
View,
} from 'react-native';
import {Image, NativeModules, Text, TouchableOpacity, View} from 'react-native';

import {TextKRReg} from 'themes/text';
import {Fonts} from 'assets/Fonts';
import {
BLACK_COLOR,
DARK_GRAY_COLOR,
PRIMARY_COLOR,
WHITE_COLOR,
} from 'themes/theme';
import {BLACK_COLOR, WHITE_COLOR} from 'themes/theme';
import {useNavigation} from '@react-navigation/native';
import {useController} from 'react-hook-form';

export interface RecruitItemProps {
createDate: string;
Expand All @@ -39,7 +23,6 @@ export interface RecruitItemProps {
}

const {StatusBarManager} = NativeModules;
type endStandardType = 'people' | 'price' | 'time';
export interface deliveryFeeProps {
i: number;
cnt: number;
Expand All @@ -51,7 +34,13 @@ export interface CategoryProps {
categoryName: string;
categoryImg: any;
}
const SelectCategoryItem = ({item}: {item: CategoryProps}) => {
const SelectCategoryItem = ({
item,
}: {
item: CategoryProps;
defaultItem?;
type?;
}) => {
const navigation = useNavigation();
return (
<TouchableOpacity
Expand Down
3 changes: 2 additions & 1 deletion baedalmate/src/components/atoms/CreateRecruit/MenuItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
*/

import {Fonts} from 'assets/Fonts';
import {formPrice} from 'components/utils/api/Recruit';
import React from 'react';
import {Image, StyleSheet, Text, TouchableOpacity, View} from 'react-native';
import {DARK_GRAY_COLOR, DELETE_ICON, WHITE_COLOR} from 'themes/theme';
Expand All @@ -25,7 +26,7 @@ const MenuItem = (props: MenuType) => {
<View>
<Text style={styles.menuItemTitle}>{props.menu}</Text>
<Text style={styles.menuItemSub}>
{props.cnt}개 · {props.price}{' '}
{props.cnt}개 · {formPrice(props.price)}{' '}
</Text>
</View>
</View>
Expand Down
11 changes: 2 additions & 9 deletions baedalmate/src/components/atoms/CreateRecruit/Tags.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,7 @@
import {BoardListProps} from 'components/molecules/BoardList/BoardList';
import React from 'react';
import {StyleSheet, View} from 'react-native';
import {TextKRBold, TextKRReg} from 'themes/text';
import {
LINE_GRAY_COLOR,
LINE_ORANGE_COLOR,
MAIN_GRAY_COLOR,
PRIMARY_COLOR,
WHITE_COLOR,
} from 'themes/theme';
import {TextKRReg} from 'themes/text';
import {LINE_GRAY_COLOR, PRIMARY_COLOR, WHITE_COLOR} from 'themes/theme';

const RecruitTag = ({text}: {text: string}) => {
return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import {useForm} from 'react-hook-form';
import {
KeyboardAvoidingView,
Modal,
NativeModules,
Platform,
StyleSheet,
TouchableOpacity,
Expand Down
24 changes: 18 additions & 6 deletions baedalmate/src/components/pages/CreateRecuit/CategorySelect.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
import React from 'react';
import {NativeModules, ScrollView, StyleSheet, View} from 'react-native';
import {ScrollView, View} from 'react-native';

import {Fonts} from 'assets/Fonts';
import {DARK_GRAY_COLOR, PRIMARY_COLOR, WHITE_COLOR} from 'themes/theme';
import {useForm} from 'react-hook-form';
import {WHITE_COLOR} from 'themes/theme';
import {categoryData} from 'components/molecules/Main/Category';
import SelectCategoryItem from 'components/atoms/CreateRecruit/CategorySelect';

Expand Down Expand Up @@ -31,7 +29,13 @@ export interface deliveryFeeProps {
setCnt: (cnt: number) => void;
}

const SelectCategoryPage = () => {
const SelectCategoryPage = props => {
console.log(props);
const defaultItem = props.route.params
? props.route.params.defaultItem
: null;
const type = props.route.params ? props.route.params.type : 'CREATE';
console.log(defaultItem, type);
return (
<View
style={{
Expand All @@ -46,7 +50,15 @@ const SelectCategoryPage = () => {
alignItems: 'center',
}}>
{categoryData.map(
(v, i) => i !== 0 && <SelectCategoryItem item={v} key={i} />,
(v, i) =>
i !== 0 && (
<SelectCategoryItem
item={v}
defaultItem={defaultItem}
type={type}
key={i}
/>
),
)}
</View>
</ScrollView>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ const PlaceSearch = props => {
locationList.documents[i].road_address_name,
x: locationList.documents[i].x,
y: locationList.documents[i].y,
data: props.route.params,
data: props.route.params.data,
});
}}>
<TextKRBold>선택</TextKRBold>
Expand Down
Loading

0 comments on commit a7718e6

Please sign in to comment.