Skip to content

Commit

Permalink
remove nav button usage
Browse files Browse the repository at this point in the history
  • Loading branch information
SashankBalusu committed Dec 11, 2024
1 parent 8fb2da5 commit 869222b
Showing 1 changed file with 3 additions and 15 deletions.
18 changes: 3 additions & 15 deletions app/add-details/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,10 @@
import { useState } from 'react';
import { useRouter } from 'next/navigation';
import { insertUserPlants } from '@/api/supabase/queries/userPlants';
import NavigationBar from '@/components/NavigationBar';
import PlantDetails from '@/components/PlantDetails';
import COLORS from '@/styles/colors';
import { Flex } from '@/styles/containers';
import { H1 } from '@/styles/text';
import { H1, P1 } from '@/styles/text';
import { UserPlant } from '@/types/schema';
import { useAuth } from '@/utils/AuthProvider';
import { useProfile } from '@/utils/ProfileProvider';
Expand Down Expand Up @@ -79,9 +78,6 @@ export default function Home() {
await insertUserPlants(userId!, details);
router.push('/view-plants');
}
const handlePlantSelection = (index: number) => {
setCurrentIndex(index);
};

return (
<>
Expand All @@ -90,17 +86,9 @@ export default function Home() {
<Flex $direction="column" $justify="start">
<Flex $gap="16px" $direction="column" $textAlign="center">
<H1 $color={COLORS.shrub}>Add Plant Details</H1>
{/* <P1 $color={COLORS.midgray}>
<P1 $color={COLORS.midgray}>
{currentIndex} / {plantsToAdd.length}
</P1> */}
<NavigationBar
currentIndex={currentIndex}
totalCount={plantsToAdd.length}
plantsToAdd={plantsToAdd}
onPrev={() => move(-1)}
onNext={() => move(1)}
onSelectPlant={handlePlantSelection}
/>
</P1>
</Flex>
<PlantDetails
plant={plantsToAdd[currentIndex - 1]}
Expand Down

0 comments on commit 869222b

Please sign in to comment.