-
Notifications
You must be signed in to change notification settings - Fork 44
Contra Frontend technical assessment #64
base: main
Are you sure you want to change the base?
Conversation
'^@/components/(.*)$': '<rootDir>/src/components/$1', | ||
'^@/hooks/(.*)$': '<rootDir>/src/hooks/$1', | ||
'^@/pages/(.*)$': '<rootDir>/src/pages/$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.
It would help to have this setup before interviewees start on the project.
Looks like this will be added by the Next team in the near future (link)
"eslint": "8.18.0", | ||
"eslint-config-canonical": "35.0.1", | ||
"eslint-config-next": "12.1.6", | ||
"eslint-config-prettier": "8.5.0", | ||
"jest": "28.1.1", | ||
"jest-environment-jsdom": "^29.0.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.
Would appreciate having this dependency pre-installed as well 😄
|
||
const closeHandler = useCallback(() => { | ||
setOpen(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.
Want to preface that preemptive performance changes are an anti-pattern, and these changes usually should be made after doing an internal investigation/audit (via 3rd party software like lighthouse).
const container = screen.getByTestId('overflow-container'); | ||
fireEvent.scroll(container, { target: { scrollY: 100 } }); | ||
expect(callback).toHaveBeenCalledTimes(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.
I'm not a fan of pushing skipped/broken tests, but for the sake of the assessment, I left it in.
Please forgive me 🙇
Summary
Had a lot of fun working on this. I usually use pre-built modals, so I didn't realize how much I took that for granted. Especially the accessibility support. This was honestly my first time developing/testing with a screen reader, and it won't be the last.
Design decisions
Decided to use
styled-components
to quickly create necessary styled components. If I were to scale this, I'd probably use a css framework like tailwind or chakra ui.I also left the css within the js as I didn't have that many custom styled components, and keep everything in one place. If I were to keep using styled components, I'd probably audit all current components and create common re-usable components.
Changes made
focus-trap-react
library.aria
props.Next steps
@/components/modal.tsx
and@/pages/index.tsx
. Maybe cypress tests for an example critical flow with a modal (popup alert or a form within the modal).Loom
Link here