diff --git a/components/CreatePlan.tsx b/components/CreatePlan.tsx
index f024d06..9705eb7 100644
--- a/components/CreatePlan.tsx
+++ b/components/CreatePlan.tsx
@@ -34,6 +34,7 @@ export default function CreatePlan(props: any) {
const { data: session, status } = useSession();
const [coursePlanName, setCoursePlanName]: any = useState("");
const [selectedCoursePlan, setSelectedCoursePlan]: any = useState([]);
+ const [isScrolled, setIsScrolled] = useState(false);
const fetcher = (url: any) => fetch(url).then((r) => r.json());
const { data, isLoading, error } = useSWR("/api/getplancourses", fetcher, {
@@ -166,82 +167,103 @@ export default function CreatePlan(props: any) {
};
const scrollToPlan = () => {
- if (scrollRef.current)
+ console.log("A");
+ if (scrollRef.current) {
+ console.log("B");
scrollRef.current.scrollIntoView({ behavior: "smooth", inline: "start" });
+ setIsScrolled(true);
+ }
+ };
+
+ const scrollToTop = () => {
+ console.log("C");
+ window.scrollTo({
+ top: 0,
+ behavior: "smooth",
+ });
+ setIsScrolled(false);
};
return (
-
- {/*
*/}
-
-
-
Create a Plan
-
-
{
- setCoursePlanName(event.target.value);
- }}
- />
-
}
- size="md"
- onClick={() => createPlan()}
- >
+ <>
+
+
+
+
+
Create a Plan
+
+ {
+ setCoursePlanName(event.target.value);
+ }}
+ />
+ }
+ size="md"
+ onClick={() => createPlan()}
+ >
+
-
-
-
- {/* --------------------------------- or --------------------------- */}
-
or
-
-
+
+
+ {/* --------------------------------- or --------------------------- */}
+
or
+
+
-
-
Select a Plan
-
-
-
-
}
- onClick={deletePlan}
- />
-
} />
+
+
Select a Plan
+
+
+
+ }
+ onClick={deletePlan}
+ />
+ } />
+
-
-
-
+ >
);
}
diff --git a/tailwind.config.js b/tailwind.config.js
index 4832ba3..3d455c7 100644
--- a/tailwind.config.js
+++ b/tailwind.config.js
@@ -35,6 +35,7 @@ module.exports = {
DEFAULT: "#9FADBC",
foreground: "#1D2125",
},
+ secondary: "#F46523",
focus: "#BEF264",
},
},