From 7cf753e7cb5e83ecbef33b0d246b51bd8ed6cc5f Mon Sep 17 00:00:00 2001 From: Catherine Tan Date: Fri, 13 Dec 2024 01:19:42 -0800 Subject: [PATCH] remove unused NavigationBar component --- components/NavigationBar/index.tsx | 152 ----------------------------- 1 file changed, 152 deletions(-) delete mode 100644 components/NavigationBar/index.tsx diff --git a/components/NavigationBar/index.tsx b/components/NavigationBar/index.tsx deleted file mode 100644 index 20c4227..0000000 --- a/components/NavigationBar/index.tsx +++ /dev/null @@ -1,152 +0,0 @@ -// NavigationBar.tsx -import React, { useState } from 'react'; -import styled from 'styled-components'; -import COLORS from '@/styles/colors'; -import { Plant } from '@/types/schema'; - -interface NavigationBarProps { - currentIndex: number; - totalCount: number; - plantsToAdd: Plant[]; - onPrev: () => void; - onNext: () => void; - onSelectPlant: (index: number) => void; -} - -const NavigationBarContainer = styled.div` - display: flex; - justify-content: center; - align-items: center; - margin-bottom: 24px; -`; - -const NavigationButton = styled.button` - background-color: white; - color: ${COLORS.midgray}; - border: 1px solid ${COLORS.midgray}; - border-radius: 5px; - font-size: 14px; - cursor: pointer; - height: 30px; - width: 29px; - - &:first-child { - border-top-right-radius: 0; - border-bottom-right-radius: 0; - border-right: none; - } - - &:last-child { - border-top-left-radius: 0; - border-bottom-left-radius: 0; - border-left: none; - } - - &:not(:first-child) { - border-left: none; - } - - &:disabled { - cursor: not-allowed; - } -`; - -const DropdownToggle = styled.button` - height: 30px; - background-color: white; - color: ${COLORS.midgray}; - border: 1px solid #888; - font-size: 14px; - cursor: pointer; - width: 85px; -`; - -const DropdownContainer = styled.div` - position: relative; - display: flex; - justify-content: center; -`; - -const DropdownMenu = styled.div` - position: absolute; - top: 100%; - left: 50%; - transform: translateX(-50%); - background-color: white; - border: 1px solid ${COLORS.midgray}; - border-radius: 4px; - padding: 8px 0; - z-index: 1; - min-width: 200px; -`; -const DropdownItem = styled.button` - display: block; - width: 100%; - padding: 8px 16px; - text-align: left; - background-color: transparent; - border: none; - cursor: pointer; - - &:hover { - background-color: ${COLORS.lightgray}; - } -`; - -const NavigationBar: React.FC = ({ - currentIndex, - totalCount, - plantsToAdd, - onPrev, - onNext, - onSelectPlant, -}) => { - const [isDropdownOpen, setIsDropdownOpen] = useState(false); - - const toggleDropdown = () => { - setIsDropdownOpen(prevState => !prevState); - }; - - const handlePlantSelection = (index: number) => { - onSelectPlant(index); - setIsDropdownOpen(false); - }; - - return ( - - - {'<'} - - - - {currentIndex}/{plantsToAdd.length} - - {isDropdownOpen && ( - - {plantsToAdd.map((plant, index) => ( - handlePlantSelection(index + 1)} - > - {plant.plant_name} - - ))} - - )} - - - {'>'} - - - ); -}; - -export default NavigationBar;