Skip to content

Commit

Permalink
Merge pull request #161 from hang-log-design-system/feature/#160
Browse files Browse the repository at this point in the history
모바일 환경에서 StarRatingInput 호버 문제 수정
  • Loading branch information
dladncks1217 authored Sep 5, 2023
2 parents 2a7f357 + 803f7f3 commit 47de5a7
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 8 deletions.
18 changes: 10 additions & 8 deletions src/components/StarRatingInput/StarRatingInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import SupportingText from '@components/SupportingText/SupportingText';
const STAR_RATING_EMPTY_LENGTH = 10;

export interface StarRatingInputProps {
isMobile: boolean;
label?: string;
supportingText?: string;
required?: boolean;
Expand All @@ -26,6 +27,7 @@ export interface StarRatingInputProps {

const StarRatingInput = (
{
isMobile = false,
label,
supportingText,
required = false,
Expand Down Expand Up @@ -54,10 +56,10 @@ const StarRatingInput = (
onStarClick(index);
}}
onMouseOver={() => {
onStarHover(index);
if (!isMobile) onStarHover(index);
}}
onMouseOut={() => {
onStarHoverOut(index);
if (!isMobile) onStarHoverOut(index);
}}
key={Math.random()}
>
Expand All @@ -71,10 +73,10 @@ const StarRatingInput = (
onStarClick(index);
}}
onMouseOver={() => {
onStarHover(index);
if (!isMobile) onStarHover(index);
}}
onMouseOut={() => {
onStarHoverOut(index);
if (!isMobile) onStarHoverOut(index);
}}
key={Math.random()}
>
Expand All @@ -90,10 +92,10 @@ const StarRatingInput = (
onStarClick(index);
}}
onMouseOver={() => {
onStarHover(index);
if (!isMobile) onStarHover(index);
}}
onMouseOut={() => {
onStarHoverOut(index);
if (!isMobile) onStarHoverOut(index);
}}
key={Math.random()}
>
Expand All @@ -107,10 +109,10 @@ const StarRatingInput = (
onStarClick(index);
}}
onMouseOver={() => {
onStarHover(index);
if (!isMobile) onStarHover(index);
}}
onMouseOut={() => {
onStarHoverOut(index);
if (!isMobile) onStarHoverOut(index);
}}
key={Math.random()}
>
Expand Down
4 changes: 4 additions & 0 deletions src/stories/StarRatingInput.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ const meta = {
control: { type: 'number' },
description: 'gap',
},
isMobile: {
control: { type: 'boolean' },
description: 'isMobile',
},
},
args: {
label: '별점',
Expand Down

0 comments on commit 47de5a7

Please sign in to comment.