Skip to content

Commit

Permalink
fixed console errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Bahugunajii committed Nov 14, 2023
1 parent f01d1db commit 867c232
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions app/library/page.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"use client"

import React, { useState } from 'react';
import React, { useState, useEffect } from 'react';
import { useRouter } from 'next/navigation';
import PrimaryButton from '@/components/Button';
import TopBar from '@/components/TopBar';
Expand All @@ -17,15 +17,11 @@ const Page: React.FC = () => {
setSelectedLibrary(library);
};

if (selectedLibrary === 'NEET Content') {
push(`/library/show?course=${selectedLibrary}`);
return null;
}

if (selectedLibrary === 'JEE Content') {
push(`/library/show?course=${selectedLibrary}`);
return null;
}
useEffect(() => {
if (selectedLibrary === 'NEET Content' || selectedLibrary === 'JEE Content') {
push(`/library/show?course=${selectedLibrary}`);
}
}, [selectedLibrary, push]);

const buttonStyle = 'mx-4 w-40 md:w-64';
const selectedButtonStyle = 'bg-white text-primary font-semibold';
Expand Down

0 comments on commit 867c232

Please sign in to comment.