Skip to content
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

Heading Component #9

Merged
merged 11 commits into from
Mar 16, 2023
Merged

Heading Component #9

merged 11 commits into from
Mar 16, 2023

Conversation

eduenez33
Copy link
Collaborator

Overview

Created directory eventual/src/heading with the file eventual/src/heading/heading.tsx which holds the Heading component that takes a prop of title as a type of string. The Heading component is then used in eventual/src/App.tsx that takes a hardcoded title prop. resolves #6

Thought Process

At first I wrote the Heading component as it was taught here and it looked like function Heading({title}: {title: string;}) {return (<h1> { title } </h1>);} I tested if a simple arrow function would work and it did and left it like that as it was less lines

I decided to the take the prop typing and put them in an interface so it looks cleaner

Testing Steps

  • Run npm start in the terminal
  • Change Heading title prop <Heading title="[ your sting here ]" />

Risks

Title prop is NOT optional and has to be specified. Has to be a type of string

Create Heading component that takes a title prop as type string and returns title wrapped in an h1. resolves #6
Create Event component that takes title and description props as type of string. #7
@kevinfalting
Copy link
Collaborator

Hey, I noticed that you removed the test file and there are no tests for the Heading component, can you add some?

eventual/src/App.tsx Outdated Show resolved Hide resolved
eventual/src/App.tsx Outdated Show resolved Hide resolved
@eduenez33 eduenez33 self-assigned this Mar 3, 2023
Move Event Component into it's own directory
Remove Event Component and import it from Event directory
@eduenez33
Copy link
Collaborator Author

Hey @kevinfalting, am I just recovering the test file that I removed or making a new test for the heading component?

@kevinfalting
Copy link
Collaborator

Whatever you think would be best. I might start by using what was there, and potentially end up with something entirely different. Writing unit tests can be hard to wrap your head around, so it's something we can focus on when we meet again. 👌

eventual/src/event/event.tsx Outdated Show resolved Hide resolved
Copy link
Collaborator

@kevinfalting kevinfalting left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good, great work 👍

@eduenez33 eduenez33 merged commit 6431451 into main Mar 16, 2023
@eduenez33 eduenez33 deleted the ed/3-landing-page branch May 29, 2023 21:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Create the title component
2 participants