File tree Expand file tree Collapse file tree 2 files changed +80
-1
lines changed
Expand file tree Collapse file tree 2 files changed +80
-1
lines changed Original file line number Diff line number Diff line change @@ -31,4 +31,67 @@ export const OverviewCards: React.FC<OverviewCardsProps> = ({ cards }) => {
3131 ) ) }
3232 </ div >
3333 ) ;
34+ } ;
35+
36+ interface HeroCardProps {
37+ title : string ;
38+ href ?: string ;
39+ }
40+
41+ const HeroCard : React . FC < HeroCardProps > = ( { title, href = "" } ) => {
42+ const cardStyle = {
43+ display : 'flex' ,
44+ alignItems : 'center' ,
45+ justifyContent : 'center' ,
46+ minHeight : '200px' ,
47+ padding : '2rem' ,
48+ borderRadius : '0.75rem' ,
49+ background : ' #654fec' ,
50+ color : 'white' ,
51+ textDecoration : 'none' ,
52+ fontSize : '1.5rem' ,
53+ fontWeight : '600' ,
54+ textAlign : 'center' as const ,
55+ transition : 'transform 0.2s ease' ,
56+ cursor : href ? 'pointer' : 'default'
57+ } ;
58+
59+ const hoverStyle = {
60+ ':hover' : {
61+ transform : href ? 'scale(1.02)' : 'none'
62+ }
63+ } ;
64+
65+ if ( href ) {
66+ return (
67+ < a href = { href } style = { cardStyle } >
68+ { title }
69+ </ a >
70+ ) ;
71+ }
72+
73+ return (
74+ < div style = { cardStyle } >
75+ { title }
76+ </ div >
77+ ) ;
78+ } ;
79+
80+ interface HeroCardsProps {
81+ cards : HeroCardProps [ ] ;
82+ }
83+
84+ export const HeroCards : React . FC < HeroCardsProps > = ( { cards } ) => {
85+ return (
86+ < div style = { {
87+ display : 'grid' ,
88+ gridTemplateColumns : 'repeat(auto-fit, minmax(300px, 1fr))' ,
89+ gap : '2rem' ,
90+ marginBottom : '3rem'
91+ } } >
92+ { cards . map ( ( card , index ) => (
93+ < HeroCard key = { index } { ...card } />
94+ ) ) }
95+ </ div >
96+ ) ;
3497} ;
Original file line number Diff line number Diff line change @@ -7,7 +7,23 @@ sidebar:
77 order : 1
88---
99
10- import { OverviewCards } from ' ../../../components/OverviewCards' ;
10+ import { OverviewCards , HeroCards } from ' ../../../components/OverviewCards' ;
11+
12+ <HeroCards
13+ cards = { [
14+ {
15+ title: " Emulate AWS Services" ,
16+ href: " /aws/services"
17+ },
18+ {
19+ title: " Test Your AWS Apps" ,
20+ href: " /aws/capabilities"
21+ }
22+ ]}
23+ client :load
24+ />
25+
26+ ## What would you like to do today?
1127
1228<OverviewCards
1329 cards = { [
You can’t perform that action at this time.
0 commit comments