Skip to content

Commit

Permalink
Added CN Front page
Browse files Browse the repository at this point in the history
  • Loading branch information
joonshakya committed Dec 5, 2023
1 parent 429bb7c commit cde8d21
Show file tree
Hide file tree
Showing 6 changed files with 45 additions and 4 deletions.
2 changes: 0 additions & 2 deletions components/ClassRoutine.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,6 @@ export default function ClassRoutine({ sem }) {
return () => clearInterval(dateCheck);
}, []);

console.log({ todayDayName, tomorrowDayName });

return (
<Card
sx={{
Expand Down
34 changes: 32 additions & 2 deletions components/FrontPageGenerator.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import {
caAssignments,
nmAssignments,
dsaAssignments,
cnAssignments,
} from "../utils/constants";
import { prefetchDocument } from "../utils/frontPageGenerator";
import useFrontPageGenerator from "../utils/frontPageGenerator";
Expand All @@ -38,7 +39,7 @@ export default function FrontPageGenerator({ sem }) {
const wordFileLoaded = useBaseStore((state) => state.wordFileLoaded);

const assignmentsWithTopics = useMemo(() => {
return ["DL", "FIT", "DS", "OOP", "CA", "NM", "DSA"];
return ["DL", "FIT", "DS", "OOP", "CA", "NM", "DSA", "CN"];
}, []);

const assignmentsWithoutTopics = useMemo(() => {
Expand All @@ -54,13 +55,17 @@ export default function FrontPageGenerator({ sem }) {
];
}, []);

const initialSubject = "CA";
const initialSubject = "CN";

const [tab, setTab] = useState("assignment");
const [subject, setSubject] = useState(initialSubject);

const assignmentLists = useMemo(() => {
return [
{
subject: "CN",
assignments: cnAssignments,
},
{
subject: "DSA",
assignments: dsaAssignments,
Expand Down Expand Up @@ -373,6 +378,31 @@ export default function FrontPageGenerator({ sem }) {
// backgroundColor: "#f3f4f9",
}}
>
<Box
sx={{
display: "flex",
flexWrap: "wrap",
justifyContent: "center",
}}
>
{(tab === "assignment"
? [
{
shortHand: "CN",
longHand: "CN",
},
]
: []
).map((subject, index) => (
<FormControlLabel
key={index}
value={subject.shortHand}
defaultChecked={index === 0}
control={<Radio />}
label={subject.longHand}
/>
))}
</Box>
<Box
sx={{
display: "flex",
Expand Down
Binary file added public/static/word-templates/CN.docx
Binary file not shown.
1 change: 1 addition & 0 deletions src/store.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ export const useWordStore = create((set) => ({
DSA: null,
CA: null,
NM: null,
CN: null,
setWordFile: ({ subject, content }) => {
set(() => ({
[subject]: content,
Expand Down
9 changes: 9 additions & 0 deletions utils/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -1385,6 +1385,7 @@ export const names = {
46: ["Swoyesh Shrestha", "021BSCIT046", "B"],
47: ["Yogesh Rijal", "021BSCIT047", "B"],
48: ["Yubraj Khatiwada", "021BSCIT048", "B"],
49: ["Laviz Pandey", "021BSCIT049", "B"],
},
sem3: {
1: ["Aakash Shrestha", "021BSCIT001", "A"],
Expand Down Expand Up @@ -2475,6 +2476,14 @@ export const opCodes = [
},
];

export const cnAssignments = [
{
number: 1,
name: "Familiarizing with DOS Commands for Networking",
selected: true,
},
];

export const nmAssignments = [
{
number: 1,
Expand Down
3 changes: 3 additions & 0 deletions utils/frontPageGenerator/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import {
caAssignments,
nmAssignments,
dsaAssignments,
cnAssignments,
} from "../constants";
import { useState } from "react";
import { useBaseStore } from "../../src/store";
Expand Down Expand Up @@ -51,6 +52,7 @@ export default function useFrontPageGenerator() {
CA: caAssignments,
NM: nmAssignments,
DSA: dsaAssignments,
CN: cnAssignments,
};

if (Object.prototype.hasOwnProperty.call(assignmentMap, subject)) {
Expand All @@ -70,6 +72,7 @@ export default function useFrontPageGenerator() {
roll: names[sem][roll][1],
assignmentNumber,
assignmentName,
assignmentNameUpper: assignmentName.toUpperCase(),
subject: indexSubjectTable[subject],
section: names[sem][roll][2],
};
Expand Down

0 comments on commit cde8d21

Please sign in to comment.