Skip to content

Commit

Permalink
[Uptime] Thumbnail full screen view steps navigation fix (elastic#91895)
Browse files Browse the repository at this point in the history
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
  • Loading branch information
shahzad31 and kibanamachine committed Feb 22, 2021
1 parent b5f05d6 commit f2dee5f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ export const PingTimestamp = ({ timestamp, ping }: Props) => {
}
}, [data]);

const imgSrc = stepImages[stepNumber] || data?.src;
const imgSrc = stepImages?.[stepNumber - 1] ?? data?.src;

const captionContent = formatCaptionContent(stepNumber, data?.maxSteps);

Expand All @@ -85,6 +85,7 @@ export const PingTimestamp = ({ timestamp, ping }: Props) => {
setStepNumber={setStepNumber}
stepNumber={stepNumber}
timestamp={timestamp}
isLoading={status === FETCH_STATUS.LOADING || status === FETCH_STATUS.PENDING}
/>
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ describe('StepImageCaption', () => {
setStepNumber: jest.fn(),
stepNumber: 2,
timestamp: '2020-11-26T15:28:56.896Z',
isLoading: false,
};
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ export interface StepImageCaptionProps {
setStepNumber: React.Dispatch<React.SetStateAction<number>>;
stepNumber: number;
timestamp: string;
isLoading: boolean;
}

const ImageCaption = euiStyled.div`
Expand All @@ -35,6 +36,7 @@ export const StepImageCaption: React.FC<StepImageCaptionProps> = ({
setStepNumber,
stepNumber,
timestamp,
isLoading,
}) => {
return (
<ImageCaption>
Expand All @@ -49,6 +51,7 @@ export const StepImageCaption: React.FC<StepImageCaptionProps> = ({
}}
iconType="arrowLeft"
aria-label={prevAriaLabel}
isLoading={isLoading}
>
{prevAriaLabel}
</EuiButtonEmpty>
Expand All @@ -65,6 +68,7 @@ export const StepImageCaption: React.FC<StepImageCaptionProps> = ({
iconType="arrowRight"
iconSide="right"
aria-label={nextAriaLabel}
isLoading={isLoading}
>
{nextAriaLabel}
</EuiButtonEmpty>
Expand Down

0 comments on commit f2dee5f

Please sign in to comment.