Skip to content

Commit 55c62f2

Browse files
committed
feat: Create Button.astro
- Create `components/shared` folder - Create `Button.astro` in `shared` folder (due this component will be used in multiple pages across our website - Add `Button.astro` in `About.astro`
1 parent 2530605 commit 55c62f2

File tree

3 files changed

+32
-2
lines changed

3 files changed

+32
-2
lines changed

src/components/AboutUs.astro

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
---
22
import heroImage from "../assets/hacktoberfest.jpg";
3+
import Button from "./shared/Button.astro";
34
---
45

56
<section id="about-us" class="py-16 bg-gray-50">
@@ -15,10 +16,11 @@ import heroImage from "../assets/hacktoberfest.jpg";
1516
de la innovación y la colaboración. Únete a nosotros y sé parte del
1617
cambio.
1718
</p>
18-
<a
19+
<Button text="Conoce más" link="https://forms.gle/un4KaPsmmqS5Yx7Z9" style="primary"/>
20+
<!-- <a
1921
href="https://forms.gle/un4KaPsmmqS5Yx7Z9"
2022
class="text-blue-600 font-semibold hover:text-blue-700"
21-
>Sé voluntario →</a>
23+
>Sé voluntario →</a> -->
2224
</div>
2325
<div class="bg-gray-200 h-64 rounded-lg">
2426
<img

src/components/shared/Button.astro

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
const { text, link, style } = Astro.props;
3+
---
4+
<a href={link}>
5+
<div class:list={[
6+
"base-btn",
7+
{"outlined-white-btn": style === "outline"},
8+
{"primary-btn": style === "primary"},
9+
]}>
10+
<p class="text-base">{text}</p>
11+
</div>
12+
</a>

src/styles/globals.css

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,22 @@
4343
}
4444

4545
/* Components custom styles */
46+
.base-btn {
47+
@apply w-fit border-solid border-2 bg-transparent px-5 py-2 rounded-xl font-medium;
48+
border: solid 2px !important;
49+
}
50+
51+
.primary-btn {
52+
@apply font-semibold text-blue-600 hover:bg-blue-600 hover:text-white;
53+
/* border: solid 2px !important;
54+
border-color: #2563eb; */
55+
}
56+
57+
.outlined-white-btn {
58+
@apply border-white font-semibold text-white hover:bg-white hover:text-blue-600;
59+
}
60+
61+
4662
.faqs-container {
4763
@apply mx-auto shadow-md p-6 pt-0 rounded-xl;
4864
}

0 commit comments

Comments
 (0)