Skip to content

Commit

Permalink
Merge pull request #66 from DDD-Community/fix/65
Browse files Browse the repository at this point in the history
[Fix/65] QA
  • Loading branch information
hwanheejung authored Aug 3, 2024
2 parents b877319 + 53be608 commit 5186e35
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 6 deletions.
4 changes: 2 additions & 2 deletions public/icons/close.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use client'

import ArrowBackIcon from 'public/icons/arrow_back_ios.svg'
import CloseIcon from 'public/icons/close.svg'
import { useState } from 'react'
import AskBfCloseModal from '../modals/AskBfCloseModal'
import { useModal } from './ModalContext'
Expand All @@ -10,7 +10,7 @@ const ArrowBack = () => {
const { closeModal } = useModal()
return (
<>
<ArrowBackIcon
<CloseIcon
className="cursor-pointer text-gray-0"
onClick={() => setShowAskBfCloseModal(true)}
/>
Expand Down
2 changes: 2 additions & 0 deletions src/components/Polaroid/PolaroidMaker.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
'use client'

import rotateImageIfNeeded from '@/lib/utils/image'
import { preventKeyboardSubmit } from '@/lib/utils/keyboard'
import imageCompression from 'browser-image-compression'
import AddPhotoIcon from 'public/icons/add_photo_alternate.svg'
import {
Expand Down Expand Up @@ -92,6 +93,7 @@ const PolaroidMaker = ({
}
setText(e.target.value)
}}
onKeyDown={preventKeyboardSubmit}
className="w-[204px] bg-transparent outline-none"
maxLength={MAX_LENGTH}
placeholder="눌러서 한줄 문구를 입력하세요"
Expand Down
4 changes: 2 additions & 2 deletions src/components/TextInput/index.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
'use client'

import { ChangeEvent } from 'react'
import { twMerge } from 'tailwind-merge'
import ExitIcon from 'public/icons/exit.svg'
import PinIcon from 'public/icons/pinFilled.svg'
import { ChangeEvent } from 'react'
import { twMerge } from 'tailwind-merge'

interface TextInputProps {
value: string
Expand Down
7 changes: 7 additions & 0 deletions src/lib/utils/keyboard.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { KeyboardEvent } from 'react'

export const preventKeyboardSubmit = (e: KeyboardEvent<HTMLInputElement>) => {
if (e.key === 'Enter') {
e.preventDefault()
}
}

0 comments on commit 5186e35

Please sign in to comment.