Skip to content

Commit 0c8685f

Browse files
[Security Solution] [Onboarding] Integrations tab separators not showing on dark mode (#210380)
## Summary This PR addresses #208986 https://github.com/user-attachments/assets/31afe060-1258-4336-a3d9-fca561d244d1 ### Checklist Check the PR satisfies following conditions. Reviewers should verify this PR satisfies this list as well. - [ ] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios --------- Co-authored-by: Elastic Machine <[email protected]>
1 parent a95f903 commit 0c8685f

File tree

2 files changed

+51
-1
lines changed

2 files changed

+51
-1
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
/*
2+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
3+
* or more contributor license agreements. Licensed under the Elastic License
4+
* 2.0; you may not use this file except in compliance with the Elastic License
5+
* 2.0.
6+
*/
7+
8+
import { css } from '@emotion/react';
9+
import { useEuiTheme } from '@elastic/eui';
10+
11+
export const useIntegrationCardGridTabsStyles = () => {
12+
const { euiTheme } = useEuiTheme();
13+
return css`
14+
button {
15+
position: relative;
16+
}
17+
button:not(:first-child)::before {
18+
position: absolute;
19+
left: 0px;
20+
content: ' ';
21+
width: 1px;
22+
height: 70%;
23+
background-color: ${euiTheme.colors.darkShade};
24+
top: 50%;
25+
transform: translateY(-50%);
26+
}
27+
button[aria-pressed='true'],
28+
button[aria-pressed='true'] + button {
29+
&::before {
30+
content: none;
31+
}
32+
}
33+
button[aria-pressed='true'] {
34+
text-decoration: none;
35+
}
36+
`;
37+
};

x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_body/cards/integrations/integration_card_grid_tabs.tsx

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,14 @@
55
* 2.0.
66
*/
77
import React, { lazy, Suspense, useMemo, useCallback, useEffect, useRef } from 'react';
8-
import { EuiButtonGroup, EuiFlexGroup, EuiFlexItem, EuiSkeletonText } from '@elastic/eui';
8+
import {
9+
COLOR_MODES_STANDARD,
10+
EuiButtonGroup,
11+
EuiFlexGroup,
12+
EuiFlexItem,
13+
EuiSkeletonText,
14+
useEuiTheme,
15+
} from '@elastic/eui';
916
import type { AvailablePackagesHookType, IntegrationCardItem } from '@kbn/fleet-plugin/public';
1017
import { noop } from 'lodash';
1118

@@ -30,6 +37,7 @@ import { useIntegrationCardList } from './use_integration_card_list';
3037
import { IntegrationTabId } from './types';
3138
import { IntegrationCardTopCallout } from './callouts/integration_card_top_callout';
3239
import { trackOnboardingLinkClick } from '../../../lib/telemetry';
40+
import { useIntegrationCardGridTabsStyles } from './integration_card_grid_tabs.styles';
3341

3442
export interface IntegrationsCardGridTabsProps {
3543
installedIntegrationsCount: number;
@@ -49,6 +57,8 @@ export const IntegrationsCardGridTabsComponent = React.memo<IntegrationsCardGrid
4957
({ installedIntegrationsCount, isAgentRequired, useAvailablePackages }) => {
5058
const { spaceId } = useOnboardingContext();
5159
const scrollElement = useRef<HTMLDivElement>(null);
60+
const { colorMode } = useEuiTheme();
61+
const isDark = colorMode === COLOR_MODES_STANDARD.dark;
5262
const [toggleIdSelected, setSelectedTabIdToStorage] = useStoredIntegrationTabId(
5363
spaceId,
5464
DEFAULT_TAB.id
@@ -78,6 +88,8 @@ export const IntegrationsCardGridTabsComponent = React.memo<IntegrationsCardGrid
7888

7989
const selectedTab = useMemo(() => INTEGRATION_TABS_BY_ID[toggleIdSelected], [toggleIdSelected]);
8090

91+
const buttonGroupStyles = useIntegrationCardGridTabsStyles();
92+
8193
const onSearchTermChanged = useCallback(
8294
(searchQuery: string) => {
8395
setSearchTerm(searchQuery);
@@ -144,6 +156,7 @@ export const IntegrationsCardGridTabsComponent = React.memo<IntegrationsCardGrid
144156
>
145157
<EuiFlexItem grow={false}>
146158
<EuiButtonGroup
159+
css={isDark ? buttonGroupStyles : undefined}
147160
buttonSize="compressed"
148161
color="primary"
149162
idSelected={toggleIdSelected}

0 commit comments

Comments
 (0)