Skip to content

Commit

Permalink
Merge pull request #117 from kimheonningg/fix/116/fix_minor_bugs
Browse files Browse the repository at this point in the history
#116 fix: fix minor bugs
  • Loading branch information
miikii41 authored Sep 27, 2024
2 parents 5350872 + 9ce2109 commit 158d9e3
Show file tree
Hide file tree
Showing 8 changed files with 237 additions and 143 deletions.
6 changes: 3 additions & 3 deletions src/common/FileBox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import { Files } from '../types/UserTypes';

export interface FileBoxProps {
data: Files;
setData: (r: Files) => void;
setData?: (r: Files) => void;
max: number;
}

Expand All @@ -37,7 +37,7 @@ const SelectView = styled.View`
const FileBox = ({ data, setData, max }: FileBoxProps) => {
const handleFileDelete = (index: number) => {
const newData = data.filter((v, i) => i !== index);
setData(newData);
setData?.(newData);
};

return (
Expand All @@ -46,7 +46,7 @@ const FileBox = ({ data, setData, max }: FileBoxProps) => {
<FilePicker
callback={r => {
console.log(r);
setData([{ name: r.name ? r.name : 'noname', uri: r.uri }]);
setData?.([{ name: r.name ? r.name : 'noname', uri: r.uri }]);
}}
disabled={data.length >= max}
style={styles.BoxView}>
Expand Down
8 changes: 4 additions & 4 deletions src/components/Auth/Reformer/CareerModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ export default function CareerModal({
setValue={v => {
handleContentChange(v, 'status');
}}
placeholder='예시) 재학, 휴학, 졸업, 수료'
placeholder="예시) 재학, 휴학, 졸업, 수료"
/>
</View>
);
Expand All @@ -169,15 +169,15 @@ export default function CareerModal({
setValue={v => {
handleContentChange(v, 'team');
}}
placeholder='예시) 소품디자인팀 인턴'
placeholder="예시) 소품디자인팀 인턴"
/>
<InputView
title="근무기간"
value={form.career[index].period}
setValue={v => {
handleContentChange(v, 'period');
}}
placeholder='예시) 6개월, 3년'
placeholder="예시) 6개월, 3년"
/>
</View>
);
Expand Down Expand Up @@ -220,7 +220,7 @@ export default function CareerModal({
setValue={v => {
handleContentChange(v, 'content');
}}
placeholder='예시) 최우수상'
placeholder="예시) 최우수상"
/>
</View>
);
Expand Down
5 changes: 5 additions & 0 deletions src/components/Auth/Reformer/ReformerProfilePage.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
const ReformerProfilePage: React.FC = () => {
return <></>;
};

export default ReformerProfilePage;
85 changes: 43 additions & 42 deletions src/components/Home/HomeMain.tsx
Original file line number Diff line number Diff line change
@@ -1,25 +1,9 @@
import { useCallback, useMemo, useRef, useEffect, useState } from 'react';
import { useState } from 'react';
import { Filter14M } from '../../styles/GlobalText';
import {
Text,
View,
StyleSheet,
TouchableOpacity,
Dimensions,
ScrollView,
SafeAreaView,
} from 'react-native';
import BottomSheet, { BottomSheetView } from '@gorhom/bottom-sheet';
import CustomHeader from '../../common/CustomHeader';
import { Tabs, MaterialTabBar } from 'react-native-collapsible-tab-view';
import { StackScreenProps } from '@react-navigation/stack';
import { HomeStackParams } from '../../pages/Home';
import TabViewSpot from '../../assets/common/TabViewSpot.svg';
import { Text, View, StyleSheet, TouchableOpacity } from 'react-native';
import CategoryDownButton from '../../assets/common/CategoryDownButton.svg';
import styled from 'styled-components/native';
import { PURPLE } from '../../styles/GlobalColor';
import DetailModal from './Market/GoodsDetailOptionsModal';
import CategoryDropDown from './Market/SortingOptionModal';
import DropDown from '../../assets/common/DropDown.svg';

const HomeTabViewBox = styled.View`
Expand Down Expand Up @@ -61,19 +45,23 @@ const CategoryButton = styled.TouchableOpacity<{ pressed: boolean }>`
border-radius: 12px;
border-width: 1px;
border-color: #612fef;
background-color: ${(props) => (props.pressed ? '#612FEF' : '#FFFFFF')};
background-color: ${(
{ props }: { props: any }, // TODO: 나중에 props의 type specify 필요
) => (props.pressed ? '#612FEF' : '#FFFFFF')};
`;

const CategoryButtonText = styled.Text<{ pressed: boolean }>`
color: ${(props) => (props.pressed ? '#FFFFFF' : '#222222')};
color: ${(
{ props }: { props: any }, // TODO: 나중에 props의 type specify 필요
) => (props.pressed ? '#FFFFFF' : '#222222')};
`;

interface SignupProps {
mail: string;
domain: string;
password: string;
region: string;
}// 의미 없음
} // 의미 없음

interface HomeTabViewProps {
onSearch: () => void;
Expand Down Expand Up @@ -127,29 +115,42 @@ const HomeTabView = ({
<>
<CategoryBox>
<View>
<CategoryButton pressed={isStyleSelected} onPress={() => setModalOpen(true)}>
<CategoryButton
pressed={isStyleSelected}
onPress={() => setModalOpen(true)}>
<CategoryButtonText pressed={isStyleSelected}>
스타일
</CategoryButtonText>
<CategoryDownButton />
</CategoryButton>
</View>
<View style={{ flex: 1 }}>
</View>
<View style={{ flex: 1 }}></View>
<View style={styles.dropdownContainer}>
<TouchableOpacity onPress={toggleDropdown} style={styles.dropdownButton}>
<TouchableOpacity
onPress={toggleDropdown}
style={styles.dropdownButton}>
<Text style={styles.dropdownButtonText}>{selectedOption}</Text>
<DropDown/>
<DropDown />
</TouchableOpacity>
{dropdownOpen && (
<View style={styles.dropdownMenu}>
{['추천순', '인기순', '가격순', '최신순', '판매순'].map(option => (
<TouchableOpacity key={option} onPress={() => selectOption(option)} style={styles.dropdownOption}>
<Text style={selectedOption === option ? styles.dropdownSelectedOptionText : styles.dropdownOptionText}>
{option}
</Text>
</TouchableOpacity>
))}
{['추천순', '인기순', '가격순', '최신순', '판매순'].map(
option => (
<TouchableOpacity
key={option}
onPress={() => selectOption(option)}
style={styles.dropdownOption}>
<Text
style={
selectedOption === option
? styles.dropdownSelectedOptionText
: styles.dropdownOptionText
}>
{option}
</Text>
</TouchableOpacity>
),
)}
</View>
)}
</View>
Expand Down Expand Up @@ -196,8 +197,8 @@ const styles = StyleSheet.create({
},
dropdownButtonText: {
fontSize: 14,
fontStyle: "normal",
fontWeight: "400",
fontStyle: 'normal',
fontWeight: '400',
lineHeight: 24,
marginRight: 5,
color: '#000',
Expand All @@ -213,24 +214,24 @@ const styles = StyleSheet.create({
borderRadius: 4,
zIndex: 1000,
width: 100,
elevation: 5,
elevation: 5,
},
dropdownOption: {
padding: 10,
},
dropdownSelectedOptionText: {
fontFamily: "Pretendard Variable",
fontFamily: 'Pretendard Variable',
fontSize: 14,
fontStyle: "normal",
fontWeight: "400",
fontStyle: 'normal',
fontWeight: '400',
lineHeight: 24,
color: '#000',
},
dropdownOptionText: {
fontFamily: "Pretendard Variable",
fontFamily: 'Pretendard Variable',
fontSize: 14,
fontStyle: "normal",
fontWeight: "600",
fontStyle: 'normal',
fontWeight: '600',
lineHeight: 16,
},
});
39 changes: 18 additions & 21 deletions src/components/Home/Market/GoodsDetailOptionsModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,10 @@ import React, {
useRef,
useState,
} from 'react';
import { View, Text, StyleSheet, TouchableOpacity, Dimensions } from 'react-native';
import { View, StyleSheet, Dimensions } from 'react-native';
import styled from 'styled-components/native';
import {
BottomSheetModal,
BottomSheetBackdrop,
} from '@gorhom/bottom-sheet';
import { Body16M, Subtitle16B, Filter11B, Filter14B } from '../../../styles/GlobalText';
import Select from '../../../assets/common/Select.svg';
import Unselect from '../../../assets/common/Unselect.svg';
import { BottomSheetModal, BottomSheetBackdrop } from '@gorhom/bottom-sheet';
import { Subtitle16B, Filter11B } from '../../../styles/GlobalText';
import Dot from '../../../assets/common/Dot.svg';
import { PURPLE } from '../../../styles/GlobalColor';

Expand All @@ -39,12 +34,16 @@ const StyleButton = styled.TouchableOpacity<{ pressed: boolean }>`
align-items: center;
gap: 10px;
border-radius: 12px;
border: 1px solid #612FEF;
background-color: ${(props) => (props.pressed ? '#612FEF' : '#FFFFFF')};
border: 1px solid #612fef;
background-color: ${(
{ props }: { props: any }, // TODO: 나중에 props의 type specify 필요
) => (props.pressed ? '#612FEF' : '#FFFFFF')};
`;

const StyleButtonText = styled.Text<{ pressed: boolean }>`
color: ${(props) => (props.pressed ? '#FFFFFF' : '#222222')};
color: ${(
{ props }: { props: any }, // TODO: 나중에 props의 type specify 필요
) => (props.pressed ? '#FFFFFF' : '#222222')};
`;

interface ModalProps {
Expand All @@ -62,7 +61,7 @@ export default function DetailModal({
value,
setValue,
selectedStyles,
setSelectedStyles
setSelectedStyles,
}: ModalProps) {
// ref
const bottomSheetModalRef = useRef<BottomSheetModal>(null);
Expand Down Expand Up @@ -122,8 +121,8 @@ export default function DetailModal({
};

const toggleStyleSelection = (style: string) => {
setSelectedStyles((prev) =>
prev.includes(style) ? prev.filter((s) => s !== style) : [...prev, style]
setSelectedStyles(prev =>
prev.includes(style) ? prev.filter(s => s !== style) : [...prev, style],
);
};

Expand All @@ -138,8 +137,7 @@ export default function DetailModal({
snapPoints={snapPoints}
backdropComponent={renderBackdrop}
onChange={handleSheetChanges}
containerStyle={styles.modalContainer}
>
containerStyle={styles.modalContainer}>
<View style={styles.selectItem}>
<Subtitle16B>스타일</Subtitle16B>
<View style={styles.rightSection}>
Expand All @@ -148,12 +146,11 @@ export default function DetailModal({
</View>
</View>
<StyleBox>
{styleOptions.map((style) => (
{styleOptions.map(style => (
<StyleButton
key={style}
pressed={selectedStyles.includes(style)}
onPress={() => toggleStyleSelection(style)}
>
onPress={() => toggleStyleSelection(style)}>
<StyleButtonText pressed={selectedStyles.includes(style)}>
{style}
</StyleButtonText>
Expand Down Expand Up @@ -232,7 +229,7 @@ const styles = StyleSheet.create({
modalContainer: {
zIndex: 1001,
flex: 1,
justifyContent: 'flex-end',
margin: 0,
justifyContent: 'flex-end',
margin: 0,
},
});
Loading

0 comments on commit 158d9e3

Please sign in to comment.