Skip to content

Commit

Permalink
[Guided onboarding] Fix card footer button markup (#145050)
Browse files Browse the repository at this point in the history
  • Loading branch information
mibragimov authored Nov 14, 2022
1 parent 6ac78d7 commit 94437f8
Show file tree
Hide file tree
Showing 2 changed files with 98 additions and 74 deletions.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

import React from 'react';
import { css } from '@emotion/react';
import { EuiButton, EuiProgress, EuiSpacer } from '@elastic/eui';
import { EuiButton, EuiProgress, EuiSpacer, EuiFlexGroup, EuiFlexItem } from '@elastic/eui';
import { i18n } from '@kbn/i18n';
import { GuideId, GuideState } from '../../types';
import { UseCase } from './use_case_card';
Expand Down Expand Up @@ -54,16 +54,18 @@ export interface GuideCardFooterProps {
export const GuideCardFooter = ({ guides, useCase, activateGuide }: GuideCardFooterProps) => {
const guideState = guides.find((guide) => guide.guideId === (useCase as GuideId));
const viewGuideButton = (
<div className="eui-textCenter">
<EuiButton
// Used for FS tracking
data-test-subj={`onboarding--guideCard--view--${useCase}`}
fill
onClick={() => activateGuide(useCase, guideState)}
>
{viewGuideLabel}
</EuiButton>
</div>
<EuiFlexGroup justifyContent="center">
<EuiFlexItem grow={false}>
<EuiButton
// Used for FS tracking
data-test-subj={`onboarding--guideCard--view--${useCase}`}
fill
onClick={() => activateGuide(useCase, guideState)}
>
{viewGuideLabel}
</EuiButton>
</EuiFlexItem>
</EuiFlexGroup>
);
// guide has not started yet
if (!guideState || guideState.status === 'not_started') {
Expand Down Expand Up @@ -108,16 +110,18 @@ export const GuideCardFooter = ({ guides, useCase, activateGuide }: GuideCardFoo
}}
/>
<EuiSpacer size="l" />
<div className="eui-textCenter">
<EuiButton
// Used for FS tracking
data-test-subj={`onboarding--guideCard--continue--${useCase}`}
fill
onClick={() => activateGuide(useCase, guideState)}
>
{continueGuideLabel}
</EuiButton>
</div>
<EuiFlexGroup justifyContent="center">
<EuiFlexItem grow={false}>
<EuiButton
// Used for FS tracking
data-test-subj={`onboarding--guideCard--continue--${useCase}`}
fill
onClick={() => activateGuide(useCase, guideState)}
>
{continueGuideLabel}
</EuiButton>
</EuiFlexItem>
</EuiFlexGroup>
</>
);
};

0 comments on commit 94437f8

Please sign in to comment.