Skip to content

Commit

Permalink
ZKUI-393 // Link the no account page to the Veeam Assistant
Browse files Browse the repository at this point in the history
  • Loading branch information
hervedombya committed Nov 20, 2023
1 parent 664a0d0 commit 87673f0
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 5 deletions.
20 changes: 19 additions & 1 deletion src/react/account/Accounts.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import { useAccessibleAccountsAdapter } from '../next-architecture/ui/Accessible
import { EmptyStateContainer } from '../ui-elements/Container';
import { Warning } from '../ui-elements/Warning';
import { useAuthGroups } from '../utils/hooks';
import { Button } from '@scality/core-ui/dist/next';

const Accounts = () => {
const { pathname } = useLocation();
Expand Down Expand Up @@ -59,7 +60,24 @@ const Accounts = () => {
<Warning
centered={true}
icon={<Icon name="Account" size="5x" />}
title={`You don't have any account, please create your first one.`}
title={
<>
You don't have any account yet.
<br />
Launch configuration assitant to create resources needed
by Veeam.
</>
}
content={
<>
<Button
label="Start Configuration for Veeam"
variant="primary"
onClick={() => history.push('/veeam/configuration')}
/>
<p>or</p>
</>
}
btnTitle="Create Account"
btnAction={() => history.push('/create-account')}
/>
Expand Down
12 changes: 8 additions & 4 deletions src/react/ui-elements/Warning.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import styled, { css } from 'styled-components';
import { Button } from '@scality/core-ui/dist/next';
import { spacing } from '@scality/core-ui/dist/style/theme';
import { ReactNode } from 'react';
import { Icon } from '@scality/core-ui';
import { Icon, Text } from '@scality/core-ui';
const Container = styled.div<{ centered?: boolean }>`
display: flex;
flex: 1;
Expand Down Expand Up @@ -39,24 +39,28 @@ const ButtonSection = styled.div`
type WarningProps = {
icon?: ReactNode;
title: ReactNode;
content?: ReactNode;
btnTitle?: string;
btnAction?: () => void;
centered?: boolean;
};
export const Warning = ({
icon,
title,
content,
btnTitle,
btnAction,
centered,
}: WarningProps) => (
<Container centered={centered}>
<div>{icon}</div>
<Title> {title} </Title>
<Title>
<Text isEmphazed>{title}</Text>
</Title>
{!!btnTitle && !!btnAction && (
<ButtonSection>
{' '}
<Button label={btnTitle} variant="secondary" onClick={btnAction} />{' '}
{content}
<Button label={btnTitle} variant="outline" onClick={btnAction} />{' '}
</ButtonSection>
)}
</Container>
Expand Down

0 comments on commit 87673f0

Please sign in to comment.