1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-07-23 15:29:42 +02:00

feat(ui): portainer base component css change [EE-3381] (#7115)

This commit is contained in:
Chaim Lev-Ari 2022-06-23 09:32:18 +03:00 committed by GitHub
parent 825269c119
commit f78a6568a6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
70 changed files with 999 additions and 1596 deletions

View file

@ -1,4 +1,5 @@
import { useRouter } from '@uirouter/react';
import { RefreshCw } from 'react-feather';
import { Button } from '../buttons';
@ -11,12 +12,25 @@ import styles from './PageHeader.module.css';
interface Props {
reload?: boolean;
loading?: boolean;
onReload?(): Promise<void> | void;
breadcrumbs?: Crumb[];
title: string;
}
export function PageHeader({ title, breadcrumbs = [], reload }: Props) {
export function PageHeader({
title,
breadcrumbs = [],
reload,
loading,
onReload,
}: Props) {
const router = useRouter();
function onClickedRefresh() {
return onReload ? onReload() : router.stateService.reload();
}
return (
<HeaderContainer>
<HeaderTitle title={title}>
@ -24,10 +38,11 @@ export function PageHeader({ title, breadcrumbs = [], reload }: Props) {
<Button
color="link"
size="medium"
onClick={() => router.stateService.reload()}
onClick={onClickedRefresh}
className={styles.reloadButton}
disabled={loading}
>
<i className="fa fa-sync" aria-hidden="true" />
<RefreshCw className="feather" />
</Button>
)}
</HeaderTitle>