mirror of
https://github.com/grafana/grafana.git
synced 2025-02-12 08:35:43 -06:00
* 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
30 lines
750 B
TypeScript
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,
|
|
}),
|
|
});
|