Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 16 additions & 5 deletions crowdsec-docs/src/components/console-promo.tsx
Original file line number Diff line number Diff line change
@@ -1,22 +1,33 @@
import { useHistory } from "@docusaurus/router";
import useBaseUrl from "@docusaurus/useBaseUrl";
import { Button } from "@site/src/ui/button";
import { Card, CardContent, CardHeader } from "@site/src/ui/card";
import React from "react";

const ConsolePromo = ({ ...props }): React.JSX.Element => {
const url = useBaseUrl(`/img/${props.image}`);
const isExternal = /^(?:[a-z]+:)?\/\//i.test(props.link);
const history = useHistory();
return (
<Card className="min-h-[200px] flex flex-col">
<CardHeader className="flex-shrink-0">{props.title ? <h3 className="text-left">{props.title}</h3> : null}</CardHeader>
<CardContent className="flex-row flex space-x-4 flex-1">
<div className="flex-col flex justify-between flex-1">
{props.description ? <p className="text-left text-base text-card-foreground">{props.description}</p> : null}
<div className="text-left">
<a href={props.link} target="_blank">
<Button color="primary" className="w-full md:w-1/2">
{props.text ?? "Get Started"}
</Button>
</a>
<Button
color="primary"
className="w-full md:w-1/2"
onClick={() => {
if (isExternal) {
window.open(props.link, "_blank", "noopener,noreferrer");
} else {
history.push(props.link);
}
}}
>
{props.text ?? "Get Started"}
</Button>
</div>
</div>

Expand Down
2 changes: 1 addition & 1 deletion crowdsec-docs/src/css/custom.css
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ html[data-theme="dark"] {
}

/* IMAGE STYLES FOR PAGES*/
.container img {
main .container img:not(a img) {
@apply border border-solid border-gray-300/80 dark:border-gray-300/80 rounded-lg p-2;
}

Expand Down