Skip to content
Open
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
16 changes: 9 additions & 7 deletions frontend/src/components/common/Button/Button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,15 @@ const StyledButton = styled.button<{ $animated: boolean; $width?: string }>`
transition: background-color 0.2s;
width: ${({ $width }) => $width ?? 'auto'};

&:hover:not(:disabled) {
background-color: ${({ theme }) => theme.colors.gray[800]};
${({ $animated }) =>
$animated &&
css`
animation: ${pulse} 0.4s ease-in-out;
`}
@media (hover: hover) {
&:hover:not(:disabled) {
background-color: ${({ theme }) => theme.colors.gray[800]};
${({ $animated }) =>
$animated &&
css`
animation: ${pulse} 0.4s ease-in-out;
`}
}
}

&:active:not(:disabled) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ const CARD_STYLES = {

const CardContainer = styled.div<{
$state: string;
$isClicked: boolean;
}>`
width: 100%;
display: flex;
Expand All @@ -34,7 +33,6 @@ const CardContainer = styled.div<{
transition:
transform 0.2s ease-in-out,
box-shadow 0.2s ease-in-out;
transform: ${({ $isClicked }) => ($isClicked ? 'scale(1.05)' : 'scale(1)')};
cursor: pointer;
touch-action: manipulation;

Expand All @@ -47,8 +45,7 @@ const CardContainer = styled.div<{

@media (hover: hover) {
&:hover {
transform: ${({ $isClicked }) =>
$isClicked ? 'scale(1.05)' : 'scale(1.03)'};
transform: scale(1.03);
}
}

Expand Down
18 changes: 6 additions & 12 deletions frontend/src/pages/MainPage/components/ClubCard/ClubCard.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { useEffect, useRef, useState } from 'react';
import { useEffect, useRef } from 'react';
import { useNavigate } from 'react-router-dom';
import default_profile_image from '@/assets/images/logos/default_profile_image.svg';
import ClubStateBox from '@/components/ClubStateBox/ClubStateBox';
Expand Down Expand Up @@ -31,7 +31,6 @@ const ClubCard = ({
}: ClubCardProps) => {
const navigate = useNavigate();
const trackEvent = useMixpanelTrack();
const [isClicked, setIsClicked] = useState(false);
const containerRef = useRef<HTMLDivElement>(null);

const SS_LAST_KEY = `clubcard_last_${page ?? 'default'}_${club.id}`;
Expand Down Expand Up @@ -102,7 +101,6 @@ const ClubCard = ({
}, [club.id, club.name, club.recruitmentStatus, page]);

const handleClick = () => {
setIsClicked(true);
trackEvent(USER_EVENT.CLUB_CARD_CLICKED, {
club_id: club.id,
club_name: club.name,
Expand All @@ -118,21 +116,17 @@ const ClubCard = ({
device_type: getDeviceType(),
});

setTimeout(() => {
setIsClicked(false);
if (onCardClick) {
onCardClick(club);
} else {
navigate(`/clubDetail/@${encodeURIComponent(club.name)}`);
}
}, 150);
if (onCardClick) {
onCardClick(club);
} else {
navigate(`/clubDetail/@${encodeURIComponent(club.name)}`);
}
};

return (
<Styled.CardContainer
ref={containerRef}
$state={club.recruitmentStatus}
$isClicked={isClicked}
onClick={handleClick}
>
<Styled.CardHeader>
Expand Down
Loading