Skip to content

Commit

Permalink
[Uptime] Thumbnail full screen view steps navigation fix (#91895) (#9…
Browse files Browse the repository at this point in the history
…2148)

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>

Co-authored-by: Shahzad <shahzad.muhammad@elastic.co>
  • Loading branch information
kibanamachine and shahzad31 authored Feb 22, 2021
1 parent 76924e2 commit 579de12
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 579de12

Please sign in to comment.