Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/app/mobile/admin/dashboard/_components/DashboardItem.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import Image from 'next/image';
import convertTime from '@/utils/convertTime';
import { handleTouchStart, handleTouchEnd } from '@/utils/handleTouch';
import { DashboardProps } from '@/types/dashboardType';

export default function DashboardItem({
Expand Down Expand Up @@ -69,6 +70,8 @@ export default function DashboardItem({
<button
type="button"
onClick={handleCancelBtn}
onTouchStart={handleTouchStart}
onTouchEnd={handleTouchEnd}
className="w-14 text-return-red"
>
대여 취소
Expand All @@ -79,6 +82,8 @@ export default function DashboardItem({
<button
type="button"
onClick={handleApproveBtn}
onTouchStart={handleTouchStart}
onTouchEnd={handleTouchEnd}
className="text-return-blue"
>
{RentalApproveBtnText[status]}
Expand Down
3 changes: 3 additions & 0 deletions src/app/mobile/main/_components/WelfareItem/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import Image from 'next/image';
import { handleTouchStart, handleTouchEnd } from '@/utils/handleTouch';

interface WelfareItemProps {
itemName: string;
Expand Down Expand Up @@ -41,6 +42,8 @@ export default function WelfareItem({
<button
type="button"
onClick={onRentalClick}
onTouchStart={handleTouchStart}
onTouchEnd={handleTouchEnd}
className="box-border px-1 py-2.5 text-body-2-normal_semi font-semibold text-return-blue"
>
대여하기
Expand Down
34 changes: 0 additions & 34 deletions src/app/mobile/page.tsx

This file was deleted.

10 changes: 8 additions & 2 deletions src/components/mobile/Alert/index.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { handleTouchStart, handleTouchEnd } from '@/utils/handleTouch';

interface AlertProps {
content: string; // alert창 문구
ctaButtonText: string; // 오른쪽 버튼에 들어갈 문구
Expand All @@ -20,7 +22,7 @@ export default function Alert({
: 'bg-warning text-white-primary'; // 빨간 버튼 (신청 취소)

const defalutButtonClass =
'text-body-1-normal_semi w-[108px] rounded-[10px] py-[9px] font-medium outline-none';
'text-body-1-normal_semi w-[108px] rounded-[10px] py-[9px] font-medium outline-none ';

return (
<div className="fixed inset-0 z-20 flex items-center justify-center">
Expand All @@ -42,13 +44,17 @@ export default function Alert({
<button
type="button"
onClick={onClickOther}
className={`${defalutButtonClass} bg-gray-tertiary text-gray-secondary`}
onTouchStart={handleTouchStart}
onTouchEnd={handleTouchEnd}
className={`${defalutButtonClass} bg-gray-tertiary text-gray-secondary transition-all`}
>
{otherButtonText}
</button>
<button
type="button"
onClick={onClickCta}
onTouchStart={handleTouchStart}
onTouchEnd={handleTouchEnd}
className={` ${defalutButtonClass} ${ctaButtonClass}`}
>
{ctaButtonText}
Expand Down
9 changes: 9 additions & 0 deletions src/utils/handleTouch.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
const handleTouchStart = (e: React.TouchEvent<HTMLButtonElement>) => {
e.currentTarget.style.transform = 'scale(0.95)';
};

const handleTouchEnd = (e: React.TouchEvent<HTMLButtonElement>) => {
e.currentTarget.style.transform = 'scale(1)';
};

export { handleTouchStart, handleTouchEnd };