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

taxi fare 관련 컴포넌트 백엔드 미동작시 숨김 #804

Merged
Show file tree
Hide file tree
Changes from 1 commit
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
20 changes: 12 additions & 8 deletions packages/web/src/components/Chat/Header/SideMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -213,15 +213,19 @@ const SideMenu = ({ roomInfo, isOpen, setIsOpen }: SideMenuProps) => {
</div>
</div>
<DottedLine />
<div css={styleInfoSection}>
<div css={{ display: "flex", gap: "8px" }}>
<WalletRoundedIcon style={styleIcon} />
<div css={{ ...styleInfo }}>
예상 택시비 : {taxiFare.toLocaleString("ko-KR")}원
{taxiFare !== 0 ? (
<>
<div css={styleInfoSection}>
<div css={{ display: "flex", gap: "8px" }}>
<WalletRoundedIcon style={styleIcon} />
<div css={{ ...styleInfo }}>
예상 택시비 : {taxiFare.toLocaleString("ko-KR")}원
</div>
</div>
</div>
</div>
</div>
<DottedLine />
<DottedLine />
</>
) : null}
<SideMenuButton type="share" onClick={onClikcShare} />
<DottedLine />
<SideMenuButton type="taxi" onClick={onClickCallTaxi} />
Expand Down
36 changes: 19 additions & 17 deletions packages/web/src/components/ModalPopup/Body/BodyRoomSelection.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { useCallback, useMemo, useEffect, useRef, useState } from "react";
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
import { useTranslation } from "react-i18next";
import { useHistory } from "react-router-dom";

Expand Down Expand Up @@ -236,22 +236,24 @@ const BodyRoomSelection = ({ roomInfo }: BodyRoomSelectionProps) => {
</InfoSection>
</div>
</div>
<InfoSection title="참여 시 예상 택시비" alignDirection="left">
<div css={{ display: "flex", justifyContent: "start" }}>
<p css={theme.font14}>{`${taxiFare.toLocaleString("ko-KR")}원 / ${
roomInfo?.part?.length +
(isAlreadyPart || isDepart || isRoomFull ? 0 : 1)
}명`}</p>
<p css={theme.font14_bold}>
&nbsp;
{`= 인당 ${Math.floor(
taxiFare /
(roomInfo?.part?.length +
(isAlreadyPart || isDepart || isRoomFull ? 0 : 1))
).toLocaleString("ko-KR")}원`}
</p>
</div>
</InfoSection>
{taxiFare !== 0 ? (
<InfoSection title="참여 시 예상 택시비" alignDirection="left">
<div css={{ display: "flex", justifyContent: "start" }}>
<p css={theme.font14}>{`${taxiFare.toLocaleString("ko-KR")}원 / ${
roomInfo?.part?.length +
(isAlreadyPart || isDepart || isRoomFull ? 0 : 1)
}명`}</p>
<p css={theme.font14_bold}>
&nbsp;
{`= 인당 ${Math.floor(
taxiFare /
(roomInfo?.part?.length +
(isAlreadyPart || isDepart || isRoomFull ? 0 : 1))
).toLocaleString("ko-KR")}원`}
</p>
</div>
</InfoSection>
) : null}
</div>
{isLogin || isRoomFull || isDepart ? (
<Button
Expand Down
5 changes: 3 additions & 2 deletions packages/web/src/pages/Addroom/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,6 @@ const AddRoom = () => {
}, [myRooms]); // myOngoingRoom은 infoSection의 sortedMyRoom에서 정렬만 뺀 코드입니다. useMemo로 감싼 형태입니다.
// item : any 가 좋은 방법인지 모르겠습니다


useEffect(() => {
const expirationDate = new Date();
expirationDate.setFullYear(expirationDate.getFullYear() + 10);
Expand Down Expand Up @@ -221,7 +220,9 @@ const AddRoom = () => {
/>
<OptionTime value={valueTime} handler={setTime} page="add" />
<OptionMaxPeople value={valueMaxPeople} handler={setMaxPeople} />
<TaxiFare value={taxiFare} roomLength={valueMaxPeople} />
{taxiFare !== 0 ? (
<TaxiFare value={taxiFare} roomLength={valueMaxPeople} />
) : null}
<Button
type="purple"
disabled={validatedMsg ? true : false}
Expand Down