Talk through the code, explain the workings of the application.
Where possible we encourage following TDD for all development.
The button has no styling applied. Please style the button based on these requirements.
- Border with a solid line of 1 pixel using the primary colour from the theme.
- Background colour to use the background colour from the theme.
- Text colour to be text colour from the theme.
- Border with a solid line of 1 pixel using the background colour from the theme.
- Background colour to use the primary colour from the theme.
- Text colour to be textContrast colour from the theme.
An API Client has already been created that integrates with a trivia API.
-
Create a custom hook that consumes the client and returns the trivia response data.
Ref:
src\pages\HomePage\Clients\TriviaClient.ts -
Within HomePage.tsx use the custom hook and pass the trivia data to the DataDisplay component.
-
Conditionally render DataDisplay only if trivia data exists
-
Setup the "New trivia" button to refresh the trivia.
Create functionality to hide the answer on load and a button to reveal it when click.