File tree Expand file tree Collapse file tree 2 files changed +17
-6
lines changed Expand file tree Collapse file tree 2 files changed +17
-6
lines changed Original file line number Diff line number Diff line change 1+ import { useHistory } from "@docusaurus/router" ;
12import useBaseUrl from "@docusaurus/useBaseUrl" ;
23import { Button } from "@site/src/ui/button" ;
34import { Card , CardContent , CardHeader } from "@site/src/ui/card" ;
45import React from "react" ;
56
67const ConsolePromo = ( { ...props } ) : React . JSX . Element => {
78 const url = useBaseUrl ( `/img/${ props . image } ` ) ;
9+ const isExternal = / ^ (?: [ a - z ] + : ) ? \/ \/ / i. test ( props . link ) ;
10+ const history = useHistory ( ) ;
811 return (
912 < Card className = "min-h-[200px] flex flex-col" >
1013 < CardHeader className = "flex-shrink-0" > { props . title ? < h3 className = "text-left" > { props . title } </ h3 > : null } </ CardHeader >
1114 < CardContent className = "flex-row flex space-x-4 flex-1" >
1215 < div className = "flex-col flex justify-between flex-1" >
1316 { props . description ? < p className = "text-left text-base text-card-foreground" > { props . description } </ p > : null }
1417 < div className = "text-left" >
15- < a href = { props . link } target = "_blank" >
16- < Button color = "primary" className = "w-full md:w-1/2" >
17- { props . text ?? "Get Started" }
18- </ Button >
19- </ a >
18+ < Button
19+ color = "primary"
20+ className = "w-full md:w-1/2"
21+ onClick = { ( ) => {
22+ if ( isExternal ) {
23+ window . open ( props . link , "_blank" , "noopener,noreferrer" ) ;
24+ } else {
25+ history . push ( props . link ) ;
26+ }
27+ } }
28+ >
29+ { props . text ?? "Get Started" }
30+ </ Button >
2031 </ div >
2132 </ div >
2233
Original file line number Diff line number Diff line change @@ -57,7 +57,7 @@ html[data-theme="dark"] {
5757}
5858
5959/* IMAGE STYLES FOR PAGES*/
60- .container img {
60+ main .container img : not ( a img ) {
6161 @apply border border-solid border-gray-300/80 dark:border-gray-300/80 rounded-lg p-2;
6262}
6363
You can’t perform that action at this time.
0 commit comments