From 81d53f40a0044c91bb7ed557683204dff228ab02 Mon Sep 17 00:00:00 2001 From: SaltySalt77 Date: Wed, 14 Feb 2024 18:04:29 +0900 Subject: [PATCH 01/11] Feat: Remove fallback image when success --- src/components/CuPhotoBox.tsx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/components/CuPhotoBox.tsx b/src/components/CuPhotoBox.tsx index 8e51cb20f..7f3b4807e 100644 --- a/src/components/CuPhotoBox.tsx +++ b/src/components/CuPhotoBox.tsx @@ -28,9 +28,11 @@ const CuPhotoBox = ({ ...style, position: 'relative', margin: 0, - backgroundColor: '#ffffff', - border: '1px solid', - borderColor: 'line.alternative', + ...(error && { + backgroundColor: '#ffffff', + border: '1px solid', + borderColor: 'line.alternative', + }), }} > {src && !error && ( From 878974df6e5f59de81cb3b0ba56bb27405bafa61 Mon Sep 17 00:00:00 2001 From: HiHoi Date: Wed, 14 Feb 2024 19:47:29 +0900 Subject: [PATCH 02/11] fix: design fix --- src/app/teams/[id]/setting/page.tsx | 2 +- src/app/teams/[id]/setting/panel/ApplicantList.tsx | 9 ++++++++- .../setting/panel/TeamInfoProcess/SettingTeamLogo.tsx | 4 ++-- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/src/app/teams/[id]/setting/page.tsx b/src/app/teams/[id]/setting/page.tsx index 6893489bb..255b20911 100644 --- a/src/app/teams/[id]/setting/page.tsx +++ b/src/app/teams/[id]/setting/page.tsx @@ -108,7 +108,7 @@ const TeamsSetupPage = ({ params }: { params: { id: string } }) => { color="primary" fullWidth > - 신청 대기자 보기 + 신청 대기자 보기 + { const { isOpen, openModal, closeModal } = useModal() const [preview, setPreview] = useState( - teamLogoImage.length !== 0 ? teamLogoImage : '/icons/ios/128.png', + teamLogoImage.length !== 0 ? teamLogoImage : '', ) const deleteImage = () => { - setPreview('/icons/ios/128.png') + setPreview('') setValue('teamImage', null) setIsLogoEdit(true) closeModal() From 710d3ae2b87982d6d9540a02aacda94dd469947b Mon Sep 17 00:00:00 2001 From: Woorim Kim Date: Wed, 14 Feb 2024 20:33:12 +0900 Subject: [PATCH 03/11] fix: change report text modal title --- src/components/ReportModal.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/ReportModal.tsx b/src/components/ReportModal.tsx index 63c39edea..f828ddcfb 100644 --- a/src/components/ReportModal.tsx +++ b/src/components/ReportModal.tsx @@ -155,7 +155,7 @@ const ReportModal = ({ Date: Wed, 14 Feb 2024 20:33:39 +0900 Subject: [PATCH 04/11] chore: change text color in contained button --- src/app/my-page/privacy/panel/AuthSettingSection.tsx | 2 +- src/app/teams/[id]/setting/page.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/app/my-page/privacy/panel/AuthSettingSection.tsx b/src/app/my-page/privacy/panel/AuthSettingSection.tsx index 5724c156f..2e853dd74 100644 --- a/src/app/my-page/privacy/panel/AuthSettingSection.tsx +++ b/src/app/my-page/privacy/panel/AuthSettingSection.tsx @@ -27,7 +27,7 @@ const AuthSettingSection = ({ {authenticationTitle} diff --git a/src/app/teams/[id]/setting/page.tsx b/src/app/teams/[id]/setting/page.tsx index 6893489bb..f760ebaa9 100644 --- a/src/app/teams/[id]/setting/page.tsx +++ b/src/app/teams/[id]/setting/page.tsx @@ -108,7 +108,7 @@ const TeamsSetupPage = ({ params }: { params: { id: string } }) => { color="primary" fullWidth > - 신청 대기자 보기 + 신청 대기자 보기 Date: Wed, 14 Feb 2024 20:40:37 +0900 Subject: [PATCH 05/11] fix: text color add --- src/app/teams/[id]/setting/page.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/app/teams/[id]/setting/page.tsx b/src/app/teams/[id]/setting/page.tsx index 255b20911..04988aaa7 100644 --- a/src/app/teams/[id]/setting/page.tsx +++ b/src/app/teams/[id]/setting/page.tsx @@ -108,7 +108,9 @@ const TeamsSetupPage = ({ params }: { params: { id: string } }) => { color="primary" fullWidth > - 신청 대기자 보기 + + 신청 대기자 보기 + Date: Wed, 14 Feb 2024 20:40:40 +0900 Subject: [PATCH 06/11] chore: change text color in contained button --- src/app/my-page/privacy/panel/AuthSettingSection.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/my-page/privacy/panel/AuthSettingSection.tsx b/src/app/my-page/privacy/panel/AuthSettingSection.tsx index 5724c156f..2e853dd74 100644 --- a/src/app/my-page/privacy/panel/AuthSettingSection.tsx +++ b/src/app/my-page/privacy/panel/AuthSettingSection.tsx @@ -27,7 +27,7 @@ const AuthSettingSection = ({ {authenticationTitle} From 738f07fdc571f707b59edb55794dabc1a29f84f0 Mon Sep 17 00:00:00 2001 From: Woorim Kim Date: Wed, 14 Feb 2024 20:44:06 +0900 Subject: [PATCH 07/11] chore: reset typo --- src/app/teams/[id]/setting/page.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/teams/[id]/setting/page.tsx b/src/app/teams/[id]/setting/page.tsx index f760ebaa9..6893489bb 100644 --- a/src/app/teams/[id]/setting/page.tsx +++ b/src/app/teams/[id]/setting/page.tsx @@ -108,7 +108,7 @@ const TeamsSetupPage = ({ params }: { params: { id: string } }) => { color="primary" fullWidth > - 신청 대기자 보기 + 신청 대기자 보기 Date: Wed, 14 Feb 2024 20:57:37 +0900 Subject: [PATCH 08/11] fix main showcase image --- src/app/panel/main-page/MainCarousel.tsx | 16 ++++------------ src/app/panel/main-page/MainShowcase.tsx | 3 ++- .../teams/[id]/setting/panel/ApplicantList.tsx | 2 +- src/components/CuPhotoBox.tsx | 4 +++- 4 files changed, 10 insertions(+), 15 deletions(-) diff --git a/src/app/panel/main-page/MainCarousel.tsx b/src/app/panel/main-page/MainCarousel.tsx index 348a24829..ada94c6af 100644 --- a/src/app/panel/main-page/MainCarousel.tsx +++ b/src/app/panel/main-page/MainCarousel.tsx @@ -2,7 +2,7 @@ import { Box } from '@mui/material' import Slider from 'react-slick' import 'slick-carousel/slick/slick.css' import 'slick-carousel/slick/slick-theme.css' -import Image from 'next/image' +import CuPhotoBox from '@/components/CuPhotoBox' const MainCarousel = () => { const settings = { @@ -21,22 +21,14 @@ const MainCarousel = () => { height: '100%', } - const imageProps = { - width: 310, - height: 130, - style: { - borderRadius: '0.75rem', - height: '7.5rem', - }, - } - return ( - banner-1 diff --git a/src/app/panel/main-page/MainShowcase.tsx b/src/app/panel/main-page/MainShowcase.tsx index f062d5581..f14e68e32 100644 --- a/src/app/panel/main-page/MainShowcase.tsx +++ b/src/app/panel/main-page/MainShowcase.tsx @@ -53,7 +53,8 @@ const MainShowcase = () => { {data && data.content[0] && ( ( - {interview.question} + {interview.question} )) diff --git a/src/components/CuPhotoBox.tsx b/src/components/CuPhotoBox.tsx index 7f3b4807e..090dbc259 100644 --- a/src/components/CuPhotoBox.tsx +++ b/src/components/CuPhotoBox.tsx @@ -6,6 +6,7 @@ import React, { useState } from 'react' interface ICuPhotoBoxProps { onClick?: () => void style?: React.CSSProperties + imgStyle?: React.CSSProperties src: string alt: string objectStyle?: 'cover' | 'contain' | 'fill' | 'none' | 'scale-down' @@ -19,6 +20,7 @@ const CuPhotoBox = ({ priorityOption, objectStyle = 'cover', onClick, + imgStyle, }: ICuPhotoBoxProps) => { const [error, setError] = useState(false) return ( @@ -40,7 +42,7 @@ const CuPhotoBox = ({ src={src} alt={alt} fill - style={{ objectFit: objectStyle }} + style={{ ...imgStyle, objectFit: objectStyle }} sizes="100%" priority={priorityOption} onError={() => setError(true)} From 9e69050a83e24c338477a165a724a4f1b2c2ac85 Mon Sep 17 00:00:00 2001 From: SaltySalt77 Date: Wed, 14 Feb 2024 21:05:59 +0900 Subject: [PATCH 09/11] Refact: Changed logic on getLineCount --- src/app/hitchhiking/panel/HitchhikingCard.tsx | 73 ++++++++++--------- 1 file changed, 39 insertions(+), 34 deletions(-) diff --git a/src/app/hitchhiking/panel/HitchhikingCard.tsx b/src/app/hitchhiking/panel/HitchhikingCard.tsx index 706499c4f..92e3c2a9a 100644 --- a/src/app/hitchhiking/panel/HitchhikingCard.tsx +++ b/src/app/hitchhiking/panel/HitchhikingCard.tsx @@ -15,10 +15,9 @@ import { Box, } from '@mui/material' import { useRouter } from 'next/navigation' -import React, { useEffect, useState } from 'react' +import React, { useEffect, useRef, useState } from 'react' import Members from './Members' import DropdownMenu from '@/components/DropdownMenu' -import useMedia from '@/hook/useMedia' import * as style from './HitchhikingCard.style' import ShareMenuItem from '@/components/dropdownMenu/ShareMenuItem' import ReportMenuItem from '@/components/dropdownMenu/ReportMenuItem' @@ -37,7 +36,6 @@ const HitchhikingCardBack = ({ onClick, flipped, isProject, - cardWidth, title, currentDomain, authorId, @@ -48,28 +46,57 @@ const HitchhikingCardBack = ({ flipped?: boolean isProject?: boolean title: string - cardWidth: number currentDomain: string authorId: number }) => { const [data, setData] = useState(null) const [isLoading, setIsLoading] = useState(false) + const [lineCount, setLineCount] = useState({ + title: 1, + content: 1, + }) const router = useRouter() + const card = useRef(null) const { openToast, closeToast } = useToast() + useEffect(() => { + setLineCount({ + title: getLineCount(46, 22.5, 2), + content: getLineCount(191, 18, 8), + }) + }, [card]) + + useEffect(() => { + const handleResize = () => { + if (card.current) { + setLineCount({ + title: getLineCount(46, 22.5, 2), + content: getLineCount(191, 18, 8), + }) + } + } + + addEventListener('resize', handleResize) + return () => { + removeEventListener('resize', handleResize) + } + }, []) + const getLineCount = ( - otherOriginHeight: number, + originHeight: number, lineHeight: number, maxLine: number, ) => { + const removeCount = card.current?.clientHeight ?? 0 < 441 ? 2 : 1 const lineCount = Math.floor( - ((cardWidth * 441) / 328 - (otherOriginHeight + 204)) / lineHeight, + ((card.current?.clientHeight ?? 0) * originHeight) / lineHeight / 441, ) if (lineCount > maxLine) return maxLine - else if (lineCount < 1) return 1 - else return lineCount + else if (lineCount < 1 + removeCount) return 1 + else return lineCount - removeCount } + const axiosInstance = useAxiosWithAuth() useEffect(() => { @@ -113,6 +140,7 @@ const HitchhikingCardBack = ({ padding: '1rem', }} key={crypto.randomUUID()} + ref={card} > {data ? ( {title} @@ -172,7 +200,7 @@ const HitchhikingCardBack = ({ }} onClick={onClick} > - + h1:first-of-type': { marginTop: 0, }, @@ -263,33 +291,11 @@ const HitchhikingCard = ({ isProject?: boolean }) => { const [isFlipped, setIsFlipped] = useState(false) - const [cardWidth, setCardWidth] = useState(0) const [currentDomain, setCurrentDomain] = useState('') - const { isPc } = useMedia() useEffect(() => { // 현재 도메인 설정 setCurrentDomain(window.location.origin) - - // 카드 너비 설정 - // calc(90svh * 328 / 800) - setCardWidth( - isPc - ? (window.innerHeight * 0.8 * 328) / 800 - : (window.innerHeight * 328) / 800, - ) - const handleResize = () => { - const newCardWidth = isPc - ? (window.innerHeight * 0.8 * 328) / 800 - : window.innerWidth * 0.9 - setCardWidth(newCardWidth) - } - - window.addEventListener('resize', handleResize) - - return () => { - window.removeEventListener('resize', handleResize) - } }, []) const handleMouseUp = (e: React.MouseEvent) => { @@ -332,7 +338,6 @@ const HitchhikingCard = ({ flipped={isFlipped} isProject={isProject} title={title} - cardWidth={cardWidth} currentDomain={currentDomain} /> From dd80ebd764dda28d157f25954a25946d486cf229 Mon Sep 17 00:00:00 2001 From: jujeon Date: Wed, 14 Feb 2024 21:28:26 +0900 Subject: [PATCH 10/11] Fix: editing recruit causes adding one person --- src/app/recruit/[id]/edit/page.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/recruit/[id]/edit/page.tsx b/src/app/recruit/[id]/edit/page.tsx index a073c52bb..979035bc9 100644 --- a/src/app/recruit/[id]/edit/page.tsx +++ b/src/app/recruit/[id]/edit/page.tsx @@ -99,7 +99,7 @@ const Page = ({ params }: { params: { id: string } }) => { roleList: data.type === 'PROJECT' ? data.roleList : null, interviewList: fieldToForm(data.interviewList), place: data.place, - max: data.type === 'PROJECT' ? null : Number(data.max), + max: data.type === 'PROJECT' ? null : Number(data.max) - 1, type: data.type, }) .then((res) => { From 29b0eccfd8dbfbac47ffed48efa0b36171c6ff7e Mon Sep 17 00:00:00 2001 From: jujeon Date: Wed, 14 Feb 2024 21:46:15 +0900 Subject: [PATCH 11/11] Design: change tag name --- src/app/recruit/[id]/panel/RecruitDetailContent.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/recruit/[id]/panel/RecruitDetailContent.tsx b/src/app/recruit/[id]/panel/RecruitDetailContent.tsx index 4eddd7ef5..aae9a34de 100644 --- a/src/app/recruit/[id]/panel/RecruitDetailContent.tsx +++ b/src/app/recruit/[id]/panel/RecruitDetailContent.tsx @@ -88,7 +88,7 @@ const RecruitDetailContent = ({ )} }