grafana/public/app/core/components/AppChrome/NavLandingPageCard.tsx
Ashley Harrison 8d489dfd9b
Navigation: Landing pages behind feature toggles (#54576)
* super quick attempt

* feature toggle everything

* only construct alertNav if there are navChildren

* fix toggle name

* plugin landing pages poc

* add apps route + put behind feature toggle

* use toIconName

* rename to NavLandingPage

* feature toggle new routes

* don't modify GetServerAdminNode

* some fairly hacky code to check if the plugin has a root page

* remove trailing slash
2022-09-05 10:07:13 +01:00

30 lines
750 B
TypeScript

import { css } from '@emotion/css';
import React from 'react';
import { GrafanaTheme2 } from '@grafana/data';
import { Card, Icon, IconName, useStyles2 } from '@grafana/ui';
interface Props {
description?: string;
icon?: IconName;
text: string;
url: string;
}
export function NavLandingPageCard({ description, icon, text, url }: Props) {
const styles = useStyles2(getStyles);
return (
<Card className={styles.card} href={url}>
<Card.Heading>{text}</Card.Heading>
<Card.Figure align={'center'}>{icon && <Icon name={icon} size="xxxl" />}</Card.Figure>
<Card.Description>{description}</Card.Description>
</Card>
);
}
const getStyles = (theme: GrafanaTheme2) => ({
card: css({
marginBottom: 0,
}),
});