Skip to content

Commit

Permalink
CTE 필요없는 부분 제거
Browse files Browse the repository at this point in the history
  • Loading branch information
jongwony committed Nov 3, 2024
1 parent 62fc423 commit 26f9f75
Showing 1 changed file with 1 addition and 20 deletions.
21 changes: 1 addition & 20 deletions src/app/Curation.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"use client"

import React, { useState, useEffect } from 'react';
import React from 'react';
import Image from 'next/image';
import { useRouter } from 'next/navigation';

Expand All @@ -15,21 +15,6 @@ const templates = [

export default function Curation() {
const router = useRouter();
const [selectedTemplate, setSelectedTemplate] = useState<string | null>(null);
const [isMobile, setIsMobile] = useState(false);

useEffect(() => {
const checkMobile = () => setIsMobile(window.innerWidth < 768);
checkMobile();
window.addEventListener('resize', checkMobile);
return () => window.removeEventListener('resize', checkMobile);
}, []);

const handleImageInteraction = (id: string) => {
if (isMobile) {
setSelectedTemplate(prevSelected => prevSelected === id ? null : id);
}
};

return (
<div className="relative mt-8">
Expand All @@ -55,9 +40,6 @@ export default function Curation() {
<div
key={template.id}
className="relative group"
onMouseEnter={() => !isMobile && setSelectedTemplate(template.id)}
onMouseLeave={() => !isMobile && setSelectedTemplate(null)}
onClick={() => handleImageInteraction(template.id)}
>
<Image
alt={template.alt}
Expand All @@ -74,7 +56,6 @@ export default function Curation() {
<div
key={`clone-${template.id}`}
className={`${styles.clone} relative group`}
onClick={() => handleImageInteraction(template.id)}
>
<Image
alt={template.alt}
Expand Down

0 comments on commit 26f9f75

Please sign in to comment.