Skip to content

Commit

Permalink
Merge branch 'fix/COT-192_session_feature_modify' into release
Browse files Browse the repository at this point in the history
  • Loading branch information
WONYOUNG-HC committed Jan 31, 2025
2 parents fa12798 + 1db685b commit 72dcace
Show file tree
Hide file tree
Showing 4 changed files with 58 additions and 7 deletions.
37 changes: 35 additions & 2 deletions src/components/CotatoTimePicker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { TimePicker } from '@mui/x-date-pickers/TimePicker';
import dayjs, { Dayjs } from 'dayjs';
import 'dayjs/locale/ko';
import { useTheme } from 'styled-components';
import { Box, Button } from '@mui/material';

//
//
Expand Down Expand Up @@ -62,8 +63,36 @@ const CotatoTimePicker: React.FC<CotatoTimePickerProps> = ({
['& .MuiOutlinedInput-notchedOutline']: {
border: 'none',
},
['& .Mui-disabled']: {
'-webkit-text-fill-color': 'inherit',
},
}}
slots={{
actionBar: (props) => (
<Box
{...props}
sx={{
display: 'flex',
justifyContent: 'flex-end',
padding: '0.25rem',
}}
>
<Button
// eslint-disable-next-line react/prop-types
onClick={props.onAccept}
sx={{
color: theme.colors.primary100,
}}
>
확인
</Button>
</Box>
),
}}
slotProps={{
textField: {
disabled: true,
},
inputAdornment: {
sx: {
['& .MuiSvgIcon-root']: {
Expand All @@ -73,8 +102,12 @@ const CotatoTimePicker: React.FC<CotatoTimePickerProps> = ({
},
desktopPaper: {
sx: {
'& .Mui-selected': {
backgroundColor: theme.colors.primary100,
['& .Mui-selected']: {
backgroundColor: theme.colors.primary100_2 + ' !important',

'&:hover': {
backgroundColor: theme.colors.primary100_2 + ' !important',
},
},
},
},
Expand Down
7 changes: 4 additions & 3 deletions src/pages/Session/SessionCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import {
import SessionIcon from '@components/Session/SessionIcon';
import SessionContents from '@components/Session/SessionContents';
import CotatoIcon from '@components/CotatoIcon';
import imageSortByOrder from '@utils/imageSortByOrder';

//
//
Expand Down Expand Up @@ -81,9 +82,9 @@ const SessionCard = ({ session, isActive, handleSessionClick }: SessionCardProps
return null;
}

const firstSessionImageInfo = session?.imageInfos?.at(
0,
) as CotatoSessionListImageInfoResponse;
const firstSessionImageInfo = imageSortByOrder(
session.imageInfos as CotatoSessionListImageInfoResponse[],
)[0];

return (
<CardImage
Expand Down
4 changes: 3 additions & 1 deletion src/pages/Session/SessionDetailModalImage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ import 'swiper/css/pagination';
import { CotatoSessionListImageInfoResponse } from 'cotato-openapi-clients';
import { Skeleton } from '@mui/material';
import { media } from '@theme/media';
import imageSortByOrder from '@utils/imageSortByOrder';
import { SessionListImageInfo } from '@/typing/session';

//
//
Expand Down Expand Up @@ -46,7 +48,7 @@ const SessionDetailModalImage = ({ imageList }: SessionDetailModalImageProps) =>
clickable: false,
}}
>
{imageList?.map((image, index) => (
{imageSortByOrder(imageList as SessionListImageInfo[]).map((image, index) => (
<StyledSwiperSlide key={index}>
{imageLoading && (
<Skeleton
Expand Down
17 changes: 16 additions & 1 deletion src/pages/Session/SessionUploadModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,18 @@ const SessionUploadModal = ({
);
};

/**
*
*/
const handlePlaceClearButtonClick = () => {
setSession(
produce(session, (draft) => {
draft.placeName = '';
}),
);
setAddress('');
};

/**
*
*/
Expand Down Expand Up @@ -413,13 +425,16 @@ const SessionUploadModal = ({
<CotatoIcon icon="search" size="1.25rem" color={(theme) => theme.colors.gray60} />
</button>
</LocationInputBox>
<LocationInputBox $width="9rem">
<LocationInputBox $width="12rem">
<input
placeholder="장소명"
value={session.placeName}
readOnly={session.location === undefined}
onChange={handlePlaceNameChange}
/>
<button type="button" onClick={handlePlaceClearButtonClick}>
<CotatoIcon icon="trash-alt" size="1.25rem" color={(theme) => theme.colors.gray60} />
</button>
</LocationInputBox>
</div>
</InfoBox>
Expand Down

0 comments on commit 72dcace

Please sign in to comment.