-
Notifications
You must be signed in to change notification settings - Fork 173
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
Merge the first commit please ignore the second one. Kindly add GSSOC24 label to it #656
base: develop
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Thank you, @ShoveetSingh, for creating this pull request and contributing to GitHub-ReadMe! 💗 Our review team will thoroughly review the pull request and will reach out to you soon! 😇 |
WalkthroughWalkthroughThe changes introduce a new workflow for deploying a Next.js site to GitHub Pages, update various components to improve data handling and UI, and enhance backend functionality with new API endpoints and database schema adjustments. The updates also include minor styling changes and version upgrades for dependencies. Changes
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 13
Outside diff range and nitpick comments (8)
components/Opportunities/oppCard.js (1)
Line range hint
5-25
: Refactor the component for clarity and correct HTML element usage.The destructuring from
data.data
can be confusing. Consider renaming the parameter for clarity. Also, use the correct HTMLimg
tag instead ofimage
.- const OppCard = (data) => { - const { title, date, image } = data.data; + const OppCard = ({ data }) => { + const { title, date, image } = data; - <image src={`/images/oppCard/${image}`} /> + <img src={`/images/oppCard/${image}`} alt={title} />components/common/Header/Header.js (1)
Line range hint
27-27
: Use self-closing tags for elements without children and avoid using index as key in lists.- <IconContainer key={idx} iconConfig={iconItem}></IconContainer> + <IconContainer key={iconItem.id} iconConfig={iconItem} />components/Blogs/BlogCard.js (1)
Line range hint
3-31
: Resolve merge conflicts in the file.- <<<<<<< HEAD:components/Blogs/BlogCard.js - import dataScienceImg from "@images/blog/dataScience.webp"; - ======= - >>>>>>> 2e3ced3f1a6c1a70341b50aee0bde119b118a150:components/BlogCard.js + import dataScienceImg from "@images/blog/dataScience.webp";pages/blog/index.js (1)
Line range hint
6-87
: Resolve merge conflicts and correct the export statements in the file.- <<<<<<< HEAD - import blogData from "/data/blogdata"; - ======= - >>>>>>> 2e3ced3f1a6c1a70341b50aee0bde119b118a150 + import blogData from "/data/blogdata"; - export default function Blogs() + export const getStaticProps = async () => { + const res = await fetch('http://localhost:3000/api/blogs/fetchBlogs'); + const blogsData = await res.json(); + return { + props: { blogsData } + } + } + export default function Blogs({ blogsData }) {pages/Login.js (3)
13-13
: Add a comment explaining the purpose of this import.Consider adding a comment above the import statement to explain why
Link
from 'next/link' is being imported, especially if it's for navigation purposes which might not be immediately obvious.
Line range hint
49-49
: Mark JSX elements without children as self-closing.- <div className={styles.overlay} onClick={closeLoginPanel}></div> + <div className={styles.overlay} onClick={closeLoginPanel} /> - <div className={styles.logo}> - <Image loading="lazy" src={logo} alt="Amupedia Logo"></Image> - </div> + <div className={styles.logo}> + <Image loading="lazy" src={logo} alt="Amupedia Logo" /> + </div> - <div id="googleSignIn" className={styles.googleSignIn}></div> + <div id="googleSignIn" className={styles.googleSignIn} />This change makes the code cleaner and more in line with JSX best practices.
Also applies to: 52-52, 54-54
Line range hint
49-49
: Add keyboard accessibility for clickable elements.- <div className={styles.overlay} onClick={closeLoginPanel}></div> + <div className={styles.overlay} onClick={closeLoginPanel} onKeyUp={closeLoginPanel} tabIndex="0"></div>This modification enhances accessibility by allowing keyboard-only users to interact with the clickable overlay.
components/common/Navbar.js (1)
6-6
: Document the purpose of importingFaKey
.Consider adding a comment above the import statement to explain the use of
FaKey
from 'react-icons/fa', especially if it's for a specific feature like a login icon which might not be immediately obvious.
Review Details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files ignored due to path filters (1)
public/images/blog/test.png
is excluded by!**/*.png
Files selected for processing (20)
- .github/workflows/nextjs.yml (1 hunks)
- components/Blogs/BlogCard.js (2 hunks)
- components/Opportunities/oppCard.js (1 hunks)
- components/common/Header/Header.js (1 hunks)
- components/common/Navbar.js (2 hunks)
- db/models/Blog.js (1 hunks)
- db/models/BlogComment.js (1 hunks)
- package.json (1 hunks)
- pages/Login.js (2 hunks)
- pages/Signup.js (1 hunks)
- pages/_app.js (3 hunks)
- pages/adFix.js (1 hunks)
- pages/api/blogs/comments/fetchComments.js (1 hunks)
- pages/api/blogs/comments/publishComment.js (1 hunks)
- pages/api/blogs/fetchBlogs.js (1 hunks)
- pages/api/blogs/publishBlog.js (1 hunks)
- pages/api/opportunities/publishOpportunity.js (1 hunks)
- pages/blog/[blogId].js (6 hunks)
- pages/blog/index.js (4 hunks)
- styles/BlogDetail.module.css (2 hunks)
Files skipped from review due to trivial changes (4)
- pages/Signup.js
- pages/api/blogs/publishBlog.js
- pages/api/opportunities/publishOpportunity.js
- styles/BlogDetail.module.css
Additional Context Used
Biome (127)
components/Blogs/BlogCard.js (20)
2-3: Expected a statement but instead found '<<<<<<< HEAD:components/Blogs/BlogCard.js'.
4-6: Expected a statement but instead found '=======
2e3ced3:components/BlogCard.js'.
6-6: numbers cannot be followed by identifiers directly after
10-11: Expected a statement but instead found '<<<<<<< HEAD:components/Blogs/BlogCard.js'.
12-13: Expected a statement but instead found '======='.
14-15: Expected a statement but instead found '>>>>>>> 2e3ced3:components/BlogCard.js'.
15-15: numbers cannot be followed by identifiers directly after
23-24: Expected a JSX Expression, a Element, or a text but instead found '<<<<<<'.
24-24: expected
>
but instead foundBlogs
30-31: Unexpected token. Did you mean
{'>'}
or>
?
31-31: Unexpected token. Did you mean
{'>'}
or>
?
31-31: Unexpected token. Did you mean
{'>'}
or>
?
31-31: Unexpected token. Did you mean
{'>'}
or>
?
31-31: Unexpected token. Did you mean
{'>'}
or>
?
31-31: Unexpected token. Did you mean
{'>'}
or>
?
31-31: Unexpected token. Did you mean
{'>'}
or>
?
19-19: Use === instead of ==.
== is only allowed when comparing againstnull
14-14: Shouldn't redeclare 'id'. Consider to delete it or rename it.
14-14: Shouldn't redeclare 'title'. Consider to delete it or rename it.
14-14: Shouldn't redeclare 'image'. Consider to delete it or rename it.
components/Opportunities/oppCard.js (1)
18-18: Provide a href attribute for the a element.
components/common/Header/Header.js (2)
27-27: JSX elements without children should be marked as self-closing. In JSX, it is valid for any element to be self-closing.
27-27: Avoid using the index of an array as key property in an element.
components/common/Navbar.js (17)
103-109: JSX elements without children should be marked as self-closing. In JSX, it is valid for any element to be self-closing.
113-125: JSX elements without children should be marked as self-closing. In JSX, it is valid for any element to be self-closing.
113-125: Enforce to have the onClick mouse event with the onKeyUp, the onKeyDown, or the onKeyPress keyboard event.
139-144: Use a button element instead of an a element.
173-178: Use a button element instead of an a element.
189-195: Enforce to have the onClick mouse event with the onKeyUp, the onKeyDown, or the onKeyPress keyboard event.
197-204: Use a button element instead of an a element.
221-221: Use a button element instead of an a element.
231-231: Use a button element instead of an a element.
241-241: Use a button element instead of an a element.
251-251: Use a button element instead of an a element.
272-278: Use a button element instead of an a element.
311-317: Use a button element instead of an a element.
336-342: Use a button element instead of an a element.
357-364: Use a button element instead of an a element.
374-374: Use a button element instead of an a element.
108-108: Avoid passing content using the dangerouslySetInnerHTML prop.
package.json (20)
13-14: unexpected character
<
14-14: unexpected character
<
14-14: unexpected character
<
14-14: unexpected character
<
14-14: unexpected character
<
14-14: unexpected character
<
14-14: unexpected character
<
14-14: String values must be double quoted.
15-15: End of file expected
15-15: End of file expected
15-15: End of file expected
15-15: End of file expected
16-16: End of file expected
16-16: End of file expected
16-16: End of file expected
16-17: End of file expected
16-17: unexpected character
=
17-17: unexpected character
=
17-17: unexpected character
=
17-17: unexpected character
=
pages/Login.js (6)
49-49: JSX elements without children should be marked as self-closing. In JSX, it is valid for any element to be self-closing.
49-49: Enforce to have the onClick mouse event with the onKeyUp, the onKeyDown, or the onKeyPress keyboard event.
52-52: JSX elements without children should be marked as self-closing. In JSX, it is valid for any element to be self-closing.
54-54: JSX elements without children should be marked as self-closing. In JSX, it is valid for any element to be self-closing.
101-101: Provide a href attribute for the a element.
98-98: Provide an explicit type prop for the button element.
pages/_app.js (20)
1-1: Expected a statement but instead found '<<<<<<< HEAD'.
3-4: Expected a statement but instead found '======='.
6-7: Expected a statement but instead found '>>>>>>> 2e3ced3'.
7-7: numbers cannot be followed by identifiers directly after
102-103: Expected a JSX Expression, a Element, or a text but instead found '<<<<<<'.
105-105: expected
>
but instead found<
103-103: Expected corresponding JSX closing tag for 'HEAD'.
97-97: Expected corresponding JSX closing tag for 'Head'.
84-96: Expected corresponding JSX closing tag for 'motion.div'.
80-80: Expected corresponding JSX closing tag for 'StoreProvider'.
191-191: expected
)
but instead foundstyles
191-191: Expected a property, a shorthand property, a getter, a setter, or a method but instead found '{ position'.
191-191: expected
,
but instead found:
191-193: Expected a statement but instead found '>
<Component'.
193-193: Expected an expression but instead found '...pageProps'.
193-202: Expected a statement but instead found '>
<Script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-6172950963478417" crossOrigin="anonymous" ></Script>
</motion.div>
)'.
202-204: Expected a statement but instead found '>>>>>>> 2e3ced3
}'.
203-203: numbers cannot be followed by identifiers directly after
145-145: JSX elements without children should be marked as self-closing. In JSX, it is valid for any element to be self-closing.
146-150: JSX elements without children should be marked as self-closing. In JSX, it is valid for any element to be self-closing.
pages/api/blogs/comments/publishComment.js (1)
19-19: Template literals are preferred over string concatenation.
pages/blog/[blogId].js (20)
13-14: Expected a statement but instead found '<<<<<<< HEAD'.
30-31: Expected a statement but instead found '======='.
31-32: Illegal use of an import declaration not at the top level
32-33: Illegal use of an import declaration not at the top level
34-35: Illegal use of an import declaration not at the top level
63-64: Expected a statement but instead found '>>>>>>> 2e3ced3'.
64-64: numbers cannot be followed by identifiers directly after
69-70: Expected a JSX Expression, a Element, or a text but instead found '<<<<<<'.
71-71: expected
>
but instead found<
70-70: Expected corresponding JSX closing tag for 'HEAD'.
73-74: Unexpected token. Did you mean
{'>'}
or>
?
74-74: Unexpected token. Did you mean
{'>'}
or>
?
74-74: Unexpected token. Did you mean
{'>'}
or>
?
74-74: Unexpected token. Did you mean
{'>'}
or>
?
74-74: Unexpected token. Did you mean
{'>'}
or>
?
74-74: Unexpected token. Did you mean
{'>'}
or>
?
74-74: Unexpected token. Did you mean
{'>'}
or>
?
136-137: Expected a JSX Expression, a Element, or a text but instead found '<<<<<<'.
138-138: expected
>
but instead found<
137-137: Expected corresponding JSX closing tag for 'HEAD'.
pages/blog/index.js (20)
5-6: Expected a statement but instead found '<<<<<<< HEAD'.
22-23: Expected a statement but instead found '======='.
25-33: Illegal use of an export declaration not at the top level
35-36: Expected a statement but instead found '>>>>>>> 2e3ced3'.
36-36: numbers cannot be followed by identifiers directly after
57-58: Expected a JSX Expression, a Element, or a text but instead found '<<<<<<'.
59-59: expected
...
but instead foundfilteredBlogData
74-74: expected
>
but instead found<
58-73: Expected corresponding JSX closing tag for 'HEAD'.
34-91: Illegal use of an export declaration not at the top level
86-87: Unexpected token. Did you mean
{'>'}
or>
?
87-87: Unexpected token. Did you mean
{'>'}
or>
?
87-87: Unexpected token. Did you mean
{'>'}
or>
?
87-87: Unexpected token. Did you mean
{'>'}
or>
?
87-87: Unexpected token. Did you mean
{'>'}
or>
?
87-87: Unexpected token. Did you mean
{'>'}
or>
?
87-87: Unexpected token. Did you mean
{'>'}
or>
?
91-91: expected
}
but instead the file ends
13-91: Illegal duplicate default export declarations
58-74: JSX elements without children should be marked as self-closing. In JSX, it is valid for any element to be self-closing.
Additional comments not posted (8)
db/models/BlogComment.js (2)
3-18
: Schema definition looks good.The
blogCommentSchema
is well-defined with appropriate data types and required constraints. Good job ensuring data integrity with these settings.
21-22
: Model export is correctly implemented.The conditional check to avoid redefining the model if it already exists is a good practice in Mongoose applications.
pages/api/blogs/fetchBlogs.js (1)
6-16
: API handler function is well-implemented.The function correctly handles database connections, data fetching, and error responses. Good use of async/await for asynchronous operations.
db/models/Blog.js (1)
19-26
: Added fields in the schema are correctly defined.The fields
like
andnumberOfComments
are well-defined with appropriate data types and required constraints. This ensures that every blog entry will have these fields initialized properly.pages/api/blogs/comments/fetchComments.js (1)
6-16
: API handler function for fetching comments is well-implemented.The function correctly handles database connections, comment fetching, and error responses. Good use of async/await for asynchronous operations.
pages/api/blogs/comments/publishComment.js (1)
8-10
: Database connection and data extraction are handled appropriately.Also applies to: 21-21
components/common/Header/Header.js (1)
Line range hint
8-26
: The rest of the component structure and logic appear sound..github/workflows/nextjs.yml (1)
1-94
: The GitHub Actions workflow is well-configured for building and deploying the Next.js site.
} | ||
}, 0); | ||
|
||
console.log("Testing"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove debugging code from production.
The console.log("Testing");
appears to be a debugging statement. It's a good practice to remove such statements from production code to clean up the output and improve performance.
- console.log("Testing");
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.
console.log("Testing"); |
@@ -95,6 +96,10 @@ const Login = () => { | |||
<span>Forgot Password ?</span> | |||
</label> | |||
<button>Sign In</button> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Specify the type of the button for better accessibility and validation.
- <button>Sign In</button>
+ <button type="submit">Sign In</button>
Explicitly setting the type of the button to "submit" clarifies its function within a form, improving both accessibility and form behavior.
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.
<button>Sign In</button> | |
<button type="submit">Sign In</button> |
@@ -95,6 +96,10 @@ | |||
<span>Forgot Password ?</span> | |||
</label> | |||
<button>Sign In</button> | |||
<h1 className="font-bold text-lg p-4">Or</h1> | |||
<Link href='/Signup'> | |||
<a className="font-sans text-sm font-bold text-white hover:italic bg-gradient-to-r from-indigo-800 to-purple-600 rounded-md px-24 py-1">Signup</a> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Correct the anchor tag to include a href
attribute.
- <a className="font-sans text-sm font-bold text-white hover:italic bg-gradient-to-r from-indigo-800 to-purple-600 rounded-md px-24 py-1">Signup</a>
+ <a href="/Signup" className="font-sans text-sm font-bold text-white hover:italic bg-gradient-to-r from-indigo-800 to-purple-600 rounded-md px-24 py-1">Signup</a>
This fix ensures that the anchor tag correctly uses the href
attribute, which is necessary for proper navigation and SEO.
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.
<a className="font-sans text-sm font-bold text-white hover:italic bg-gradient-to-r from-indigo-800 to-purple-600 rounded-md px-24 py-1">Signup</a> | |
<a href="/Signup" className="font-sans text-sm font-bold text-white hover:italic bg-gradient-to-r from-indigo-800 to-purple-600 rounded-md px-24 py-1">Signup</a> |
setInterval(() => { | ||
if (googleAd.getAttribute("data-anchor-status") === "displayed") { | ||
body.style.paddingTop = "100px"; | ||
} else if (googleAd.getAttribute("data-anchor-status") === "dismissed") { | ||
body.style.paddingTop = "0"; | ||
} | ||
}, 0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider increasing the interval of setInterval
.
Using a 0ms interval can lead to high CPU usage as the function runs as fast as possible. Consider setting this to a more reasonable value, such as 100ms, to reduce the load on the client's machine.
- setInterval(() => {
+ setInterval(() => {
}, 0);
+ }, 100);
Committable suggestion was skipped due low confidence.
<h1 className="font-bold text-lg p-4">Or</h1> | ||
<Link href='/Signup'> | ||
<a className="font-sans text-sm font-bold text-white hover:italic bg-gradient-to-r from-indigo-800 to-purple-600 rounded-md px-24 py-1">Signup</a> | ||
</Link> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ensure consistent styling for the "Or" separator.
- <h1 className="font-bold text-lg p-4">Or</h1>
+ <p className={styles.or}>Or</p>
This change ensures that the styling for the "Or" text is consistent throughout the application, using the styles defined in login.module.scss
.
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.
<h1 className="font-bold text-lg p-4">Or</h1> | |
<Link href='/Signup'> | |
<a className="font-sans text-sm font-bold text-white hover:italic bg-gradient-to-r from-indigo-800 to-purple-600 rounded-md px-24 py-1">Signup</a> | |
</Link> | |
<p className={styles.or}>Or</p> | |
<Link href='/Signup'> | |
<a className="font-sans text-sm font-bold text-white hover:italic bg-gradient-to-r from-indigo-800 to-purple-600 rounded-md px-24 py-1">Signup</a> | |
</Link> |
await db.disconnect(); | ||
res.status(200).json({ success: true, result: result }); | ||
} catch (error) { | ||
res.status(500).json({ success: false, error }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider logging the error for easier debugging.
- res.status(500).json({ success: false, error });
+ console.error(error);
+ res.status(500).json({ success: false, error: error.message });
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.
res.status(500).json({ success: false, error }); | |
console.error(error); | |
res.status(500).json({ success: false, error: error.message }); |
const dd = String(today.getDate()).padStart(2, '0'); | ||
const mm = String(today.getMonth() + 1).padStart(2, '0'); | ||
const yyyy = today.getFullYear(); | ||
console.log(data); | ||
const result = await BlogComment.create({ | ||
userName: req.body.userName, | ||
blogId: req.body.blogId, | ||
message: req.body.message, | ||
date: mm + '/' + dd + '/' + yyyy, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider using template literals for date formatting to enhance readability.
- date: mm + '/' + dd + '/' + yyyy,
+ date: `${mm}/${dd}/${yyyy}`,
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.
const dd = String(today.getDate()).padStart(2, '0'); | |
const mm = String(today.getMonth() + 1).padStart(2, '0'); | |
const yyyy = today.getFullYear(); | |
console.log(data); | |
const result = await BlogComment.create({ | |
userName: req.body.userName, | |
blogId: req.body.blogId, | |
message: req.body.message, | |
date: mm + '/' + dd + '/' + yyyy, | |
const dd = String(today.getDate()).padStart(2, '0'); | |
const mm = String(today.getMonth() + 1).padStart(2, '0'); | |
const yyyy = today.getFullYear(); | |
console.log(data); | |
const result = await BlogComment.create({ | |
userName: req.body.userName, | |
blogId: req.body.blogId, | |
message: req.body.message, | |
date: `${mm}/${dd}/${yyyy}`, |
package.json
Outdated
<<<<<<< HEAD | ||
"@fortawesome/react-fontawesome": "^0.2.0", | ||
"aos": "^2.3.4", | ||
======= | ||
"@fortawesome/react-fontawesome": "^0.1.16", | ||
"@types/webidl-conversions": "^7.0.0", | ||
>>>>>>> 2e3ced3f1a6c1a70341b50aee0bde119b118a150 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Resolve merge conflicts in the dependency list.
- <<<<<<< HEAD
- @fortawesome/react-fontawesome": "^0.2.0",
- "aos": "^2.3.4",
- =======
- @fortawesome/react-fontawesome": "^0.1.16",
- @types/webidl-conversions": "^7.0.0",
- >>>>>>> 2e3ced3f1a6c1a70341b50aee0bde119b118a150
+ "@fortawesome/react-fontawesome": "^0.2.0",
+ "aos": "^2.3.4",
+ "@types/webidl-conversions": "^7.0.0",
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.
<<<<<<< HEAD | |
"@fortawesome/react-fontawesome": "^0.2.0", | |
"aos": "^2.3.4", | |
======= | |
"@fortawesome/react-fontawesome": "^0.1.16", | |
"@types/webidl-conversions": "^7.0.0", | |
>>>>>>> 2e3ced3f1a6c1a70341b50aee0bde119b118a150 | |
"@fortawesome/react-fontawesome": "^0.2.0", | |
"aos": "^2.3.4", | |
"@types/webidl-conversions": "^7.0.0", |
import { faEllipsisH } from "node_modules/@fortawesome/free-solid-svg-icons/index"; | ||
<<<<<<< HEAD |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Resolve syntax errors and remove merge conflict artifacts.
- <<<<<<< HEAD
- =======
- >>>>>>> 2e3ced3f1a6c1a70341b50aee0bde119b118a150
- <HEAD
- <meta
- </HEAD
- {blogData.map((blogItem) => (
- key={blogItem.id}
- id={blogItem.id}
- image={blogItem.image
- comments={blogItem.comments}
- likes={blogItem.likes}
- class="hover:shadow-2xl hover:scale-150"
- =======
- key={blogItem.userId}
- id={index}
- title={blogItem.title}
- image={blogItem.coverImg}
- comments={blogItem.numberOfComments}
- likes={blogItem.like}
- >>>>>>> 2e3ced3f1a6c1a70341b50aee0bde119b118a150
+ // Properly close JSX tags and remove conflict markers
This change cleans up the file by removing merge conflict markers and correcting JSX syntax errors, ensuring the file is syntactically correct.
Also applies to: 30-31, 31-32, 32-33, 34-35, 63-64, 64-64, 69-70, 71-71, 70-70, 73-74, 74-74, 74-74, 74-74, 74-74, 74-74, 74-74, 136-137, 138-138, 137-137
Committable suggestion was skipped due low confidence.
<li> | ||
<a | ||
onClick={() => router.push('/Login')} | ||
className="flex py-2 px-2 text-white hover:bg-sky-400 hover:text-black rounded-lg transition duration-500" | ||
> | ||
<FaKey /> | ||
</a> | ||
</li> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ensure accessibility by replacing the anchor tag with a button.
- <a onClick={() => router.push('/Login')} className="flex py-2 px-2 text-white hover:bg-sky-400 hover:text-black rounded-lg transition duration-500">
- <FaKey />
- </a>
+ <button onClick={() => router.push('/Login')} className="flex py-2 px-2 text-white hover:bg-sky-400 hover:text-black rounded-lg transition duration-500">
+ <FaKey />
+ </button>
This change improves accessibility by using a button
element for actions, which is more semantically correct than using an a
tag.
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.
<li> | |
<a | |
onClick={() => router.push('/Login')} | |
className="flex py-2 px-2 text-white hover:bg-sky-400 hover:text-black rounded-lg transition duration-500" | |
> | |
<FaKey /> | |
</a> | |
</li> | |
<li> | |
<button | |
onClick={() => router.push('/Login')} | |
className="flex py-2 px-2 text-white hover:bg-sky-400 hover:text-black rounded-lg transition duration-500" | |
> | |
<FaKey /> | |
</button> | |
</li> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 5
Review Details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (2)
- package.json (1 hunks)
- pages/_app.js (2 hunks)
Files skipped from review as they are similar to previous changes (1)
- package.json
Additional Context Used
Biome (4)
pages/_app.js (4)
102-106: JSX elements without children should be marked as self-closing. In JSX, it is valid for any element to be self-closing.
134-134: JSX elements without children should be marked as self-closing. In JSX, it is valid for any element to be self-closing.
135-139: JSX elements without children should be marked as self-closing. In JSX, it is valid for any element to be self-closing.
128-128: Avoid passing content using the dangerouslySetInnerHTML prop.
<meta property="og:url" content="https://www.amupedia.com" /> | ||
<script | ||
type="application/ld+json" | ||
dangerouslySetInnerHTML={addProductJsonLd()} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Avoid using dangerouslySetInnerHTML due to potential security risks.
Consider using safer alternatives to inject JSON-LD structured data, such as serializing the JSON object directly into the script tag.
<script | ||
src="https://accounts.google.com/gsi/client" | ||
async | ||
defer | ||
></script> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
JSX elements without children should be self-closing.
- <script src="https://accounts.google.com/gsi/client" async defer></script>
+ <script src="https://accounts.google.com/gsi/client" async defer />
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.
<script | |
src="https://accounts.google.com/gsi/client" | |
async | |
defer | |
></script> | |
<script | |
src="https://accounts.google.com/gsi/client" | |
async | |
defer | |
/> |
|
||
import Navbar from "@comp/common/Navbar"; | ||
import jwt from "jsonwebtoken"; | ||
//import Navbar from "@comp/Navbar"; | ||
// import jwt from "jsonwebtoken"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove commented-out imports to clean up the code.
- //import Navbar from "@comp/Navbar";
- // import jwt from "jsonwebtoken";
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.
import Navbar from "@comp/common/Navbar"; | |
import jwt from "jsonwebtoken"; | |
//import Navbar from "@comp/Navbar"; | |
// import jwt from "jsonwebtoken"; | |
import Navbar from "@comp/common/Navbar"; | |
import jwt from "jsonwebtoken"; |
</Head> | ||
<section styles={{ position: "relative" }}> | ||
<Navbar /> | ||
<Component {...pageProps}></Component> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
JSX elements without children should be self-closing.
- <Component {...pageProps}></Component>
+ <Component {...pageProps} />
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.
<Component {...pageProps}></Component> | |
<Component {...pageProps} /> |
<Script | ||
async | ||
src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-6172950963478417" | ||
crossOrigin="anonymous" | ||
></Script> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
JSX elements without children should be self-closing.
- <Script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-6172950963478417" crossOrigin="anonymous"></Script>
+ <Script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-6172950963478417" crossOrigin="anonymous" />
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.
<Script | |
async | |
src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-6172950963478417" | |
crossOrigin="anonymous" | |
></Script> | |
<Script | |
async | |
src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-6172950963478417" | |
crossOrigin="anonymous" | |
/> |
Bugs fixed
Dragged and dropped the login.js file into pages folder.