-
+ }
+ off={}
+ />
}>
diff --git a/src/shared/ui/deprecated/StarRating/ui/StarRating.tsx b/src/shared/ui/deprecated/StarRating/ui/StarRating.tsx
deleted file mode 100644
index 0b87b923..00000000
--- a/src/shared/ui/deprecated/StarRating/ui/StarRating.tsx
+++ /dev/null
@@ -1,74 +0,0 @@
-import { memo, useState } from 'react';
-
-import { classNames } from '@/shared/lib/classNames';
-import StarIcon from '@/shared/assets/icons/star-20-20.svg';
-
-import cls from './StarRating.module.scss';
-import { Icon } from '../../Icon';
-
-interface StarRatingProps {
- className?: string;
- onSelect?: (starsCount: number) => void;
- size?: number;
- selectedStars?: number;
-}
-
-const stars = [1, 2, 3, 4, 5];
-
-/**
- * @deprecated
- */
-export const StarRating = memo((props: StarRatingProps) => {
- const { className, onSelect, size = 30, selectedStars = 0 } = props;
-
- const [currentStarsCount, setCurrentStarsCount] = useState(selectedStars);
- const [isSelected, setIsSelected] = useState(Boolean(selectedStars));
-
- const onHover = (starsCount: number) => () => {
- if (!isSelected) {
- setCurrentStarsCount(starsCount);
- }
- };
-
- const onLeave = () => {
- if (!isSelected) {
- setCurrentStarsCount(0);
- }
- };
-
- const onClick = (starsCount: number) => () => {
- if (!isSelected) {
- onSelect?.(starsCount);
- setCurrentStarsCount(starsCount);
- setIsSelected(true);
- }
- };
-
- return (
-
- {stars.map((starNumber) => (
- = starNumber,
- [cls.selected]: isSelected,
- },
- [cls.normal],
- )}
- width={size}
- height={size}
- onMouseLeave={onLeave}
- onMouseEnter={onHover(starNumber)}
- onClick={onClick(starNumber)}
- data-testid={`StarRating.${starNumber}`}
- data-selected={currentStarsCount >= starNumber}
- />
- ))}
-
- );
-});
-
-StarRating.displayName = 'StarRating';
diff --git a/src/shared/ui/redesigned/Button/ui/Button.module.scss b/src/shared/ui/redesigned/Button/ui/Button.module.scss
index 928de43c..7045e4df 100644
--- a/src/shared/ui/redesigned/Button/ui/Button.module.scss
+++ b/src/shared/ui/redesigned/Button/ui/Button.module.scss
@@ -47,12 +47,12 @@
.outline {
background: none;
- border: 1px solid var(--icon-redesigned);
+ border: 2px solid var(--icon-redesigned);
outline: none;
border-radius: 34px;
&:hover {
- border: 1px solid var(--accent-redesigned);
+ border: 2px solid var(--accent-redesigned);
}
}
diff --git a/src/shared/ui/deprecated/StarRating/index.ts b/src/shared/ui/redesigned/StarRating/index.ts
similarity index 100%
rename from src/shared/ui/deprecated/StarRating/index.ts
rename to src/shared/ui/redesigned/StarRating/index.ts
diff --git a/src/shared/ui/deprecated/StarRating/ui/StarRating.module.scss b/src/shared/ui/redesigned/StarRating/ui/StarRating.module.scss
similarity index 70%
rename from src/shared/ui/deprecated/StarRating/ui/StarRating.module.scss
rename to src/shared/ui/redesigned/StarRating/ui/StarRating.module.scss
index ca5419df..bbdd7c23 100644
--- a/src/shared/ui/deprecated/StarRating/ui/StarRating.module.scss
+++ b/src/shared/ui/redesigned/StarRating/ui/StarRating.module.scss
@@ -13,3 +13,7 @@
.hovered {
fill: var(--primary-color);
}
+
+.hoveredRedesigned {
+ fill: var(--icon-redesigned);
+}
diff --git a/src/shared/ui/deprecated/StarRating/ui/StarRating.stories.tsx b/src/shared/ui/redesigned/StarRating/ui/StarRating.stories.tsx
similarity index 100%
rename from src/shared/ui/deprecated/StarRating/ui/StarRating.stories.tsx
rename to src/shared/ui/redesigned/StarRating/ui/StarRating.stories.tsx
diff --git a/src/shared/ui/redesigned/StarRating/ui/StarRating.tsx b/src/shared/ui/redesigned/StarRating/ui/StarRating.tsx
new file mode 100644
index 00000000..a4cf050f
--- /dev/null
+++ b/src/shared/ui/redesigned/StarRating/ui/StarRating.tsx
@@ -0,0 +1,100 @@
+import { memo, useState } from 'react';
+
+import { classNames } from '@/shared/lib/classNames';
+import StarIcon from '@/shared/assets/icons/star-20-20.svg';
+import { ToggleFeatures } from '@/shared/lib/features';
+
+import cls from './StarRating.module.scss';
+import { Icon as IconDeprecated } from '../../../deprecated/Icon';
+import { Icon } from '../../Icon';
+
+interface StarRatingProps {
+ className?: string;
+ onSelect?: (starsCount: number) => void;
+ size?: number;
+ selectedStars?: number;
+}
+
+const stars = [1, 2, 3, 4, 5];
+
+export const StarRating = memo((props: StarRatingProps) => {
+ const { className, onSelect, size = 30, selectedStars = 0 } = props;
+
+ const [currentStarsCount, setCurrentStarsCount] = useState(selectedStars);
+ const [isSelected, setIsSelected] = useState(Boolean(selectedStars));
+
+ const onHover = (starsCount: number) => () => {
+ if (!isSelected) {
+ setCurrentStarsCount(starsCount);
+ }
+ };
+
+ const onLeave = () => {
+ if (!isSelected) {
+ setCurrentStarsCount(0);
+ }
+ };
+
+ const onClick = (starsCount: number) => () => {
+ if (!isSelected) {
+ onSelect?.(starsCount);
+ setCurrentStarsCount(starsCount);
+ setIsSelected(true);
+ }
+ };
+
+ return (
+
+ {stars.map((starNumber) => (
+ = starNumber,
+ [cls.selected]: isSelected,
+ },
+ [cls.normal],
+ )}
+ width={size}
+ height={size}
+ onMouseLeave={onLeave}
+ onMouseEnter={onHover(starNumber)}
+ onClick={onClick(starNumber)}
+ data-testid={`StarRating.${starNumber}`}
+ data-selected={currentStarsCount >= starNumber}
+ />
+ }
+ off={
+ = starNumber,
+ [cls.selected]: isSelected,
+ },
+ [cls.normal],
+ )}
+ width={size}
+ height={size}
+ onMouseLeave={onLeave}
+ onMouseEnter={onHover(starNumber)}
+ onClick={onClick(starNumber)}
+ data-testid={`StarRating.${starNumber}`}
+ data-selected={currentStarsCount >= starNumber}
+ />
+ }
+ />
+ ))}
+
+ );
+});
+
+StarRating.displayName = 'StarRating';