Skip to content

Commit 7b67e17

Browse files
committed
KTL-1230 fix: fixed mascot animation in Hero section of Structure page
1 parent 9a4da9c commit 7b67e17

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/components/Structure/Department.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,8 @@ type HeroMembersProps = {
6666
list: PersonProps[];
6767
} & HTMLAttributes<HTMLUListElement>;
6868

69+
const MAX_VARIATION_COUNT = 5;
70+
6971
function HeroMembers({ list, ...props }: HeroMembersProps) {
7072
const ref = useRef(null);
7173

@@ -102,7 +104,7 @@ function HeroMembers({ list, ...props }: HeroMembersProps) {
102104
style={{ [MASCOT_CSS_PROP]: `url("${mascot.publicURL}")` }}
103105
list={list.map((person, i) => ({
104106
avatar: isInteracted || i !== 1 ? true : 'asIdle',
105-
variation: String(i + 1),
107+
variation: String((i % MAX_VARIATION_COUNT) + 1),
106108
size: 'Xl',
107109
xlWidth: list.length < 7 && (list.length === 6 ? 'Wide' : 'UltraWide'),
108110
onMouseLeave: onLeave,

0 commit comments

Comments
 (0)