Skip to content

Commit

Permalink
Merge branch 'release-1.0.2' of https://github.com/peer-42seoul/Peer-…
Browse files Browse the repository at this point in the history
…Frontend into release-1.0.2
  • Loading branch information
asroq1 committed Feb 7, 2024
2 parents 37ea60c + 67901ba commit c347c77
Show file tree
Hide file tree
Showing 31 changed files with 222 additions and 179 deletions.
4 changes: 3 additions & 1 deletion src/app/admin/announce/Announce.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,9 @@ const Announce = () => {
} else return

await axios
.put(`${API_URL}/api/v1/admin/announcement`, submitData)
.put(`${API_URL}/api/v1/admin/announcement`, submitData, {
withCredentials: true,
})
.then(() => {
openToast({
message: '공지 글이 성공적으로 수정되었습니다.',
Expand Down
8 changes: 7 additions & 1 deletion src/app/admin/banner/Banner.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -704,7 +704,13 @@ const Banner = () => {
</Button>
) : null}
{writeMode === 'view' ? (
<Button variant={'contained'} onClick={() => onHandleEdit()}>
<Button
variant={'contained'}
onClick={() => onHandleEdit()}
disabled={
getValues('bannerStatus') !== '예약 중' ? true : false
}
>
수정
</Button>
) : writeMode === 'edit' ? (
Expand Down
13 changes: 13 additions & 0 deletions src/app/hitchhiking/panel/HitchhikingCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -179,10 +179,23 @@ const HitchhikingCardBack = ({
fontSize: '0.75rem',
color: 'text.alternative',
margin: 0,
lineHeight: '1.125rem',
marginBlockStart: '0',
marginBlockEnd: '0',
marginTop: 0,
}}
sx={{
...style.cardContentStyleBase,
WebkitLineClamp: getLineCount(46, 18, 10) /* 라인수 */,
'& .toastui-editor-contents > h1:first-of-type': {
marginTop: 0,
},
'.toastui-editor-contents h1': {
paddingBottom: 0,
},
'.toastui-editor-contents h2': {
paddingBottom: 0,
},
}}
/>
</Box>
Expand Down
3 changes: 3 additions & 0 deletions src/app/panel/OthersProfile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ const OthersProfile = ({ name, userId, children }: IOthersProfile) => {
router.push('/my-page')
}

// 유령회원일 경우
if (Number(userId) === -1) return <>{children}</>

return (
<div>
{children && (
Expand Down
2 changes: 1 addition & 1 deletion src/app/panel/main-page/MainCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ const MainCard = ({
if (statusLabel === '모집완료') {
sx = {
...sx,
filter: 'grayscale(120%) brightness(1.3)',
filter: 'grayscale(120%)',
}
}

Expand Down
3 changes: 3 additions & 0 deletions src/app/recruit/[id]/edit/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ const Page = ({ params }: { params: { id: string } }) => {
const { data, isLoading, error } = useSWR<{
defaultValues: IRecruitWriteField
isAnswered: boolean
content: string
}>(`/api/v1/recruit/edit/${params.id}`, (url: string) =>
axiosWithAuth
.get(url)
Expand All @@ -52,6 +53,7 @@ const Page = ({ params }: { params: { id: string } }) => {
max: data.totalNumber ? `${data.totalNumber}` : `2`,
},
isAnswered: data.isAnswered,
content: data.content,
})),
)

Expand Down Expand Up @@ -129,6 +131,7 @@ const Page = ({ params }: { params: { id: string } }) => {
submitHandler={handleSubmit}
isAnswered={data.isAnswered}
isSubmitting={isSubmitting}
content={data.content}
/>
)
}
Expand Down
12 changes: 7 additions & 5 deletions src/app/recruit/write/panel/CreateTeamEditor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,15 @@ const CreateTeamEditor = ({
editorType,
isAnswered,
isSubmitting,
content,
}: {
defaultValues: IRecruitWriteField
submitHandler: (data: IRecruitWriteField) => Promise<void>
editorRef: React.MutableRefObject<Editor | null>
editorType: 'edit' | 'write'
isAnswered?: boolean
isSubmitting?: boolean
content?: string
}) => {
const [completedInterview, setCompletedInterview] = useState(false)

Expand Down Expand Up @@ -211,7 +213,7 @@ const CreateTeamEditor = ({
<RadioGroup {...field} row>
<Stack spacing={'0.5rem'} direction={'row'}>
<FormControlLabel
value="PROJECT"
value="STUDY"
control={
<Radio sx={style.radioButtonStyle} size="small" />
}
Expand All @@ -220,13 +222,13 @@ const CreateTeamEditor = ({
variant={'Caption'}
color={'text.alternative'}
>
프로젝트
스터디
</Typography>
}
disabled={editorType === 'edit'}
/>
<FormControlLabel
value="STUDY"
value="PROJECT"
control={
<Radio sx={style.radioButtonStyle} size="small" />
}
Expand All @@ -235,7 +237,7 @@ const CreateTeamEditor = ({
variant={'Caption'}
color={'text.alternative'}
>
스터디
프로젝트
</Typography>
}
disabled={editorType === 'edit'}
Expand Down Expand Up @@ -546,7 +548,7 @@ const CreateTeamEditor = ({
>
<Box width={'100%'}>
<DynamicToastEditor
initialValue="팀 소개 글 입니다."
initialValue={content ?? '팀 소개 글 입니다.'}
editorRef={editorRef}
/>
</Box>
Expand Down
6 changes: 3 additions & 3 deletions src/app/showcase/detail/[id]/page.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use client'

import { Typography } from '@mui/material'
import { Stack, Typography } from '@mui/material'
import React from 'react'
import ShowcaseViewer from './panel/ShowcaseViewer'
import { IShowcaseViewerFields } from '@/types/IShowcaseEdit'
Expand Down Expand Up @@ -29,10 +29,10 @@ const ShowcaseDetailPage = ({ params }: { params: { id: number } }) => {

return (
data && (
<>
<Stack gap={'2rem'}>
<ShowcaseViewer data={data} postId={params.id} />
<CommentContainer postId={params.id} />
</>
</Stack>
)
)
}
Expand Down
4 changes: 2 additions & 2 deletions src/app/showcase/detail/[id]/panel/CommentContainer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ const CommentContainer = ({ postId }: IPostId) => {
<Container sx={style.containerWrapper}>
<Stack sx={style.CommentContainer}>
<Typography
variant={'Title1'}
variant={'Title3'}
color={'text.normal'}
marginBottom={'1rem'}
>
Expand All @@ -168,7 +168,7 @@ const CommentContainer = ({ postId }: IPostId) => {
<Container sx={style.containerWrapper}>
<Stack sx={style.CommentContainer}>
<Typography
variant={'Title1'}
variant={'Title3'}
color={'text.normal'}
marginBottom={'1rem'}
>
Expand Down
10 changes: 5 additions & 5 deletions src/app/showcase/detail/[id]/panel/ShowcaseViewer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ const CoverImage = ({ image }: { image: string }) => {

const InformationViewer = ({ data }: any) => {
return (
<Stack spacing={'2rem'} sx={style.InformationViewer}>
<Stack spacing={'0.5rem'} sx={style.InformationViewer}>
<StartEndDateViewer start={data?.start} end={data?.end} />
<SkillInput skills={data?.skills} />
<TeamMembers members={data?.member} />
Expand Down Expand Up @@ -74,10 +74,10 @@ const ShowcaseViewer = ({ data, postId }: IShowcaseViewerProps) => {
<Stack sx={style.InformationViewerBox}>
<InformationViewer data={data} />
<Stack
spacing={'1rem'}
spacing={'0.5rem'}
display={'flex'}
width={'30%'}
marginBottom={'1rem'}
marginBottom={'0.5rem'}
>
<CoverImage image={data.image} />
</Stack>
Expand All @@ -88,10 +88,10 @@ const ShowcaseViewer = ({ data, postId }: IShowcaseViewerProps) => {
) : (
<Container sx={style.mobileViewer}>
<Stack
spacing={'1rem'}
spacing={'0.5rem'}
display={'flex'}
width={'100%'}
marginBottom={'1rem'}
marginBottom={'0.5rem'}
>
<TeamName
editMode={false}
Expand Down
2 changes: 1 addition & 1 deletion src/app/showcase/panel/CardContainer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const CardContainer = ({
const { isPc } = useMedia()
return (
<Stack
justifyContent={'flex-start'}
justifyContent={'center'}
alignItems={'center'}
sx={
isPc
Expand Down
2 changes: 1 addition & 1 deletion src/app/showcase/panel/CardStack.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ const CardStack = ({
// 위로 조금만 움직였을 때 카드가 사라지지 않도록 처리
if (
Math.abs(info.offset.y) < 150 ||
checkDragDirection(info.offset.x, info.offset.y) !== ESwipeDirection.up
checkDragDirection(info.offset.x, info.offset.y) !== ESwipeDirection.down
) {
setDragged(false)

Expand Down
96 changes: 47 additions & 49 deletions src/app/showcase/panel/PostCard.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import {
Box,
Card,
CardActionArea,
CardContent,
CardHeader,
CardMedia,
Expand Down Expand Up @@ -92,7 +91,7 @@ function PostCard({
backfaceVisibility: 'hidden',
}}
ref={ref}
// onClick={onClick}
onClick={onClick}
>
<CardMedia
component="img"
Expand Down Expand Up @@ -157,53 +156,52 @@ function PostCard({
}
sx={{ p: 0 }}
/>
<CardActionArea onClick={onClick}>
<Box
sx={{
height: (currentCardWidth * 190) / 328,
boxSizing: 'border-box',
}}
>
<CardContent sx={{ p: 0 }}>
<Typography
variant="Body1"
color="text.normal"
sx={{
...style.cardTitleStyleBase,
height: getLineCount(46, 22.5) * 22.5,
WebkitLineClamp: getLineCount(46, 22.5),
}}
>
{title}
</Typography>
</CardContent>
<CardContent sx={{ p: 0 }}>
<Stack
gap={1}
direction={'row'}
sx={{
overflow: 'hidden',
height: getLineCount(46, 22.5) * 20 + 8,
}}
>
{tagList?.map(({ name, color }: IShowcaseTag, idx: number) => {
return (
<Chip
label={<Typography variant="Tag">{name}</Typography>}
size="small"
key={idx}
style={{
backgroundColor: alpha(color, 0.3),
borderRadius: 2,
height: '1.25rem',
}}
/>
)
})}
</Stack>
</CardContent>
</Box>
</CardActionArea>

<Box
sx={{
height: (currentCardWidth * 190) / 328,
boxSizing: 'border-box',
}}
>
<CardContent sx={{ p: 0 }}>
<Typography
variant="Body1"
color="text.normal"
sx={{
...style.cardTitleStyleBase,
height: getLineCount(46, 22.5) * 22.5,
WebkitLineClamp: getLineCount(46, 22.5),
}}
>
{title}
</Typography>
</CardContent>
<CardContent sx={{ p: 0 }}>
<Stack
gap={1}
direction={'row'}
sx={{
overflow: 'hidden',
height: getLineCount(46, 22.5) * 20 + 8,
}}
>
{tagList?.map(({ name, color }: IShowcaseTag, idx: number) => {
return (
<Chip
label={<Typography variant="Tag">{name}</Typography>}
size="small"
key={idx}
style={{
backgroundColor: alpha(color, 0.3),
borderRadius: 2,
height: '1.25rem',
}}
/>
)
})}
</Stack>
</CardContent>
</Box>
</Stack>
</Card>
)
Expand Down
2 changes: 1 addition & 1 deletion src/app/showcase/panel/common/ImageInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const ImageInput = ({
svgIcon={<ImageIcon sx={Style.IconStyle} />}
message={'쇼케이스 대표 이미지'}
/>
<Stack sx={{ display: 'flex', alignItems: 'center' }}>
<Stack sx={{ width: '100%', display: 'flex', alignItems: 'center' }}>
{previewImage && (
<Box
style={{
Expand Down
2 changes: 1 addition & 1 deletion src/app/showcase/panel/common/SkillInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const SkillInput = ({ skills }: ISkillProps) => {
<Stack spacing={'0.75rem'} sx={style.skillInputViewer}>
<LabelWithIcon
svgIcon={<TagIcon sx={style.IconStyle} />}
message="기술 스택"
message="기술스택"
color="text.alternative"
/>
<Stack spacing={'0.75rem'} py={1} direction={'row'} useFlexGap>
Expand Down
5 changes: 3 additions & 2 deletions src/app/showcase/panel/common/StartEndDateViewer.style.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
export const StartEndDateViewerBox = (isPc?: boolean) => ({
display: isPc ? 'flex' : 'none',
justifyContent: isPc ? 'space-between' : 'none',
display: 'flex',
justifyContent: 'space-between',
alignItems: 'center',
gap: '1rem',
gridArea: 'startEndDateViewer',
width: '100%',
height: isPc ? '6.25rem' : '3.375rem',
paddingTop: isPc ? '0' : '1.25rem',
})
Loading

0 comments on commit c347c77

Please sign in to comment.