Skip to content

Use styled components #30

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

Draft
wants to merge 5 commits into
base: master
Choose a base branch
from
Draft
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 29 additions & 3 deletions app/components/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,34 @@ const LogoImage = styled.img`
width: 3rem;
`

const Anchor = styled.a`
Copy link
Contributor

Choose a reason for hiding this comment

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

Move below export. Also the name should be specific to the component's purpose. Isn't this a call-to-action button? Why not name it CtaButton?

display: inline-flex;
justifiy-content: center;
align-items: center;
color: #a7adba;
background: #1a1e23;
border: 1px solid #1a1e23;
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is a border needed if it matches the background color?

height: 3rem;
border-radius: 0.5rem;
padding: 0 1rem;
text-align: center;
font-size: 0.875rem;
line-height: 1em;
font-weight: 600;
transition:
color 0.2s cubic-bezier(0, 0, 0.2, 1) 0s,
background-color 0s,
border-color 0s,
opacity 0s,
box-shadow 0s,
transform 0s;

&:hover {
background: #15181d;
border: 1px solid #15181d;
}
`

const Header = () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

I like export const instead of export default. It's clearer and allows you to export types an other things that a module may want to export.

return (
<header>
Expand Down Expand Up @@ -47,9 +75,7 @@ const Header = () => {
</ul>
</div>
<div className="navbar-end">
<a className="btn" href={links.discord}>
Join Us on Discord
</a>
<Anchor href={links.discord}>Join Us on Discord</Anchor>
</div>
</nav>
</header>
Expand Down