diff --git a/src/app/(team)/team/_components/TeamBanner/styles.ts b/src/app/(team)/team/_components/TeamBanner/styles.ts index e94a8923..6f5653ca 100644 --- a/src/app/(team)/team/_components/TeamBanner/styles.ts +++ b/src/app/(team)/team/_components/TeamBanner/styles.ts @@ -20,7 +20,6 @@ export const teamBannerImgStyle = export const teamBannerTitleStyle = clsx( 'text-xl-bold', - 'relative flex-1', - 'laptop:max-w-[800px] tablet:max-w-[460px] max-w-[245px]', + 'relative flex-1 pr-3', 'min-w-0' ); diff --git a/src/components/common/Scroll/GradientScrollable.tsx b/src/components/common/Scroll/GradientScrollable.tsx index 5b60f412..038a358c 100644 --- a/src/components/common/Scroll/GradientScrollable.tsx +++ b/src/components/common/Scroll/GradientScrollable.tsx @@ -1,6 +1,5 @@ -'use client'; import clsx from 'clsx'; -import { useState } from 'react'; +import { useEffect, useRef, useState } from 'react'; interface GradientScrollableProps { children: React.ReactNode; @@ -20,8 +19,23 @@ const GradientScrollable = ({ className, color = '#272e3f', }: GradientScrollableProps) => { + const scrollRef = useRef(null); + const [isOverflowing, setIsOverflowing] = useState(false); const [isScrollMove, setIsScrollMove] = useState(false); + useEffect(() => { + const el = scrollRef.current; + if (!el) return; + + const observer = new ResizeObserver(() => { + setIsOverflowing(el.scrollWidth > el.clientWidth); + }); + + observer.observe(el); + + return () => observer.disconnect(); + }, [children]); + const handleScroll = (e: React.UIEvent) => { const { scrollLeft } = e.currentTarget; setIsScrollMove(scrollLeft >= 10); @@ -30,6 +44,7 @@ const GradientScrollable = ({ return (
{children}
-
+ {isOverflowing && ( +
+ )}
); };