-
Notifications
You must be signed in to change notification settings - Fork 0
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
[M1_TR-212] Markup for M1_TR-211 #11
base: master
Are you sure you want to change the base?
Conversation
267fb6a
to
ac3107a
Compare
ac3107a
to
f5feb02
Compare
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.
Please use 2 space indentation not 4 space
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.
@nicoleamber Pagination should be a molecule since it compose of multiple buttons
web/src/app/job/hooks.ts
Outdated
export const useJobListContext = (): JobTable => { | ||
const jobs = useContext(JobListContext); | ||
|
||
if (jobs === undefined) { | ||
throw new Error('Missing JobListContext'); | ||
} | ||
|
||
return jobs; | ||
}; |
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.
@nicoleamber I think we should not export, let's manage context within hooks and pass what we need in the return statement. Also, I can see the context is not used in this hooks so only use it where it is needed.
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.
@nicoleamber Please fix indentation as well
060a487
to
86e5426
Compare
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.
Please put it in a folder same as others
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.
From next time if markup task, I want to request to not include the hooks for now or context, it's okay na display lang sa, kay daghan kaayo i review
web/src/app/wrapper.tsx
Outdated
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.
just request, why no use template.js instead of wrapper?
https://nextjs.org/docs/app/building-your-application/routing/pages-and-layouts#templates
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.
better to organize the routes like this
/job/list
/job/detail/{id}
since route order is depending on the component tree. So the file structure will look like this
+ job
+ list
- context.js
- hooks.js
- page.js
web/src/styles/Filter.module.css
Outdated
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.
please move styles to assets
<Chip | ||
label={label} | ||
sx={{ | ||
backgroundColor: ChipColors[label as string] ?? '#65707b33', |
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.
Please define every hex value colors, so that it would be easily identified by developers.
setStartDate(date); | ||
}; | ||
|
||
const handleEndDateChange = (date: Moment | null): void => { |
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.
do we need to use union types? This function requires date always right?
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.
@jeremiahC Yes sir, there would be a type mismatch without the null as seen in this error message.
It's also possible to clear the date fields (i.e. when we no longer want to filter jobs by date) using null
as the on change value. I'll include that change here since I implemented it in the FE task.
const [startDate, setStartDate] = useState<Moment | null>(); | ||
const [endDate, setEndDate] = useState<Moment | null>(); | ||
|
||
const handleStartDateChange = (date: Moment | null): void => { |
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.
do we need to use union types? This function requires date always right?
const { startDate, handleStartDateChange, endDate, handleEndDateChange } = | ||
useHooks(); |
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.
format each variable by line
linkTo = '/' | ||
}) => { | ||
const pathname = usePathname(); | ||
active = pathname === linkTo ? true : false; |
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.
better if active is immutable, pathname === linkTo should be handled above this component. This component will just receive true or false.
setOpen((prevOpen) => !prevOpen); | ||
}; | ||
|
||
const handleClose = (event: Event | React.SyntheticEvent) => { |
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.
why do we need to use union types here?
…emoved unnecessary unions
Related Issue
Context
Commands:
Test Executed
Screenshot
Screencast.2023-09-07.11-07-01.webm
Nature of task
Risks
Notes
Filter buttons take a few seconds to initially load its custom styles.