Skip to content

Commit 2300d66

Browse files
committed
Merge branch 'dev' of https://github.com/APPS-sookmyung/2024-WELLET-client into fix/#232-img-preview
2 parents 59fbafd + ac858b4 commit 2300d66

File tree

3 files changed

+17
-6
lines changed

3 files changed

+17
-6
lines changed

src/components/CardInfo/CardInfo.jsx

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import * as S from './CardInfo.style';
77
export default function CardInfo({
88
id,
99
name,
10+
company,
1011
position,
1112
department,
1213
imageUrl,
@@ -31,18 +32,23 @@ export default function CardInfo({
3132
<S.Info>
3233
<S.Name isSelected={isSelected}>{name}</S.Name>
3334
<S.Role isSelected={isSelected}>
34-
{department} {department && position ? `/ ${position}` : position}
35+
{`${company || ''}${company && (department || position) ? ' / ' : ''}${department || ''}${department && position ? ' / ' : ''}${position || ''}`}
3536
</S.Role>
3637
</S.Info>
3738
</S.CardWrapper>
3839
{!isDeleteMode && (
3940
<S.ArrowIconWrapper>
40-
<Icon id='arrow-right' fill='none' width={13} height={13}/>
41+
<Icon id='arrow-right' fill='none' width={13} height={13} />
4142
</S.ArrowIconWrapper>
4243
)}
4344
{isDeleteMode && (
4445
<S.ArrowIconWrapper>
45-
<Icon id={isSelected ? 'circle-check' : 'circle'} fill='none' width={16} height={16}/>
46+
<Icon
47+
id={isSelected ? 'circle-check' : 'circle'}
48+
fill='none'
49+
width={16}
50+
height={16}
51+
/>
4652
</S.ArrowIconWrapper>
4753
)}
4854
</S.Card>

src/pages/HomePage/HomePage.jsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,11 @@ export default function HomePage() {
1212
const [myCardData, setMyCardData] = useState([]);
1313
const [cardsData, setCardsData] = useState([]);
1414
const [myCardId, setMyCardId] = useState(null);
15-
useVisibleCardsEffect(setVisibleList, cardsData);
15+
16+
useVisibleCardsEffect(
17+
setVisibleList,
18+
cardsData.sort((a, b) => b.id - a.id)
19+
);
1620

1721
async function fetchMyCard() {
1822
try {
@@ -97,6 +101,7 @@ export default function HomePage() {
97101
<CardInfo
98102
id={data.id}
99103
name={data.name}
104+
company={data.company}
100105
position={data.position}
101106
department={data.department}
102107
imageUrl={data.profImgUrl}

src/pages/ViewCardPage/ViewCardPage.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ export default function ViewCardPage() {
131131
return searchData.filter((data) => data.category === activeBadge?.name);
132132
};
133133

134-
const displayData = getDisplayData();
134+
const displayData = getDisplayData().sort((a, b) => b.id - a.id);
135135

136136
return (
137137
<>
@@ -170,9 +170,9 @@ export default function ViewCardPage() {
170170
id={data.id}
171171
key={data.id}
172172
name={data.name}
173+
company={data.company}
173174
position={data.position}
174175
department={data.department}
175-
company={data.company}
176176
imageUrl={data.profImgUrl}
177177
isDeleteMode={isDeleteMode}
178178
isSelected={selectedCards.includes(data.id)}

0 commit comments

Comments
 (0)