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

[CZ-536] detail qa #111

Merged
merged 4 commits into from
Jul 28, 2023
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
16 changes: 11 additions & 5 deletions apps/web/components/detail/Comment.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,10 @@ function Comment({ comment, mutateDeleteComment, mutateLike, mutateHate }: Props
<CommentInfo>
<div>{createdDate.slice(0, 10)}</div>
<Comma />
<div onClick={mutateLike}>❀️ μ’‹μ•„μš” {likeCount}</div> <Comma />
<div onClick={mutateHate}>πŸ–€ μ‹«μ–΄μš” {hateCount}</div> <Comma />
<InteractionButton onClick={mutateLike}>❀️ μ’‹μ•„μš” {likeCount}</InteractionButton>{" "}
<Comma />
<InteractionButton onClick={mutateHate}>πŸ–€ μ‹«μ–΄μš” {hateCount}</InteractionButton>{" "}
<Comma />
<div>λ‹΅κΈ€μ“°κΈ°</div>
</CommentInfo>
</ContentsBox>
Expand All @@ -76,9 +78,7 @@ function Comment({ comment, mutateDeleteComment, mutateLike, mutateHate }: Props
}}
/>
</div>
{toggleMenu && (
<ModifyDeleteButtonBox isDeleteButton onDelete={onToggleWarningModal} right="20px" />
)}
{toggleMenu && <ModifyDeleteButtonBox onDelete={onToggleWarningModal} right="20px" />}
{toggleWarningModal && (
<CommentDeleteModal onToggleModal={onToggleWarningModal} onSubmit={mutateDeleteComment} />
)}
Expand Down Expand Up @@ -162,4 +162,10 @@ const Comma = styled.div`
`}
`;

const InteractionButton = styled.div`
:active {
transform: scale(1.15);
}
`;

export default Comment;
25 changes: 24 additions & 1 deletion apps/web/components/detail/VoteAnalyzeBar.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import Image from "next/image";
import { DarkAString, DarkBString, LightBString } from "public/icons";
import React from "react";
import styled, { css } from "styled-components";
import { AorB } from "types/vote";

interface Props {
percentageA: number;
Expand All @@ -22,10 +23,32 @@ function VoteAnalyzeBar({ percentageA, percentageB, totalCountA, totalCountB }:
) : (
<AnalyzeBar>
<Share selected={isSelectedA} share={percentageA}>
{isSelectedA && (
<Image
src={DarkAString}
alt="A"
style={{
width: "12px",
height: "15px",
marginRight: "8px",
}}
/>
)}
{percentageA}% &nbsp;
<div className="number">{totalCountA.toLocaleString()}λͺ…</div>
</Share>
<Share selected={!isSelectedA} share={percentageB}>
{!isSelectedA && (
<Image
src={LightBString}
alt="A"
style={{
width: "12px",
height: "15px",
marginRight: "8px",
}}
/>
)}
{percentageB}% &nbsp;
<div className="number">{totalCountB.toLocaleString()}λͺ…</div>
</Share>
Expand Down
2 changes: 2 additions & 0 deletions apps/web/components/detail/VoteContainer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import DetailAB from "./DetailAB";
import FilterBar from "./FilterBar";
import useFilterStatistics from "./hooks/useFilterStatistics";
import VoteAnalyzeBar from "./VoteAnalyzeBar";
import VoteWriterBox from "./VoteWriterBox";

function VoteContainer({ postId }: { postId: number }) {
const [isModifyModal, onToggleModifyModal] = useToggle(false);
Expand Down Expand Up @@ -57,6 +58,7 @@ function VoteContainer({ postId }: { postId: number }) {

return (
<>
<VoteWriterBox writer={writer} />
<ChipContainer
onToggleModifyModal={onToggleModifyModal}
onToggleModifyDeleteButtonBox={onToggleModifyDeleteButtonBox}
Expand Down
92 changes: 92 additions & 0 deletions apps/web/components/detail/VoteWriterBox.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
import Image from "next/image";
import { PurpleMonster } from "public/images";
import React from "react";
import styled, { css } from "styled-components";

interface Props {
writer: {
userImage: string | null;
userGender: string;
userAge: number;
userMbti: string;
nickName: null;
};
}

function VoteWriterBox({ writer }: Props) {
const { nickName, userAge, userGender, userImage, userMbti } = writer;
return (
<Container>
<Image
src={userImage || PurpleMonster}
alt="λŒ“κΈ€ ν”„λ‘œν•„"
style={{
width: "40px",
height: "40px",
borderRadius: "8px",
}}
/>
<ContentsBox>
<Flex>
<TagBox>
{userGender}
<DivideTag /> {userAge}
<DivideTag /> {userMbti}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

p5: 곡톡 μ»΄ν¬λ„ŒνŠΈμ— DivideLine이라고 μžˆλŠ”λ° κ·Έκ±° μ‚¬μš©μ€ νž˜λ“€κΉŒμš”?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ν™•μΈν•΄λ³΄λ‹ˆ DivideLineκ³Ό μ»¬λŸ¬κ°€ λ‹¬λΌμ„œ κ·Έλƒ₯ μ‚¬μš©ν•˜κΈ°λŠ” νž˜λ“€κ³  μ • μž¬ν™œμš©μ„ ν•˜λ €λ©΄
DivideLineμ—μ„œ 컬러λ₯Ό λ³€κ²½ν•  수 μžˆλ„λ‘ μˆ˜μ •ν•˜λŠ” λ°©λ²•λ°–μ—λŠ” 없을거 κ°™μ•„μš”
그런데 리뉴얼 μ§μ „μž„μ„ κ³ λ €ν•˜λ©΄ κ³Όνˆ¬μžκ°€ μ•„λ‹κΉŒ ν•˜λŠ” 생각이 λ“€κΈ΄ν•©λ‹ˆλ‹€

</TagBox>
</Flex>
<NickName> {nickName}</NickName>
</ContentsBox>
</Container>
);
}

const Container = styled.div`
display: flex;
justify-content: flex-start;
gap: 8px;
position: relative;
padding-bottom: 14px;
`;

const NickName = styled.div`
font-weight: 700;
${({ theme }) => css`
color: ${theme.palette.ink.darker};
${theme.textStyle.Font_Regular}
`}
`;

const Flex = styled.div`
display: flex;
align-items: center;
gap: 6px;
`;

const DivideTag = styled.div`
width: 1px;
height: 8px;
margin: 0 4px;
${({ theme }) => css`
background-color: ${theme.palette.background.selected};
`}
`;

const TagBox = styled.div`
display: flex;
align-items: center;
padding: 3px 4px;
width: auto;
${({ theme }) => css`
background-color: ${theme.palette.background.soft};
color: ${theme.palette.ink.base};
${theme.textStyle.Font_Minimum}
`}
`;

const ContentsBox = styled.div`
display: flex;
flex-direction: column;
flex: 1 1 auto;
`;

export default VoteWriterBox;
Binary file added apps/web/public/icons/Dark-A.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added apps/web/public/icons/Dark-B.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added apps/web/public/icons/Light-A.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added apps/web/public/icons/Light-B.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions apps/web/public/icons/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,7 @@ export { default as AlertIcon } from "./AlertIcon.png";
export { default as MoreIcon } from "./MoreIcon.png";
export { default as MyPageIcon } from "./MyPageIcon.png";
export { default as Back } from "./Back.png";
export { default as LightAString } from "./Light-A.png";
export { default as DarkAString } from "./Dark-A.png";
export { default as LightBString } from "./Light-B.png";
export { default as DarkBString } from "./Dark-B.png";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

p5: svg둜 λ„£λŠ”κ²Œ μ’‹μ•˜μ„ 것 κ°™λ‹€λŠ” 생각이 λ“œλ„€μš”!

Copy link
Member Author

@leejiho9898 leejiho9898 Jul 24, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

쒋은 의견인거 κ°™μ•„μš” κ°μ‚¬ν•©λ‹ˆλ‹€