Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Emotion] Convert EuiEmptyPrompt #7494

Merged
merged 14 commits into from
Feb 2, 2024
Merged
4 changes: 4 additions & 0 deletions changelogs/upcoming/7494.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
**CSS-in-JS conversions**

- Converted `EuiEmptyPrompt` to Emotion
- Added `euiBorderColor` and `useEuiBorderColorCSS` style utilities
35 changes: 1 addition & 34 deletions src/components/comment_list/comment_event.styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,42 +7,9 @@
*/

import { css } from '@emotion/react';
import { UseEuiTheme, tintOrShade } from '../../services';
import { UseEuiTheme } from '../../services';
import { logicalCSS } from '../../global_styling';

export const euiCommentEventBorderColors = ({
euiTheme,
colorMode,
}: UseEuiTheme) => {
const ratio = 0.6;
return {
warning: css`
border-color: ${tintOrShade(euiTheme.colors.warning, 0.4, colorMode)};
`,
accent: css`
border-color: ${tintOrShade(euiTheme.colors.accent, ratio, colorMode)};
`,
primary: css`
border-color: ${tintOrShade(euiTheme.colors.primary, ratio, colorMode)};
`,
success: css`
border-color: ${tintOrShade(euiTheme.colors.success, ratio, colorMode)};
`,
danger: css`
border-color: ${tintOrShade(euiTheme.colors.danger, ratio, colorMode)};
`,
subdued: css`
border-color: ${euiTheme.border.color};
`,
transparent: css`
border-color: ${euiTheme.border.color};
`,
plain: css`
border-color: ${euiTheme.border.color};
`,
};
};

export const euiCommentEventStyles = (euiThemeContext: UseEuiTheme) => {
const { euiTheme } = euiThemeContext;
return {
Expand Down
4 changes: 2 additions & 2 deletions src/components/comment_list/comment_event.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ import React, { FunctionComponent, ReactNode, useMemo } from 'react';
import classNames from 'classnames';

import { useEuiTheme } from '../../services';
import { useEuiBorderColorCSS } from '../../global_styling';
import { CommonProps } from '../common';
import { IconType } from '../icon';
import { EuiPanel, EuiPanelProps } from '../panel';
import { EuiAvatar } from '../avatar';

import {
euiCommentEventBorderColors,
euiCommentEventStyles,
euiCommentEventHeaderStyles,
euiCommentEventBodyStyles,
Expand Down Expand Up @@ -119,7 +119,7 @@ export const EuiCommentEvent: FunctionComponent<EuiCommentEventProps> = ({
* Styles
*/
const euiTheme = useEuiTheme();
const borderStyles = euiCommentEventBorderColors(euiTheme);
const borderStyles = useEuiBorderColorCSS();

const styles = euiCommentEventStyles(euiTheme);
const cssStyles = [
Expand Down
Loading
Loading