Skip to content

Commit

Permalink
#14 feat :added hashtag logic, detailList logic. fixed page UIs (#60)
Browse files Browse the repository at this point in the history
* #14 feat : fixed goods detail page, added review.svg file

* feat/14/ui_fix: fixed DetailBox (added Review at the bottom), reformed GoodsDetailBox, made NEW Reviews.tsx

* 1. UI fix
2. List select/delete logic

* 4.8
  • Loading branch information
Dindb-dong authored Apr 10, 2024
1 parent f310f4d commit 4320676
Show file tree
Hide file tree
Showing 7 changed files with 746 additions and 200 deletions.
6 changes: 3 additions & 3 deletions ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1380,7 +1380,7 @@ EXTERNAL SOURCES:
:path: "../node_modules/react-native/ReactCommon/yoga"

SPEC CHECKSUMS:
boost: 26fad476bfa736552bbfa698a06cc530475c1505
boost: d3f49c53809116a5d38da093a8aa78bf551aed09
CocoaAsyncSocket: 065fd1e645c7abab64f7a6a2007a48038fdc6a99
DoubleConversion: fea03f2699887d960129cc54bba7e52542b6f953
FBLazyVector: fbc4957d9aa695250b55d879c1d86f79d7e69ab4
Expand All @@ -1394,7 +1394,7 @@ SPEC CHECKSUMS:
Flipper-PeerTalk: 116d8f857dc6ef55c7a5a75ea3ceaafe878aadc9
FlipperKit: 37525a5d056ef9b93d1578e04bc3ea1de940094f
fmt: ff9d55029c625d3757ed641535fd4a75fedc7ce9
glog: 035f1e36e53b355cf70f6434d161b36e7d21fecd
glog: c5d68082e772fa1c511173d6b30a9de2c05a69a2
hermes-engine: b361c9ef5ef3cda53f66e195599b47e1f84ffa35
libevent: 4049cae6c81cdb3654a443be001fb9bdceff7913
OpenSSL-Universal: ebc357f1e6bc71fa463ccb2fe676756aff50e88c
Expand Down Expand Up @@ -1452,7 +1452,7 @@ SPEC CHECKSUMS:
RNScreens: b582cb834dc4133307562e930e8fa914b8c04ef2
RNSVG: ba3e7232f45e34b7b47e74472386cf4e1a676d0a
SocketRocket: f32cd54efbe0f095c4d7594881e52619cfe80b17
Yoga: 13c8ef87792450193e117976337b8527b49e8c03
Yoga: e64aa65de36c0832d04e8c7bd614396c77a80047

PODFILE CHECKSUM: eb490ed861c0caf2f2649ac9503532c4cce2d3d8

Expand Down
12 changes: 10 additions & 2 deletions ios/upcy.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -690,7 +690,11 @@
"-DFOLLY_USE_LIBCPP=1",
"-DFOLLY_CFG_NO_COROUTINES=1",
);
OTHER_LDFLAGS = "$(inherited)";
OTHER_LDFLAGS = (
"$(inherited)",
"-Wl",
"-ld_classic",
);
REACT_NATIVE_PATH = "${PODS_ROOT}/../../node_modules/react-native";
SDKROOT = iphoneos;
USE_HERMES = true;
Expand Down Expand Up @@ -759,7 +763,11 @@
"-DFOLLY_USE_LIBCPP=1",
"-DFOLLY_CFG_NO_COROUTINES=1",
);
OTHER_LDFLAGS = "$(inherited)";
OTHER_LDFLAGS = (
"$(inherited)",
"-Wl",
"-ld_classic",
);
REACT_NATIVE_PATH = "${PODS_ROOT}/../../node_modules/react-native";
SDKROOT = iphoneos;
USE_HERMES = true;
Expand Down
6 changes: 4 additions & 2 deletions src/common/Hashtag.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,19 @@ interface HashtagProps {
onPress?: () => void;
}

const Hashtag = ({value, pressable, pressed, onPress} : HashtagProps) => {
const Hashtag = ({ value, pressable, pressed, onPress }: HashtagProps) => {
return (
<HashtagContainer pressed={pressed} onPress={onPress} disabled={!pressable}>
<Subtitle16M style={{color: pressed ? 'white' : BLACK }}>{value}</Subtitle16M>
<Subtitle16M style={{ color: pressed ? 'white' : BLACK }}>{value}</Subtitle16M>
<Text style={{ color: GRAY, fontSize: 16, fontWeight: 'bold' }}> X</Text>
</HashtagContainer>
)
}

const HashtagContainer = styled.TouchableOpacity<{ pressed: boolean }>`
display: flex;
border-radius: 12px;
flex-direction: row;
justify-content: center;
align-items: center;
padding: 4px 16px;
Expand Down
2 changes: 1 addition & 1 deletion src/common/InputBox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { BLACK2 } from '../styles/GlobalColor';

export interface InputBoxProps extends TextInputProps {
value?: string;
setValue: (value: string) => void;
setValue?: (value: string) => void;
placeholder?: string;
long?: boolean;
style?: TextStyle;
Expand Down
153 changes: 153 additions & 0 deletions src/components/Home/Market/FilterElement.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,153 @@
import { useState } from 'react';
import { View, Dimensions, Alert } from 'react-native';
import Filter from "../../../common/Filter";
import { Body14B, Body14M, Body16B, Caption11M, Subtitle18B, Subtitle16M, Subtitle18M } from "../../../styles/GlobalText";
import { BLACK2, GRAY, LIGHTGRAY, PURPLE } from "../../../styles/GlobalColor";

type filterType = 'style' | 'material' | 'fit' | 'detail' | 'category';

type filterListType = {
[key in filterType]: string[];
};

interface filterElementProps {
list: string[];
onPress: (type: string, value: string) => void;
type: filterType;
setPressable?: (value: string) => boolean;
label?: string;
}

const FilterElement = ({
list,
onPress,
type,
label,
setPressable,
}: filterElementProps) => {
const defaultFilter: filterListType = {
style: [],
material: [],
fit: [],
detail: [],
category: [],
}
const [filters, setFilters] = useState(defaultFilter);
const filterList: filterListType = {
style: [
'빈티지',
'미니멀',
'캐주얼',
'페미닌',
'글램',
'스트릿',
'키치',
'스포티',
'홈웨어',
'걸리시',
],
material: [
'폴리에스테르',
'면',
'가죽',
'스웨이드',
'울',
'캐시미어',
'데님',
'플라스틱',
],
fit: ['노멀', '타이트', '오버사이즈', '와이드'],
detail: [
'지퍼',
'단추',
'셔링',
'포켓',
'워싱',
'집업',
'프릴',
'보(리본)',
'크롭',
'칼라',
'금속',
'비즈',
],
category: [
"아우터",
"상의",
"하의",
"가방",
"모자",
"잡화",
],
};
const ifUnpressable = (value: string) => {
if (
filters.category.length == 1 || filters.fit.length == 1 || filters.material.length == 1
)
return false;
else return true;
};
const handleSeveralPress = (value: string) => {
if (filters.style.includes(value) || filters.detail.includes(value)) {
setFilters(prev => {
return { ...prev, style: prev.style.filter(v => v !== value) };
});
} else {
setFilters(prev => {
return { ...prev, style: [...prev.style, value] };
});
}
};
const handleOnePress = (value: string) => {
if (ifUnpressable(value)) {
Alert.alert('한 개만 선택해주세요');
return;
} else if (filters.material.includes(value) || filters.fit.includes(value) || filters.category.includes(value)) {
setFilters(prev => {
return { ...prev, material: prev.material.filter(v => v !== value) };
});
} else {
setFilters(prev => {
return { ...prev, material: [...prev.material, value] };
});
}
}
return (
<View style={{ borderBottomWidth: 1, borderBottomColor: "#DFDFDF" }}>
<View style={{ margin: 10, marginTop: 18 }}>
<View style={{ flexDirection: 'row', justifyContent: 'space-between', alignItems: 'center', alignContent: 'center' }}>
<Subtitle16M style={{ color: "#22222" }}>{label}
{(type == "style" || type == "category" || type == "material") &&
<Subtitle18B style={{ color: PURPLE }}> *</Subtitle18B>
}
</Subtitle16M>
{(type == "detail" || type == "style") &&
<Caption11M style={{ color: PURPLE }}>● 중복가능</Caption11M>
}
</View>
<View
style={{
flexDirection: 'row',
flexWrap: 'wrap',
marginTop: 12,
}}>
{filterList[type].map((value, index) => {
return (
<Filter
value={value}
pressed={list.includes(value)}
pressable={setPressable ? setPressable(value) : true}
onPress={() => {
onPress(type, value);
}}
key={index}
/>
);
})}
</View>
</View>
</View>
);
};

export default FilterElement;
Loading

0 comments on commit 4320676

Please sign in to comment.