Skip to content

Commit

Permalink
fix: make the primary button clickable (#524)
Browse files Browse the repository at this point in the history
* fix: make the primary button clickable

* fix: remove toilet post
  • Loading branch information
aalemayhu authored May 4, 2024
1 parent ec2c8b9 commit 67e51c5
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 54 deletions.
22 changes: 8 additions & 14 deletions src/components/buttons/PrimaryButton/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,15 @@ interface PrimaryButtonProps {
}

export default function PrimaryButton({
text,
destination,
onClickLink,
}: PrimaryButtonProps) {
text,
destination,
onClickLink
}: PrimaryButtonProps) {
return (
<StyledButton>
{destination.includes('http') ? (
<a href={destination} rel="noopener noreferrer">
{text}
</a>
) : (
<a onClick={onClickLink} href={destination}>
{text}
</a>
)}
<StyledButton onClick={onClickLink}
href={destination} rel="noopener noreferrer"
>
{text}
<img width={24} height={24} src="/icons/arrow-right.svg" alt="arrow" />
</StyledButton>
);
Expand Down
64 changes: 33 additions & 31 deletions src/components/buttons/PrimaryButton/styled.tsx
Original file line number Diff line number Diff line change
@@ -1,38 +1,40 @@
import styled from 'styled-components';

export const StyledButton = styled.div`
margin-top: 0.5rem;
margin-bottom: 2rem;
background: #5397f5;
padding: 1rem 1.9rem;
border-radius: 3px;
text-transform: uppercase;
width: 268px;
height: 66px;
display: flex;
grid-gap: 0.7rem;
align-items: center;
justify-content: center;
a {
export const StyledButton = styled.a`
margin-top: 0.5rem;
margin-bottom: 2rem;
background: #5397f5;
padding: 1rem 1.9rem;
border-radius: 3px;
text-transform: uppercase;
width: 268px;
height: 66px;
display: flex;
grid-gap: 0.7rem;
align-items: center;
justify-content: center;
text-decoration: none;
color: white;
}
&:hover {
background-color: #2b2e3c;
}
/* Typography */
font-family: Rubik;
font-size: 20px;
font-style: normal;
font-weight: 600;
line-height: 30px;
letter-spacing: 0em;
text-align: center;
&:hover {
background-color: #2b2e3c;
color: white;
}
/* Typography */
font-family: Rubik;
font-size: 20px;
font-style: normal;
font-weight: 600;
line-height: 30px;
letter-spacing: 0em;
text-align: center;
@media (max-width: 1024px) {
font-size: 16px;
height: 54px;
margin-right: auto;
}
@media (max-width: 1024px) {
font-size: 16px;
height: 54px;
margin-right: auto;
}
`;
14 changes: 5 additions & 9 deletions src/pages/HomePage/components/Sections/news/NewsSection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ function FeaturedEntry() {
wanted to give you a special update.
<br />
</div>
<ReadMore href="https://www.patreon.com/posts/state-of-2anki-60331662?utm_medium=clipboard_copy&utm_source=copy_to_clipboard&utm_campaign=postshareI" />
<ReadMore
href="https://www.patreon.com/posts/state-of-2anki-60331662?utm_medium=clipboard_copy&utm_source=copy_to_clipboard&utm_campaign=postshareI" />
</div>
</div>
);
Expand All @@ -38,23 +39,18 @@ function NewsSection() {
</div>
<div className="column">
<NewsEntry
title={"What's Next? The Path to v1.0.0!"}
title={'What\'s Next? The Path to v1.0.0!'}
description="There are a three main things I would like to tackle longterm but in this session"
link="https://www.patreon.com/posts/whats-next-path-51204766"
/>
<div className="my-2" />
<NewsEntry
title="Good News!"
description="I woke up in the middle of the night and had to go to the toilet 🚾"
link="https://www.patreon.com/posts/good-news-51122343"
/>
</div>
</div>
<Centered>
<ReadMoreNews
destination="https://www.patreon.com/alemayhu"
text="READ MORE NEWS"
onClickLink={() => {}}
onClickLink={() => {
}}
/>
</Centered>
</section>
Expand Down

0 comments on commit 67e51c5

Please sign in to comment.