Skip to content

misc#105

Open
tfredh wants to merge 7 commits intomainfrom
random-qol
Open

misc#105
tfredh wants to merge 7 commits intomainfrom
random-qol

Conversation

@tfredh
Copy link

@tfredh tfredh commented Oct 9, 2022

just trying to get familiar.

Changes:

  • used object when mapping navbar links
  • edited blog filter endpoint to avoid blogs being filtered through more than once

Idk, random stuff. Could be bad changes

  • made iframe onLoad a js function
  • spaces to help me separate site portions in my head
  • moved conditional check for Icon to decrease lines
  • give posts (in cache/cache.js) an id to avoid react key prop error

@tfredh tfredh requested a review from xsharonhe October 10, 2022 18:45
Copy link
Member

@xsharonhe xsharonhe left a comment

Choose a reason for hiding this comment

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

good changes overall! small comments - will approve just prefer to have some of the questions answered first before approving. also in the future, could we have the PR title be more descriptive? eg. cleanup / refactor of website (misc is kinda vague)

will check locally afterwards

@@ -0,0 +1,10 @@
// export function capitalizeWords(str) {
Copy link
Member

Choose a reason for hiding this comment

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

is this needed for anything?

Copy link
Author

Choose a reason for hiding this comment

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

oh nope. I thought I could use it and then realized it wouldn't work. I left it in case I thought of a way to use it later

Comment on lines 22 to 26
Home: "",
"About Us": "about",
Resources: "resources",
Events: "events",
Community: "community",
Copy link
Member

Choose a reason for hiding this comment

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

nit: almost prefer for consistency that the keys all be strings - would this affect anything?

Copy link
Member

Choose a reason for hiding this comment

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

do you think there is a way to use RESOURCES as the key names here? seems redundant to have both


{
/* TODO: Refactor into object? paths must be same as linked pages*/
/* @TODO: Refactor into object? paths must be same as linked pages */
Copy link
Member

Choose a reason for hiding this comment

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

i think we can remove the redo comment here yes

{RESOURCES.map((resource) => (
<Resource key={resource}>
<Link href={`/${PATHS[index]}`}>
<Link href={`/${PATH_NAMES[resource]}`}>
Copy link
Member

Choose a reason for hiding this comment

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

I would pull this out into a variable so it isn't stated twice for repetition now that I think about it

}, []);

const handleChange = (searchValue, tagValues, releaseValues) => {
// console.log([searchValue, tagValues, releaseValues]);
Copy link
Member

Choose a reason for hiding this comment

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

we can remove this altogether

- tags = tags to filter
*/
export default async (req, res) => {
// console.log("tt", req.query);
Copy link
Member

Choose a reason for hiding this comment

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

same here please remove console statements altogether

export const authors = ${getAuthors()};
export const opportunities = ${getOpportunities()};
const postsWithoutId = ${getProjects()};
export const posts = postsWithoutId.map(post => {
Copy link
Member

Choose a reason for hiding this comment

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

Math.random() would assign a random id to this right? could we also add maybe something that would tell us what post it is like project name or something so? not too sure if it matters but might be more descriptive than a random number

@tfredh
Copy link
Author

tfredh commented Oct 12, 2022

good changes overall! small comments - will approve just prefer to have some of the questions answered first before approving. also in the future, could we have the PR title be more descriptive? eg. cleanup / refactor of website (misc is kinda vague)

will check locally afterwards

Ah, alright. I'll also try and make fixes and commit again before that

try {
postPaths = await prisma.post.findMany();
// @P_ERR
// postPaths = await prisma.post.findMany();
Copy link
Member

Choose a reason for hiding this comment

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

what is the specific error here? this is not using our database but relying on our cache so just want to be sure i forgot to add this in earlier

Copy link
Member

Choose a reason for hiding this comment

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

im sure its because i keep updating things like vulnerabilities but just curious if you could screenshot or smth

Copy link
Author

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

oh this is because you don't have the .env file - I have some time to dig it up tmrw

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.

2 participants