-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #30 from gone-bike/stats-section
add StatsSection, StatsCard components
- Loading branch information
Showing
4 changed files
with
77 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
--- | ||
export type StatsCardBg = "indigo" | "blue" | "teal"; | ||
export interface StatsCardProps { | ||
number: string; | ||
text: string; | ||
backColor: StatsCardBg; | ||
} | ||
const { number, text, backColor } = Astro.props as StatsCardProps; | ||
--- | ||
|
||
<li | ||
class:list={[ | ||
"list-none w-full rounded-lg px-2 py-4", | ||
{ | ||
"bg-indigo-100": backColor === "indigo", | ||
"bg-blue-100": backColor === "blue", | ||
"bg-teal-100": backColor === "teal", | ||
}, | ||
]} | ||
> | ||
<p | ||
class:list={[ | ||
"text-3xl font-bold mb-1 text-center", | ||
{ | ||
"text-indigo-500": backColor === "indigo", | ||
"text-blue-500": backColor === "blue", | ||
"text-teal-500": backColor === "teal", | ||
}, | ||
]} | ||
> | ||
{number} | ||
</p> | ||
|
||
<h3 | ||
class:list={[ | ||
"font-normal text-center", | ||
{ | ||
"text-indigo-700": backColor === "indigo", | ||
"text-blue-700": backColor === "blue", | ||
"text-teal-700": backColor === "teal", | ||
}, | ||
]} | ||
> | ||
{text} | ||
</h3> | ||
</li> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
--- | ||
import { t } from "i18next"; | ||
import StatsCard from "@components/cards/StatsCard.astro"; | ||
import BaseContainer from "@components/base/BaseContainer.astro"; | ||
--- | ||
|
||
<section class="pb-6"> | ||
<BaseContainer> | ||
<div class="pb-8 border-b border-gray-200 md:pb-10"> | ||
<ul class="flex flex-col gap-6 md:flex-row"> | ||
<StatsCard | ||
number="320,000" | ||
text={t("homepage.stat1")} | ||
backColor="indigo" | ||
/> | ||
<StatsCard | ||
number="1,420,000" | ||
text={t("homepage.stat2")} | ||
backColor="blue" | ||
/> | ||
<StatsCard number="€5,6M" text={t("homepage.stat3")} backColor="teal" /> | ||
</ul> | ||
</div> | ||
</BaseContainer> | ||
</section> |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters