Skip to content

Commit

Permalink
Merge pull request #110 from DDD-Community/feature/junseub-qa
Browse files Browse the repository at this point in the history
3차 QA
  • Loading branch information
junseublim authored Sep 6, 2024
2 parents 89cfe9f + e170dee commit 4d382e9
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,9 @@ const PolaroidListItem = ({ item, onClick }: PolaroidListItemProps) => {
return (
<div
className="flex flex-col justify-center"
onClick={onClick}
style={{ rotate: `${rotate}deg` }}
>
<PolaroidCard polaroid={item} />
<PolaroidCard polaroid={item} onClick={onClick} />
</div>
)
}
Expand Down
2 changes: 1 addition & 1 deletion src/app/board/[boardId]/_components/PolaroidList/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const PolaroidList = ({ polaroids }: PolaroidListProps) => {
}

return (
<div className="mx-auto w-full flex-1 overflow-x-hidden overflow-y-scroll scrollbar-hide">
<div className="mx-auto w-full flex-1 overflow-x-hidden overflow-y-scroll pb-10 scrollbar-hide">
<div className="grid grid-cols-2 gap-6 px-[20px] py-[10px]">
{polaroids.map((item) => (
<PolaroidListItem
Expand Down
4 changes: 0 additions & 4 deletions src/app/board/[boardId]/_components/Share/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import Modal from '@/components/Modal'
import Toast from '@/components/Toast'
import CopyIcon from 'public/icons/copy.svg'
import DownloadIcon from 'public/icons/download.svg'
import Share from 'public/icons/ios_share.svg'
import TwoPolaroidsIcon from 'public/icons/linkShare.svg'
import FacebookIcon from 'public/icons/sns/sns-facebook.svg'
Expand Down Expand Up @@ -92,9 +91,6 @@ const ShareBtn = ({ boardName }: { boardName: string }) => {
onClick={() => handleShare(shareToFacebook)}
/>
</Section>
<Section title="보드 이미지 저장">
<Section.Item icon={<DownloadIcon />} bg="bg-gray-200" />
</Section>
</Modal.BottomModal>
</Modal>
</>
Expand Down
5 changes: 3 additions & 2 deletions src/components/Polaroid/PolaroidCard/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,12 @@ import PolaroidNickname from '@/components/Polaroid/Base/PolaroidNickname'

interface PolaroidCardProps {
polaroid: Polaroid
onClick?: () => void
}

function PolaroidCard({ polaroid }: PolaroidCardProps) {
function PolaroidCard({ polaroid, onClick = () => {} }: PolaroidCardProps) {
return (
<PolaroidFrame className="cursor-pointer">
<PolaroidFrame className="cursor-pointer" onClick={onClick}>
<div className="p-2">
<PolaroidImage imageUrl={polaroid.imageUrl} />
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const PolaroidMessageInput = ({
value={message}
onChange={changeMessage}
onKeyDown={preventKeyboardSubmit}
className="w-full bg-transparent outline-none"
className="h-[25px] w-full bg-transparent outline-none"
maxLength={maxLength}
placeholder="눌러서 한줄 문구를 입력하세요"
name="oneLineMessage"
Expand Down
26 changes: 22 additions & 4 deletions src/components/Polaroid/PolaroidMaker/PolaroidNicknameInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ const PolaroidNicknameInput = ({
const [width, setWidth] = useState<number>(60)
const [showBorder, setShowBorder] = useState<boolean>(true)
const [placeholder, setPlaceholder] = useState<string>('')
const [showLengthCount, setShowLengthCount] = useState<boolean>(false)
const { data: session } = useSession()

useEffect(() => {
Expand All @@ -33,28 +34,45 @@ const PolaroidNicknameInput = ({
setWidth(Math.max(50, ref.current.offsetWidth) + 10)
}, [nickname, placeholder])

const onFocus = () => {
setShowBorder(true)
setPlaceholder('')
setShowLengthCount(true)
}

const onBlur = () => {
setShowBorder(false)
setPlaceholder(getPolaroidNickname(nickname, session))
setShowLengthCount(false)
}

const border = showBorder ? 'border-gray-900 border-b' : ''

return (
<div className="flex w-full justify-end gap-1 text-lg">
<div className="flex w-full items-center justify-end gap-1 text-lg">
<span>From. </span>
<div className={`${border} -px-3`}>
<input
type="text"
value={nickname}
onChange={changeNickname}
onKeyDown={preventKeyboardSubmit}
className="bg-transparent text-center outline-none"
className="h-6 bg-transparent text-center outline-none"
maxLength={maxLength}
onFocus={() => setShowBorder(true)}
onBlur={() => setShowBorder(!nickname)}
onFocus={onFocus}
onBlur={onBlur}
placeholder={placeholder}
name="oneLineMessage"
style={{
width: `${width}px`,
}}
/>
</div>
{showLengthCount && (
<span className="text-sm text-gray-400">
{nickname.length}/{maxLength}
</span>
)}
<span ref={ref} className="absolute -z-10 whitespace-pre opacity-0">
{nickname || placeholder}
</span>
Expand Down

0 comments on commit 4d382e9

Please sign in to comment.