Skip to content

Commit

Permalink
[EuiButtonGroup] Remove unnecessary function from euiButtonGroupStyles
Browse files Browse the repository at this point in the history
  • Loading branch information
cee-chen committed Feb 22, 2024
1 parent b1e9e8c commit bcca47d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 15 deletions.
20 changes: 9 additions & 11 deletions src/components/button/button_group/button_group.styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,15 @@ import { UseEuiTheme } from '../../../services';
import { logicalCSS } from '../../../global_styling';
import { euiFormVariables } from '../../form/form.styles';

export const euiButtonGroupStyles = () => {
return {
euiButtonGroup: css`
display: inline-block;
${logicalCSS('max-width', '100%')}
position: relative; /* Ensures the EuiScreenReaderOnly component is positioned relative to this component */
`,
fullWidth: css`
display: block;
`,
};
export const euiButtonGroupStyles = {
euiButtonGroup: css`
display: inline-block;
${logicalCSS('max-width', '100%')}
position: relative; /* Ensures the EuiScreenReaderOnly component is positioned relative to this component */
`,
fullWidth: css`
display: block;
`,
};

export const euiButtonGroupButtonsStyles = (euiThemeContext: UseEuiTheme) => {
Expand Down
7 changes: 3 additions & 4 deletions src/components/button/button_group/button_group.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import React, {
ReactNode,
} from 'react';

import { useEuiTheme } from '../../../services';
import { useEuiMemoizedStyles } from '../../../services';
import { EuiScreenReaderOnly } from '../../accessibility';
import { CommonProps } from '../../common';

Expand Down Expand Up @@ -142,10 +142,9 @@ export const EuiButtonGroup: FunctionComponent<Props> = ({
type = 'single',
...rest
}) => {
const wrapperStyles = euiButtonGroupStyles();
const wrapperCssStyles = [
wrapperStyles.euiButtonGroup,
isFullWidth && wrapperStyles.fullWidth,
euiButtonGroupStyles.euiButtonGroup,
isFullWidth && euiButtonGroupStyles.fullWidth,
];

const styles = useEuiMemoizedStyles(euiButtonGroupButtonsStyles);
Expand Down

0 comments on commit bcca47d

Please sign in to comment.