Skip to content

Commit

Permalink
Fix: 모바일 top button 위치 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
eunji-0623 committed Aug 2, 2024
1 parent e90b459 commit 8cee3a8
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion components/Button/TopButton.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
import Image from 'next/image';
import React, { useState, useEffect } from 'react';
import { useRouter } from 'next/router';

const TopButton = () => {
const [showButton, setShowButton] = useState(false);
const router = useRouter();
const isActivityDetailPage = router.pathname.startsWith('/activity-details/');

const scrollToTop = () => {
window.scroll({
Expand All @@ -26,7 +29,13 @@ const TopButton = () => {
return (
<>
{showButton && (
<div className="fixed right-[30px] m:right-[14px] bottom-[30px] z-30">
<div
className="fixed z-30"
style={{
bottom: isActivityDetailPage ? '70px' : '30px',
right: isActivityDetailPage ? '13px' : '30px',
}}
>
<button
onClick={scrollToTop}
type="button"
Expand Down

0 comments on commit 8cee3a8

Please sign in to comment.