Skip to content

Conversation

@Willjianger9
Copy link
Contributor

No description provided.

pages/arts.jsx Outdated
Comment on lines 7 to 9
<p>
Oops! We meant to redirect you to https://dailybruin.com/category/arts
</p>;
Copy link
Collaborator

@NarekGermirlian NarekGermirlian Nov 24, 2025

Choose a reason for hiding this comment

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

Make sure you return inside the if statement; otherwise, we're not doing anything with the

<p>text</p>

tags

pages/arts.jsx Outdated
Comment on lines 11 to 12
// Redirect
window.location.href = "https://dailybruin.com/category/arts-entertainment";
Copy link
Collaborator

Choose a reason for hiding this comment

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

Put this in a useEffect, so that it only runs once (otherwise, this will run every time the component is re-rendered).

Comment on lines 11 to 12
Page.getInitialProps = async (context) => {
const { slug } = context.query;
Copy link
Collaborator

Choose a reason for hiding this comment

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

To me it looks like we can get rid of slug (and thus context), as they are never used.

Comment on lines 11 to 12
Page.getInitialProps = async (context) => {
const { slug } = context.query;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can get rid of context and slug here

Comment on lines 65 to 74
// const subcategoriesRes = await fetch(
// `${Config.apiUrl}/wp-json/wp/v2/categories?parent=${category[0].id}`
// );
// const subcategories = [await subcategoriesRes.json()];
// for (let i = 0; i < subcategories.length; i++) {
// const subsubcategoriesRes = await fetch(
// `${Config.apiUrl}/wp-json/wp/v2/categories?parent=${subcategories[i].id}`
// );
// subcategories[i].subsubcategories = await subsubcategoriesRes.json();
// }
Copy link
Collaborator

Choose a reason for hiding this comment

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

get rid of unecessary comments

Comment on lines 14 to 27
const postsLinks = posts.map((category, index) => {
return (
<>
<Head>
<title>{this.props.category[0].name + " - Daily Bruin"}</title>
</Head>
<div style={{ padding: "6px" }}>
<SectionHeader
category={this.props.category[0].name}
subcategories={sectionLinks}
/>
</div>
<MultimediaLayout
posts={this.props.posts}
categoryID={this.props.category[0].id}
<ul key={index}>
<li>
<Link
as={`/category/${category.slug}`}
href={`/category?slug=${category.slug}&apiRoute=category`}
>
<a>{category.title.rendered}</a>
</Link>
</li>
</ul>
);
});
Copy link
Collaborator

Choose a reason for hiding this comment

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

looks like postsLinks is never used - can get rid of it.

Comment on lines 1 to 10
// Should take precedence over [slug].jsx
import PageWrapper from "../../layouts/PageWrapper";
import React, { Component } from "react";
import React from "react";
import Error from "next/error";

class Uncategorized extends Component {
render() {
return <Error statusCode={404} />;
}
function Uncategorized() {
return <Error statusCode={404} />;
}

export default PageWrapper(Uncategorized);
Copy link
Collaborator

Choose a reason for hiding this comment

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

The more i look at it, I don't think this page is ever used. Can go ahead and get rid of it.

Copy link
Collaborator

Choose a reason for hiding this comment

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

can remove Component from import

);
}

Tag.getInitialProps = async (context) => {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Don't need context parameter

Comment on lines 65 to 74
// const subcategoriesRes = await fetch(
// `${Config.apiUrl}/wp-json/wp/v2/categories?parent=${category[0].id}`
// );
// const subcategories = await subcategoriesRes.json();
// for (let i = 0; i < subcategories.length; i++) {
// const subsubcategoriesRes = await fetch(
// `${Config.apiUrl}/wp-json/wp/v2/categories?parent=${subcategories[i].id}`
// );
// subcategories[i].subsubcategories = await subsubcategoriesRes.json();
// }
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can get rid of unnecessary comments

Comment on lines 57 to 58
Cartoons.getInitialProps = async (context) => {
const { slug } = context.query;
Copy link
Collaborator

Choose a reason for hiding this comment

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

slug and context are not needed

Comment on lines 65 to 74
// const subcategoriesRes = await fetch(
// `${Config.apiUrl}/wp-json/wp/v2/categories?parent=${category[0].id}`
// );
// const subcategories = await subcategoriesRes.json();
// for (let i = 0; i < subcategories.length; i++) {
// const subsubcategoriesRes = await fetch(
// `${Config.apiUrl}/wp-json/wp/v2/categories?parent=${subcategories[i].id}`
// );
// subcategories[i].subsubcategories = await subsubcategoriesRes.json();
// }
Copy link
Collaborator

Choose a reason for hiding this comment

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

can get rid of unneeded comments

Comment on lines 57 to 58
Graphics.getInitialProps = async (context) => {
const { slug } = context.query;
Copy link
Collaborator

Choose a reason for hiding this comment

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

slug and context unneeded

Comment on lines 65 to 74
// const subcategoriesRes = await fetch(
// `${Config.apiUrl}/wp-json/wp/v2/categories?parent=${category[0].id}`
// );
// const subcategories = await subcategoriesRes.json();
// for (let i = 0; i < subcategories.length; i++) {
// const subsubcategoriesRes = await fetch(
// `${Config.apiUrl}/wp-json/wp/v2/categories?parent=${subcategories[i].id}`
// );
// subcategories[i].subsubcategories = await subsubcategoriesRes.json();
// }
Copy link
Collaborator

Choose a reason for hiding this comment

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

get rid of unneeded comments

Copy link
Collaborator

Choose a reason for hiding this comment

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

Same issues as arts page:

  • return the p tags
  • useEffect for redirect

Comment on lines 11 to 12
Page.getInitialProps = async (context) => {
const { slug } = context.query;
Copy link
Collaborator

Choose a reason for hiding this comment

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

don't need slug & context

Comment on lines 11 to 12
Page.getInitialProps = async (context) => {
const { slug } = context.query;
Copy link
Collaborator

Choose a reason for hiding this comment

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

unneeded slug & context. i'll stop writing this for other pages, but just remove unneeded slug & context for the rest of your changes

Copy link
Collaborator

Choose a reason for hiding this comment

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

  • remove unnecessary imports
  • showWelcome/setShowWelcome is unused

Copy link
Collaborator

Choose a reason for hiding this comment

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

This page doesn't even work, but it also didn't work previous to your change. I'll bring this up to my boss to see if it's even being used (maybe we can get rid of it — will get back to you on this)

@Willjianger9
Copy link
Contributor Author

@NarekGermirlian Can i get another review twin Im pretty sure I addressed everything you brought up

Copy link
Collaborator

@NarekGermirlian NarekGermirlian left a comment

Choose a reason for hiding this comment

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

LGTM

@NarekGermirlian NarekGermirlian merged commit d0f293a into master Dec 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants