-
Notifications
You must be signed in to change notification settings - Fork 2
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
Feature - Resources admin dashboard #106
base: main
Are you sure you want to change the base?
Conversation
Uhh, looks like my first PR's branch's commits were combined with this branch |
lemme know about any structuring problems irrelevant of size. I just kinda autopiloted for a couple hours in these 5 days XD |
had this ready to copy paste from my personal utility code dump |
good part of this was also from my code dump so it didn't take very long |
next time: https://stackoverflow.com/questions/36168839/how-to-remove-commits-from-a-pull-request |
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.
I'll review more later but if you could show a demo of all this, it would be great. Kinda hard to follow all the files without this since I don't know how it is to be used as intended. Good work so far though :D
components/HorizontalSeparator.jsx
Outdated
// function HorizontalSeparator() { | ||
// return <></>; | ||
// } |
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.
cleanup - remove this?
@@ -20,7 +20,8 @@ export const Input = ({ | |||
/> | |||
); | |||
|
|||
const SInput = styled.input` | |||
// used when ref needs to be passed as prop | |||
export const SInput = styled.input` |
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.
I'm guessing this doesn't work with just the Input
? I think if you want a ref
as a prop you can make it on the original element and pass it as optional?
components/MDEditor.js
Outdated
import { useCallback, useState } from "react"; | ||
import "easymde/dist/easymde.min.css"; | ||
|
||
export default function MDEditor({ |
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.
Can you record a GIF demo for this?
<div className="modified-time-stamp"> | ||
Last changed {latestTimeAgo(blog.lastModified)} ago | ||
</div> |
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.
I would be very careful about className
- the purpose of styled components is to remove the need for class names so there isn't duplicates throughout our codebase. I think here might be fine since it is a very specific component but just keep this in mind
<a className="title" href={`/resources/admin/project/blog/${blog.id}`}> | ||
{blog.name} | ||
</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.
like I think here you could get away with a nested link instead of className
const HEADER_COLOUR = "#1e2530"; | ||
const HEADER_HEIGHT = "6vh"; |
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.
I think it might be better to abstract this into a file in the util
section instead of creating a new file for resourcesAdmin
- maybe utils/admin
?
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.
Are there anything in common with these components? I think they should be likely broken down into separate files because an external developer would have no idea which components are in which files.
Typically components go in the components
file and then you can probably create an admin
subfile from that. The const colours and height should go in the theme/theme.js
file
|
||
// attempt to log user in right after page load | ||
useEffect(() => { | ||
async function f() { |
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.
a little weird naming? if this is temporary probably fine
lib/envs.js
Outdated
export const ENVS = { | ||
a: 1, | ||
}; |
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.
this is...? 😅
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.
o XD I was making mistakes with env variables so I was going to just store them all here and check for attributes. after that I would import it if I ever needed env variables
pages/api/admin/instant-log-in.js
Outdated
/** | ||
* asdjkh | ||
* | ||
* stuff | ||
*/ |
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 comment here
yeah np will do demo soon |
Small things |
No description provided.