Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

디자인 2차 QA #284

Merged
merged 3 commits into from
Jan 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 15 additions & 25 deletions src/components/DetailSectionBottom/ReviewItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -151,51 +151,41 @@ const Item: React.FC<ReviewInfoItemProps> = (props: ReviewInfoItemProps) => {
<div className="flex items-center ">
<div className="flex gap-2">
{!showMoreKeywords &&
keywords.slice(0, 2).map((keyword, idx) => (
keywords.slice(0, 1).map((keyword, idx) => (
<div
key={idx}
className="rounded-md bg-gray1 px-2 py-1 text-xs text-gray6">
{getEmoji(keyword.content)} {keyword.content}
</div>
))}
{keywords.length > 2 && !showMoreKeywords && (
{keywords.length > 1 && !showMoreKeywords && (
<div
className="rounded-md bg-gray1 px-2 py-1 text-xs text-gray6"
onClick={(e) => {
handleClickPlusButton(e);
}}>
+{keywords.length - 2}
+{keywords.length - 1}
</div>
)}
</div>

<div>
{showMoreKeywords &&
Array.from({ length: Math.ceil(keywords.length / 2) }).map(
(_, lineIdx) => (
{showMoreKeywords && (
<div className="flex flex-wrap gap-2">
{keywords.map((keyword, idx) => (
<div
key={lineIdx}
className={`flex gap-2 ${
lineIdx === Math.ceil(keywords.length / 2) - 1
? ''
: ' mb-3'
}`}>
{keywords
.slice(lineIdx * 2, lineIdx * 2 + 2)
.map((keyword, idx) => (
<div
key={idx}
className="rounded-md bg-gray1 px-2 py-1 text-xs text-gray6">
{getEmoji(keyword.content)} {keyword.content}
</div>
))}
key={idx}
className="rounded-md bg-gray1 px-2 py-1 text-xs text-gray6">
{getEmoji(keyword.content)} {keyword.content}
</div>
),
)}
))}
</div>
)}
</div>

<div className="ml-auto mr-2 flex ">
<div className="ml-auto mr-2 flex flex items-center ">
<ChatIcon size={20} color="#5E5E5E" />
<div className="ml-1 text-gray5">{commentCount}</div>
<div className="ml-1.5 text-gray5">{commentCount}</div>
</div>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/components/Review/CommentItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ const CommentItem: React.FC<CommentItemProps> = (props: CommentItemProps) => {
};

return (
<div className="border-b border-solid border-gray-300 py-[13px]">
<div className="border-b border-solid border-gray2 py-[13px]">
<div className=" flex items-center">
<div className="mr-4">
{!(
Expand Down
2 changes: 1 addition & 1 deletion src/components/Review/ReviewComments.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ export default function ReviewComments() {
댓글
<span className="pl-1 font-bold">{commentDataLength}</span>
</div>
<div className="h-[8px] bg-gray1"></div>
<div className="ml-[-20px] mr-[-20px] h-[8px] bg-gray1"></div>
<div className="flex flex-col">
{commentDataLength == 0 && (
<div className="mt-10 flex flex-col items-center justify-center text-sm text-gray4">
Expand Down
47 changes: 19 additions & 28 deletions src/components/Review/ReviewKeyword.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,38 +45,29 @@ export default function ReviewKeyword() {
}
};

// 5x2 형태로 배치하기 위해 행(row)과 열(column)을 계산
// const rows = 5;
const columns = 2;

return (
<>
<div className="mb-5 text-lg font-bold">어떤 점이 좋았나요? </div>
<div className="text-md mb-10 grid grid-cols-2 gap-2 font-bold">
{reviewKeywords?.data?.data?.keywords?.map(
(keyword: Keyword, index: number) => {
const row = Math.floor(index / columns) + 1;
const col = (index % columns) + 1;

const isSelected = selectedKeywords.some(
(selectedKeyword) =>
selectedKeyword.keywordId === keyword.keywordId,
);
<div className="mb-10 flex flex-wrap gap-2 text-[14px] font-bold">
{reviewKeywords?.data?.data?.keywords?.map((keyword: Keyword) => {
const isSelected = selectedKeywords.some(
(selectedKeyword) =>
selectedKeyword.keywordId === keyword.keywordId,
);

return (
<button
className={`flex items-center justify-center row-${row} col-${col} h-[40px] cursor-pointer rounded-md ${
isSelected
? 'bg-[#062139] text-white'
: 'bg-gray-100 text-gray-500'
} px-2 py-1`}
key={keyword.keywordId}
onClick={() => handleKeywordClick(keyword)}>
{keyword.content}
</button>
);
},
)}
return (
<button
className={`h-[40px] cursor-pointer items-center justify-center rounded-[30px] ${
isSelected
? 'bg-[#062139] text-white'
: 'bg-gray-100 text-gray-500'
} px-[14px] py-[8px]`}
key={keyword.keywordId}
onClick={() => handleKeywordClick(keyword)}>
{keyword.content}
</button>
);
})}
</div>
</>
);
Expand Down
5 changes: 2 additions & 3 deletions src/components/common/nav/InputComment.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -106,12 +106,11 @@ export const InputComment: React.FC<InputCommentProps> = () => {
};

return (
<div className="fixed bottom-0 mt-auto flex flex h-[64px] w-full items-center justify-center border border-solid border-[#EDEDED] bg-white ">
<div className="ml-4 mr-4 flex h-[40px] w-[375px] items-center rounded-md border border-solid border-[#EDEDED]">
<div className="fixed bottom-0 flex h-[64px] w-full max-w-[412px] items-center justify-center border border-solid border-[#EDEDED] bg-white">
<div className="ml-4 mr-4 flex h-[40px] w-full items-center rounded-md border border-solid border-[#EDEDED]">
<div className="pl-1 pr-0.5 text-sm font-bold text-[#29ddf6]">ㅣ</div>
<div className="flex w-full ">
<input
// ref={inputRef}
type="text"
placeholder="댓글을 입력하세요"
className=" w-full max-w-full text-sm placeholder-[#d7d7d7] outline-none"
Expand Down
Loading