Skip to content

Commit

Permalink
[Emotion] Convert EuiEmptyPrompt (#7494)
Browse files Browse the repository at this point in the history
  • Loading branch information
cee-chen authored Feb 2, 2024
1 parent 0abab26 commit f5e3c1a
Show file tree
Hide file tree
Showing 14 changed files with 563 additions and 620 deletions.
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

0 comments on commit f5e3c1a

Please sign in to comment.