-
-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
adeira-source-id: 5255829a50c8acd94fdf1431850ffbe3d56b286a
- Loading branch information
1 parent
27441e4
commit 752f0f8
Showing
1 changed file
with
70 additions
and
0 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,70 @@ | ||
/** | ||
* Copyright (c) Michael Dougall. All rights reserved. | ||
* | ||
* This source code is licensed under the GPL-3.0 license found in the LICENSE | ||
* file in the root directory of this source tree. | ||
*/ | ||
|
||
function Card({ children }: { children: React.ReactNode }) { | ||
return ( | ||
<div | ||
style={{ | ||
backgroundColor: "white", | ||
border: "1px solid rgba(0,0,0,0.1)", | ||
borderRadius: "12px", | ||
display: "flex", | ||
flexDirection: "column", | ||
gap: "4px", | ||
height: "240px", | ||
padding: "1rem", | ||
}} | ||
> | ||
{children} | ||
</div> | ||
); | ||
} | ||
|
||
function CardTitle({ children }: { children: string }) { | ||
return ( | ||
<h1 | ||
style={{ | ||
fontSize: "1.4rem", | ||
fontWeight: "600", | ||
margin: 0, | ||
marginTop: "4px", | ||
}} | ||
tabIndex={0} | ||
> | ||
{children} | ||
</h1> | ||
); | ||
} | ||
|
||
function CardHero() { | ||
return ( | ||
<div | ||
style={{ | ||
backgroundColor: "rgba(0,0,0,0.1)", | ||
borderRadius: "8px", | ||
height: "100%", | ||
}} | ||
tabIndex={0} | ||
/> | ||
); | ||
} | ||
|
||
function CardContent({ children }: { children: React.ReactNode }) { | ||
return <div tabIndex={0}>{children}</div>; | ||
} | ||
|
||
export function CardExample() { | ||
return ( | ||
<Card> | ||
<CardHero /> | ||
<CardTitle>Inner Light</CardTitle> | ||
<CardContent> | ||
<span>Elderbrook & Bob Moses</span> | ||
</CardContent> | ||
</Card> | ||
); | ||
} |