Skip to content

Commit

Permalink
fix : 리차징룸 api 변경, 미팅룸 모달 인원 이미지 크기 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
banhogu committed Jun 9, 2024
1 parent 7fd3558 commit d444069
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ const MeetingDetailModal = () => {
<img
src={data?.representative?.imageUrl}
alt="image"
className="rounded-full"
className="rounded-full w-[42px] h-[42px]"
/>
<img
src="/reservation/groupLeader.svg"
Expand All @@ -165,7 +165,11 @@ const MeetingDetailModal = () => {
{data?.participants.map((member: participantsType, i: number) => (
<div key={i} className="flex items-center gap-[13px]">
<div className="w-[42px] h-[42px]">
<img src={member.imageUrl} alt="image" className=" rounded-full" />
<img
src={member.imageUrl}
alt="image"
className=" rounded-full w-[42px] h-[42px]"
/>
</div>
<div className="flex flex-col ">
<div className="text-space-black font-semibold text-base">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,11 @@ const RechargingRoomIndex = () => {
});

const currentBranch =
updatedTimeSelected && updatedTimeReserved && updatedTimeSelected > updatedTimeReserved
? selectedBranch
: reservedBranch || selectedBranch;
updatedTimeSelected &&
updatedTimeReserved &&
updatedTimeSelected > updatedTimeReserved
? selectedBranch
: reservedBranch || selectedBranch;

const branchId = currentBranch?.branchId as number;

Expand All @@ -43,7 +45,7 @@ const RechargingRoomIndex = () => {
}
);

if (data == undefined) {
if (data == undefined || data?.status == 'FAIL') {
return null;
}

Expand Down
32 changes: 26 additions & 6 deletions src/components/reservation/rechargingRoom/RechargingRoomItem.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import React, { Dispatch } from 'react';
import { rechargingRoomDataType } from '../model/recharging';
import { SelectedState } from './RechargingRoomIndex';
import { checkValidRecharging } from '../remote/recharging';

interface RechargingRoomItemType {
roomData: rechargingRoomDataType;
Expand All @@ -13,12 +14,31 @@ const RechargingRoomItem = ({
isSelected,
setIsSelected
}: RechargingRoomItemType) => {
const handleTimeBtn = (startAt: string) => {
setIsSelected({
rechargingRoomId: roomData?.rechargingRoomId,
startAt,
rechargingRoomName: roomData?.rechargingRoomName
});
const formatDateWithCurrentDate = (time: string): string => {
const today = new Date();
const [hours, minutes] = time.split(':');
today.setHours(parseInt(hours, 10));
today.setMinutes(parseInt(minutes, 10));
today.setSeconds(0);
today.setMilliseconds(0);
const yyyy = today.getFullYear();
const mm = String(today.getMonth() + 1).padStart(2, '0');
const dd = String(today.getDate()).padStart(2, '0');

return `${yyyy}-${mm}-${dd}T${time}:00`;
};

const handleTimeBtn = async (startAt: string) => {
const formattedStartAt = startAt ? formatDateWithCurrentDate(startAt) : '';
const data = await checkValidRecharging(formattedStartAt);
console.log(data);
if (data?.status == 'SUCCESS') {
setIsSelected({
rechargingRoomId: roomData?.rechargingRoomId,
startAt,
rechargingRoomName: roomData?.rechargingRoomName
});
}
};

return (
Expand Down

0 comments on commit d444069

Please sign in to comment.