Skip to content

Commit

Permalink
[Synthetics UI] Remove nested button (#148200)
Browse files Browse the repository at this point in the history
## Summary

Fixes this error

<img width="1278" alt="Screenshot 2022-12-29 at 16 03 39"
src="https://user-images.githubusercontent.com/57448/209971732-8eb5869d-7791-46d7-a6e4-060794735e7f.png">

The diff doesn't make it easy to see, but basically the change is this:

```tsx
// Before
<EuiLink href="...">
   <EuiEmptyButton {...props}>...</EuiEmptyButton>
</EuiLink>

// After
<EuiEmptyButton href="..." {...props}>...</EuiEmptyButton>
```
  • Loading branch information
Alejandro Fernández Gómez authored Dec 29, 2022
1 parent e3cac21 commit c9070b3
Showing 1 changed file with 7 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,7 @@
*/

import React from 'react';
import {
EuiButtonEmpty,
EuiFlexGroup,
EuiFlexItem,
EuiText,
EuiTitle,
EuiLink,
} from '@elastic/eui';
import { EuiButtonEmpty, EuiFlexGroup, EuiFlexItem, EuiText, EuiTitle } from '@elastic/eui';
import { css } from '@emotion/css';
import { useHistory } from 'react-router-dom';

Expand Down Expand Up @@ -68,7 +61,7 @@ export const MonitorStatusHeader = ({

{showViewHistoryButton ? (
<EuiFlexItem grow={false}>
<EuiLink
<EuiButtonEmpty
href={
monitor?.[ConfigKey.CONFIG_ID]
? history.createHref({
Expand All @@ -83,15 +76,12 @@ export const MonitorStatusHeader = ({
})
: undefined
}
data-test-subj="monitorStatusChartViewHistoryButton"
size="xs"
iconType="list"
>
<EuiButtonEmpty
data-test-subj="monitorStatusChartViewHistoryButton"
size="xs"
iconType="list"
>
{labels.VIEW_HISTORY_LABEL}
</EuiButtonEmpty>
</EuiLink>
{labels.VIEW_HISTORY_LABEL}
</EuiButtonEmpty>
</EuiFlexItem>
) : null}
</EuiFlexGroup>
Expand Down

0 comments on commit c9070b3

Please sign in to comment.