필터 및 화면 수정사항 반영
This commit is contained in:
@@ -17,6 +17,7 @@ import { GenomeTrait } from "@/types/genome.types"
|
||||
import { useGlobalFilter } from "@/contexts/GlobalFilterContext"
|
||||
import {
|
||||
ArrowLeft,
|
||||
ArrowUp,
|
||||
BarChart3,
|
||||
CheckCircle2,
|
||||
Download,
|
||||
@@ -156,6 +157,7 @@ export default function CowOverviewPage() {
|
||||
const [geneDataLoading, setGeneDataLoading] = useState(false) // 유전자 데이터 로딩 중
|
||||
const [loading, setLoading] = useState(true)
|
||||
const [activeTab, setActiveTab] = useState<string>('genome')
|
||||
const [showScrollTop, setShowScrollTop] = useState(false)
|
||||
|
||||
// 검사 상태
|
||||
const [hasGenomeData, setHasGenomeData] = useState(false)
|
||||
@@ -220,6 +222,20 @@ export default function CowOverviewPage() {
|
||||
}
|
||||
}, [filters.isActive, firstPinnedTrait, chartFilterTrait])
|
||||
|
||||
// 스크롤 투 탑 버튼 표시 여부
|
||||
useEffect(() => {
|
||||
const handleScroll = () => {
|
||||
setShowScrollTop(window.scrollY > 400)
|
||||
}
|
||||
window.addEventListener('scroll', handleScroll)
|
||||
return () => window.removeEventListener('scroll', handleScroll)
|
||||
}, [])
|
||||
|
||||
// 맨 위로 스크롤
|
||||
const scrollToTop = () => {
|
||||
window.scrollTo({ top: 0, behavior: 'smooth' })
|
||||
}
|
||||
|
||||
// 유전자 탭 필터 상태
|
||||
const [geneSearchInput, setGeneSearchInput] = useState('') // 실시간 입력값
|
||||
const [geneSearchKeyword, setGeneSearchKeyword] = useState('') // 디바운스된 검색값
|
||||
@@ -1938,6 +1954,17 @@ export default function CowOverviewPage() {
|
||||
</div>
|
||||
</DialogContent>
|
||||
</Dialog>
|
||||
|
||||
{/* 플로팅 맨 위로 버튼 */}
|
||||
{showScrollTop && (
|
||||
<button
|
||||
onClick={scrollToTop}
|
||||
className="fixed bottom-6 right-6 z-50 w-12 h-12 bg-primary text-white rounded-full shadow-lg hover:bg-primary/90 transition-all duration-300 flex items-center justify-center hover:scale-110 active:scale-95"
|
||||
aria-label="맨 위로"
|
||||
>
|
||||
<ArrowUp className="w-6 h-6" />
|
||||
</button>
|
||||
)}
|
||||
</SidebarProvider>
|
||||
</AuthGuard>
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user