Skip to content

Commit

Permalink
Use TopNavControlButtonData for channel test button (#243) (#268)
Browse files Browse the repository at this point in the history
(cherry picked from commit 6121bd4)

Signed-off-by: Miki <[email protected]>
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
  • Loading branch information
1 parent fb48dbc commit 127eae4
Showing 1 changed file with 7 additions and 13 deletions.
20 changes: 7 additions & 13 deletions public/pages/Channels/components/details/ChannelDetails.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ import { ChannelDetailItems } from './ChannelDetailItems';
import { ChannelDetailsActions } from './ChannelDetailsActions';
import { ChannelSettingsDetails } from './ChannelSettingsDetails';
import PageHeader from "../../../../components/PageHeader/PageHeader";
import { TopNavControlButtonData } from '../../../../../../../src/plugins/navigation/public';

interface ChannelDetailsProps extends RouteComponentProps<{
id: string
Expand Down Expand Up @@ -190,19 +191,12 @@ export function ChannelDetails(props: ChannelDetailsProps) {
),
},
{
renderComponent: (
<div style={{ display: 'flex', alignItems: 'center' }}>
<EuiSmallButton
data-test-subj="send-test-message-button"
onClick={sendTestMessage}
style={{ marginLeft: '10px' }}
disabled={!channel?.is_enabled}
>
Send test message
</EuiSmallButton>
</div>
),
},
controlType: 'button',
testId: 'send-test-message-button',
isDisabled: !channel?.is_enabled,
run: sendTestMessage,
label: 'Send test message',
} as TopNavControlButtonData,
];

const badgeComponent = <EuiFlexItem grow={false} style={{ paddingBottom: 5 }}>
Expand Down

0 comments on commit 127eae4

Please sign in to comment.