Challenge: Adding a Button and Styling it with Emotion
Test yourself by adding a styled button to the existing HomePage component using Emotion.
Overview
This challenge is divided into two parts, in first task you will add a button named “Add a comment” to the HomePage
component and style it using CSS modules. In second task you have to create a reusable Addacommentbutton
styled component with emotion so it can be used on multiple places. This will test your ability to apply styles to a React component using Emotion and build upon the topics covered in the chapter.
Requirements for creating a new button
You have been given a React code file for the HomePage
component. Your task is to add a button on HomePage
named “Add a comment”. After adding the button you have to style this button using CSS modules add a green color #4CAF50
to the button background, black
color to the text and font-size: 16px
in it.
Get hands-on with 1400+ tech skills courses.