Skip to content

Commit

Permalink
[Chore] [GGFE-265] 쓰지 않는 컴포넌트 주석처리
Browse files Browse the repository at this point in the history
  • Loading branch information
yoouyeon committed Sep 17, 2023
1 parent 5f35a19 commit f316184
Showing 1 changed file with 31 additions and 31 deletions.
62 changes: 31 additions & 31 deletions components/Layout/MegaPhone.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,44 +14,44 @@ interface IMegaphoneContent {

type MegaphoneList = Array<IMegaphoneContent>;

type MegaphoneContainerProps = {
children: React.ReactNode;
count: number;
};
// type MegaphoneContainerProps = {
// children: React.ReactNode;
// count: number;
// };

const adminContent: IMegaphoneContent = {
megaphoneId: 0,
content: '상점에서 아이템을 구매해서 확성기를 등록해보세요!(30자 제한)',
intraId: '관리자',
};

export const MegaphoneContainer = ({
children,
count,
}: MegaphoneContainerProps) => {
const ref = useRef<HTMLDivElement>(null);
const [selectedIndex, setSelectedIndex] = useState<number>(0);

useInterval(() => {
const nextIndex = (selectedIndex + 1) % count;
setSelectedIndex(nextIndex);
}, 4000);

return (
<div className={styles.rollingBanner}>
<div
className={styles.wrapper}
style={{
transition: 'all 1s ease-in-out',
transform: `translateY(${selectedIndex * -100}%)`,
}}
ref={ref}
>
{children}
</div>
</div>
);
};
// export const MegaphoneContainer = ({
// children,
// count,
// }: MegaphoneContainerProps) => {
// const ref = useRef<HTMLDivElement>(null);
// const [selectedIndex, setSelectedIndex] = useState<number>(0);

// useInterval(() => {
// const nextIndex = (selectedIndex + 1) % count;
// setSelectedIndex(nextIndex);
// }, 4000);

// return (
// <div className={styles.rollingBanner}>
// <div
// className={styles.wrapper}
// style={{
// transition: 'all 1s ease-in-out',
// transform: `translateY(${selectedIndex * -100}%)`,
// }}
// ref={ref}
// >
// {children}
// </div>
// </div>
// );
// };

export const MegaphoneItem = ({ content, intraId }: IMegaphoneContent) => {
return (
Expand Down

0 comments on commit f316184

Please sign in to comment.