Skip to content

Commit

Permalink
Merge pull request #783 from sparcs-kaist/781-757의-버그-함께-탑승하는-인원이-없을-…
Browse files Browse the repository at this point in the history
…때-신고하기-기능-제거

함께 탑승하는 인원이 없을 때, 신고하기 기능 제거
  • Loading branch information
jyjy1229 authored May 1, 2024
2 parents 8c8d257 + 9af8598 commit 88dcd7a
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
10 changes: 8 additions & 2 deletions packages/web/src/components/Chat/Header/SideMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,8 @@ const SideMenu = ({ roomInfo, isOpen, setIsOpen }: SideMenuProps) => {
const onClickCallTaxi = useCallback(() => setIsOpenCallTaxi(true), []);
const onClickReport = useCallback(() => setIsOpenReport(true), []);

const isAlone = roomInfo.part.length === 1;

const styleBackground = {
position: "absolute" as any,
top: 0,
Expand Down Expand Up @@ -192,8 +194,12 @@ const SideMenu = ({ roomInfo, isOpen, setIsOpen }: SideMenuProps) => {
<SideMenuButton type="share" onClick={onClikcShare} />
<DottedLine />
<SideMenuButton type="taxi" onClick={onClickCallTaxi} />
<DottedLine />
<SideMenuButton type="report" onClick={onClickReport} />
{!isAlone && (
<>
<DottedLine />
<SideMenuButton type="report" onClick={onClickReport} />
</>
)}
</div>
<DottedLine />
<div css={styleNameSection} onClick={onClickCancel}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ const MessageSet = ({ chats, layoutType, roomInfo }: MessageSetProps) => {
const authorName = "authorName" in chats?.[0] ? chats?.[0].authorName : "";

const isBot = authorId === "bot";
const isAlone = roomInfo.part.length === 1;

const style = {
position: "relative" as any,
Expand Down Expand Up @@ -148,8 +149,11 @@ const MessageSet = ({ chats, layoutType, roomInfo }: MessageSetProps) => {
<div css={styleProfileSection}>
{authorId !== userOid && (
<div
css={{ ...styleProfile, cursor: !isBot ? "pointer" : undefined }}
onClick={() => !isBot && onClickProfileImage()}
css={{
...styleProfile,
cursor: !isBot && !isAlone ? "pointer" : undefined,
}}
onClick={() => !isBot && !isAlone && onClickProfileImage()}
>
{isBot ? (
<TaxiIcon css={{ width: "100%", height: "100%" }} />
Expand Down

0 comments on commit 88dcd7a

Please sign in to comment.