Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

coursepages #645

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 36 additions & 1 deletion components/Curriculum/SubjCard.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,46 @@
import styles from "@styles/scss/subjcard.module.scss";
import Link from "next/link";
import Avatar from '@mui/material/Avatar';
// import InitialsAvatar from /'react-initials-avatar';
// import 'react-initials-avatar/lib/ReactInitialsAvatar.css';


function stringToColor(string) {
let hash = 0;
let i;

Copy link
Member

@anmode anmode May 24, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove this un import

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

okay

/* eslint-disable no-bitwise */
for (i = 0; i < string.length; i += 1) {
hash = string.charCodeAt(i) + ((hash << 5) - hash);
}

let color = '#';

for (i = 0; i < 3; i += 1) {
const value = (hash >> (i * 8)) & 0xff;
color += `00${value.toString(16)}`.slice(-2);
}
/* eslint-enable no-bitwise */

return color;
}

function stringAvatar(name) {
return {
sx: {
bgcolor: stringToColor(name),
},
children: `${name.split(' ')[0][0]}${name.split(' ')[0][1]}`,
};
}
const SubjCard = ({ details }) => {

return (
<Link href={details.linkToPage} passHref>
<div className={styles.subject}>
{/* <Image loading="lazy"></Image> */}
<div style={{display:"flex",justifyContent:"center",alignItems:"center", margin:'15px 0',padding:"10px 10px"}}>
<Avatar {...stringAvatar(details.name)} />
</div>
<span className={styles.name}>{details.name}</span>
</div>
</Link>
Expand Down
6 changes: 3 additions & 3 deletions components/common/Navbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -220,17 +220,17 @@ const Navbar = () => {
onClick={() => setDropdown(false)}
className={styles.dropdownLink}
>
B.Tech
B.Tech/B.E
</a>
</Link>
</li>
<li>
<Link href='/'>
<Link href='/courses/mbbs'>
<a
onClick={() => setDropdown(false)}
className={styles.dropdownLink}
>
BE
MBBS
</a>
</Link>
</li>
Expand Down
3 changes: 2 additions & 1 deletion data/semData.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@

export const firstYearSems = [
{
name: null,
subjects: [
{
name: "Applied Mathematics 1",
slug: "applied-mathematics-1",
img: null,
// img:( ),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

because I have used Initials Avatar for the subjects.

linkToPage: "/courses/btech/first-year/applied-mathematics-1",
},
{
Expand Down
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,13 @@
"lint": "next lint"
},
"dependencies": {
"@emotion/react": "^11.11.4",
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tip

Codebase Verification

The search for @emotion/react only found its entry in package.json and no actual usage in the codebase. This suggests that the dependency might be unnecessary.

  • Please verify if @emotion/react is indeed required or if it can be removed to avoid unnecessary bloat.
Analysis chain

Verify the usage of @emotion/react in the project to ensure it's necessary.

Scripts Executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Verify the usage of `@emotion/react` in the project.

# Test: Search for the library usage. Expect: At least one occurrence.
rg --type javascript '@emotion/react'

Length of output: 72



Script:

#!/bin/bash
# Description: Verify the usage of `@emotion/react` in the project.

# Test: Search for the library usage. Expect: At least one occurrence.
rg --type js '@emotion/react'

Length of output: 29



Script:

#!/bin/bash
# Description: Verify the usage of `@emotion/react` in the project.

# Test: Search for the library usage in .js, .jsx, and .tsx files. Expect: At least one occurrence.
rg --type-add 'jsx:*.{jsx,tsx}' '@emotion/react'

Length of output: 95

"@emotion/styled": "^11.11.5",
Copy link

@coderabbitai coderabbitai bot May 20, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tip

Codebase Verification

The dependency @emotion/styled is not used in the codebase and may be unnecessary.

  • package.json: Line 12
Analysis chain

Verify the usage of @emotion/styled in the project to ensure it's necessary.

Scripts Executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Verify the usage of `@emotion/styled` in the project.

# Test: Search for the library usage. Expect: At least one occurrence.
rg --type javascript '@emotion/styled'

Length of output: 73



Script:

#!/bin/bash
# Description: Verify the usage of `@emotion/styled` in the project.

# Test: Search for the library usage. Expect: At least one occurrence.
rg --type js '@emotion/styled'

Length of output: 30



Script:

#!/bin/bash
# Description: Verify the usage of `@emotion/styled` in the project.

# Test: Search for the library usage in JavaScript and TypeScript files. Expect: At least one occurrence.
rg --type-add 'js:*.{js,jsx,ts,tsx}' '@emotion/styled'

Length of output: 102

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why you added these two packages.. are they really required?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@anmode, the analysis indicates that both @emotion/react and @emotion/styled are listed in the package.json but are not actively used in any JavaScript or TypeScript files within the project. This suggests that these packages might have been added unnecessarily.

It's a good practice to keep the project dependencies minimal to reduce the bundle size and potential maintenance overhead. You might want to verify if these packages are planned to be used in future developments. If not, consider removing them to keep the project clean and efficient. If you need further assistance or have plans for these packages, please let me know!

Analysis chain
Scripts executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Verify the usage of `@emotion/react` in the project.

# Test: Search for the library usage in JavaScript and TypeScript files. Expect: At least one occurrence.
rg --type-add 'js:*.{js,jsx,ts,tsx}' '@emotion/react'

Length of output: 100

"@fortawesome/fontawesome-svg-core": "^1.2.36",
"@fortawesome/free-brands-svg-icons": "^5.15.4",
"@fortawesome/free-solid-svg-icons": "^5.15.4",
"@fortawesome/react-fontawesome": "^0.2.0",
"@mui/material": "^5.15.18",
"aos": "^2.3.4",
"axios": "^0.27.2",
"bcryptjs": "^2.4.3",
Expand Down
50 changes: 50 additions & 0 deletions pages/courses/btech/ChemicalEngineering/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
import Footer from "components/common/Footer";
import Header from "components/common/Header/Header";
import Sems from "components/Curriculum/Sems";
import { firstYearSems } from "data/semData";
import styles from '@styles/Home.module.css';
const ComputerEngineering = () => {
return (
<div>
<Header image="/images/blog/blog_bg.svg" text="Chemical Engineering" />
<div
data-aos='fade-up'
className={styles.ourserv}
id={styles.ourserv}
>
<h2>First Year</h2>
/</div>
<Sems data={firstYearSems} />
{/* second yr */}
<div
data-aos='fade-up'
className={styles.ourserv}
id={styles.ourserv}
>
<h2>Second Year</h2>
/</div>
<Sems data={firstYearSems} />
{/* third Year*/}
<div
data-aos='fade-up'
className={styles.ourserv}
id={styles.ourserv}
>
<h2>Third Year</h2>
/</div>
<Sems data={firstYearSems} />
{/* fourth */}
<div
data-aos='fade-up'
className={styles.ourserv}
id={styles.ourserv}
>
<h2>Fourth Year</h2>
/</div>
<Sems data={firstYearSems} />
<Footer />
</div>
);
};

export default ComputerEngineering;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ensure the component name matches the file context.

The component is named ComputerEngineering but it is used in the ChemicalEngineering directory. This could lead to confusion and errors in maintenance. Consider renaming the component to ChemicalEngineering to match the file context.

- const ComputerEngineering = () => {
+ const ChemicalEngineering = () => {

Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.

Suggested change
const ComputerEngineering = () => {
return (
<div>
<Header image="/images/blog/blog_bg.svg" text="Chemical Engineering" />
<div
data-aos='fade-up'
className={styles.ourserv}
id={styles.ourserv}
>
<h2>First Year</h2>
/</div>
<Sems data={firstYearSems} />
{/* second yr */}
<div
data-aos='fade-up'
className={styles.ourserv}
id={styles.ourserv}
>
<h2>Second Year</h2>
/</div>
<Sems data={firstYearSems} />
{/* third Year*/}
<div
data-aos='fade-up'
className={styles.ourserv}
id={styles.ourserv}
>
<h2>Third Year</h2>
/</div>
<Sems data={firstYearSems} />
{/* fourth */}
<div
data-aos='fade-up'
className={styles.ourserv}
id={styles.ourserv}
>
<h2>Fourth Year</h2>
/</div>
<Sems data={firstYearSems} />
<Footer />
</div>
);
};
export default ComputerEngineering;
const ChemicalEngineering = () => {
return (
<div>
<Header image="/images/blog/blog_bg.svg" text="Chemical Engineering" />
<div
data-aos='fade-up'
className={styles.ourserv}
id={styles.ourserv}
>
<h2>First Year</h2>
/</div>
<Sems data={firstYearSems} />
{/* second yr */}
<div
data-aos='fade-up'
className={styles.ourserv}
id={styles.ourserv}
>
<h2>Second Year</h2>
/</div>
<Sems data={firstYearSems} />
{/* third Year*/}
<div
data-aos='fade-up'
className={styles.ourserv}
id={styles.ourserv}
>
<h2>Third Year</h2>
/</div>
<Sems data={firstYearSems} />
{/* fourth */}
<div
data-aos='fade-up'
className={styles.ourserv}
id={styles.ourserv}
>
<h2>Fourth Year</h2>
/</div>
<Sems data={firstYearSems} />
<Footer />
</div>
);
};
export default ComputerEngineering;

68 changes: 68 additions & 0 deletions pages/courses/btech/CivilEngineering/[subject].js
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
import Subject from "components/Curriculum/Subject";
import { getSubjectPages } from "data/semData";

export const getStaticPaths = async () => {
const paths = [
{
params: {
subject: "applied-mathematics-1",
},
},
{
params: {
subject: "applied-chemistry",
},
},
{
params: {
subject: "thermo-dynamics",
},
},
{
params: {
subject: "electrical-engineering",
},
},
{
params: {
subject: "environmental-studies",
},
},
{
params: {
subject: "applied-chemistry-lab",
},
},
{
params: {
subject: "computer-programming-lab",
},
},
];

return {
paths,
fallback: false,
};
};

export const getStaticProps = async (context) => {
let subject = context.params.subject;
const data = getSubjectPages(subject);

if (data == null || data == undefined) {
return { notFound: true };
}

return { props: { data } };
};

const GeneralSubject = ({ data }) => {
return (
<>
<Subject data={data} />
</>
);
};

export default GeneralSubject;
50 changes: 50 additions & 0 deletions pages/courses/btech/CivilEngineering/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
import Footer from "components/common/Footer";
import Header from "components/common/Header/Header";
import Sems from "components/Curriculum/Sems";
import { firstYearSems } from "data/semData";
import styles from '@styles/Home.module.css';
const ComputerEngineering = () => {
return (
<div>
<Header image="/images/blog/blog_bg.svg" text="Civil Engineering" />
<div
data-aos='fade-up'
className={styles.ourserv}
id={styles.ourserv}
>
<h2>First Year</h2>
/</div>
<Sems data={firstYearSems} />
{/* second yr */}
<div
data-aos='fade-up'
className={styles.ourserv}
id={styles.ourserv}
>
<h2>Second Year</h2>
/</div>
<Sems data={firstYearSems} />
{/* third Year*/}
<div
data-aos='fade-up'
className={styles.ourserv}
id={styles.ourserv}
>
<h2>Third Year</h2>
/</div>
<Sems data={firstYearSems} />
{/* fourth */}
<div
data-aos='fade-up'
className={styles.ourserv}
id={styles.ourserv}
>
<h2>Fourth Year</h2>
/</div>
<Sems data={firstYearSems} />
<Footer />
</div>
);
};

export default ComputerEngineering;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ensure the component name matches the file context.

The component is named ComputerEngineering but it is used in the CivilEngineering directory. This could lead to confusion and errors in maintenance. Consider renaming the component to CivilEngineering to match the file context.

- const ComputerEngineering = () => {
+ const CivilEngineering = () => {

Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.

Suggested change
const ComputerEngineering = () => {
return (
<div>
<Header image="/images/blog/blog_bg.svg" text="Civil Engineering" />
<div
data-aos='fade-up'
className={styles.ourserv}
id={styles.ourserv}
>
<h2>First Year</h2>
/</div>
<Sems data={firstYearSems} />
{/* second yr */}
<div
data-aos='fade-up'
className={styles.ourserv}
id={styles.ourserv}
>
<h2>Second Year</h2>
/</div>
<Sems data={firstYearSems} />
{/* third Year*/}
<div
data-aos='fade-up'
className={styles.ourserv}
id={styles.ourserv}
>
<h2>Third Year</h2>
/</div>
<Sems data={firstYearSems} />
{/* fourth */}
<div
data-aos='fade-up'
className={styles.ourserv}
id={styles.ourserv}
>
<h2>Fourth Year</h2>
/</div>
<Sems data={firstYearSems} />
<Footer />
</div>
);
};
export default ComputerEngineering;
const CivilEngineering = () => {
return (
<div>
<Header image="/images/blog/blog_bg.svg" text="Civil Engineering" />
<div
data-aos='fade-up'
className={styles.ourserv}
id={styles.ourserv}
>
<h2>First Year</h2>
/</div>
<Sems data={firstYearSems} />
{/* second yr */}
<div
data-aos='fade-up'
className={styles.ourserv}
id={styles.ourserv}
>
<h2>Second Year</h2>
/</div>
<Sems data={firstYearSems} />
{/* third Year*/}
<div
data-aos='fade-up'
className={styles.ourserv}
id={styles.ourserv}
>
<h2>Third Year</h2>
/</div>
<Sems data={firstYearSems} />
{/* fourth */}
<div
data-aos='fade-up'
className={styles.ourserv}
id={styles.ourserv}
>
<h2>Fourth Year</h2>
/</div>
<Sems data={firstYearSems} />
<Footer />
</div>
);
};
export default ComputerEngineering;

68 changes: 68 additions & 0 deletions pages/courses/btech/ComputerEngineering/[subject].js
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
import Subject from "components/Curriculum/Subject";
import { getSubjectPages } from "data/semData";

export const getStaticPaths = async () => {
const paths = [
{
params: {
subject: "applied-mathematics-1",
},
},
{
params: {
subject: "applied-chemistry",
},
},
{
params: {
subject: "thermo-dynamics",
},
},
{
params: {
subject: "electrical-engineering",
},
},
{
params: {
subject: "environmental-studies",
},
},
{
params: {
subject: "applied-chemistry-lab",
},
},
{
params: {
subject: "computer-programming-lab",
},
},
];

return {
paths,
fallback: false,
};
};

export const getStaticProps = async (context) => {
let subject = context.params.subject;
const data = getSubjectPages(subject);

if (data == null || data == undefined) {
return { notFound: true };
}

return { props: { data } };
};

const GeneralSubject = ({ data }) => {
return (
<>
<Subject data={data} />
</>
);
};

export default GeneralSubject;
50 changes: 50 additions & 0 deletions pages/courses/btech/ComputerEngineering/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
import Footer from "components/common/Footer";
import Header from "components/common/Header/Header";
import Sems from "components/Curriculum/Sems";
import { firstYearSems } from "data/semData";
import styles from '@styles/Home.module.css';
const ComputerEngineering = () => {
return (
<div>
<Header image="/images/blog/blog_bg.svg" text="Computer Engineering" />
<div
data-aos='fade-up'
className={styles.ourserv}
id={styles.ourserv}
>
<h2>First Year</h2>
/</div>
<Sems data={firstYearSems} />
{/* second yr */}
<div
data-aos='fade-up'
className={styles.ourserv}
id={styles.ourserv}
>
<h2>Second Year</h2>
/</div>
<Sems data={firstYearSems} />
{/* third Year*/}
<div
data-aos='fade-up'
className={styles.ourserv}
id={styles.ourserv}
>
<h2>Third Year</h2>
/</div>
<Sems data={firstYearSems} />
{/* fourth */}
<div
data-aos='fade-up'
className={styles.ourserv}
id={styles.ourserv}
>
<h2>Fourth Year</h2>
/</div>
<Sems data={firstYearSems} />
<Footer />
</div>
);
};

export default ComputerEngineering;
Loading
Loading