File tree Expand file tree Collapse file tree 2 files changed +18
-12
lines changed Expand file tree Collapse file tree 2 files changed +18
-12
lines changed Original file line number Diff line number Diff line change @@ -12,19 +12,23 @@ const PlaygroundCard: FC<
12
12
Playground & {
13
13
lang : Locale ;
14
14
}
15
- > = ( { lang, name, image, url } ) => (
16
- < div className = "grid gap-2" >
17
- < Heading as = "h3" > { name } </ Heading >
18
- < img src = { `/assets/playgrounds/${ image } ` } alt = { `Vorschau des Playground ${ name } 's` } />
19
- < div className = "text-center" >
20
- < KolLinkButton
21
- _href = { url }
22
- _label = { MESSAGES [ lang ] . components . playgroundCards . button }
23
- _target = "${image}"
24
- > </ KolLinkButton >
15
+ > = ( { lang, name, image, url } ) => {
16
+ const imagePath = `${ lang === 'en' ? '/en' : '' } /assets/playgrounds/${ image } ` ;
17
+
18
+ return (
19
+ < div className = "grid gap-2" >
20
+ < Heading as = "h3" > { name } </ Heading >
21
+ < img src = { imagePath } alt = { MESSAGES [ lang ] . components . playgroundCards . previewAlt ( name ) } />
22
+ < div className = "text-center" >
23
+ < KolLinkButton
24
+ _href = { url }
25
+ _label = { MESSAGES [ lang ] . components . playgroundCards . button }
26
+ _target = "${image}"
27
+ > </ KolLinkButton >
28
+ </ div >
25
29
</ div >
26
- </ div >
27
- ) ;
30
+ ) ;
31
+ } ;
28
32
29
33
export type PlaygroundCardsProps = {
30
34
lang ?: Locale ;
Original file line number Diff line number Diff line change @@ -9,6 +9,7 @@ export const MESSAGES = {
9
9
components : {
10
10
playgroundCards : {
11
11
button : 'Try it out now!' ,
12
+ previewAlt : ( name : string ) => `Preview for playground ${ name } ` ,
12
13
} ,
13
14
propertiesTable : {
14
15
meta : 'Only applies to types who actually mean variants.' ,
@@ -21,6 +22,7 @@ export const MESSAGES = {
21
22
components : {
22
23
playgroundCards : {
23
24
button : 'Jetzt ausprobieren!' ,
25
+ previewAlt : ( name : string ) => `Vorschau des Playground ${ name } ` ,
24
26
} ,
25
27
propertiesTable : {
26
28
meta : 'Betrifft nur Typen, die eigentlich Varianten meinen.' ,
You can’t perform that action at this time.
0 commit comments