From 20302a7a6923b7000d6742b58f1fab809ce5dff9 Mon Sep 17 00:00:00 2001 From: kshitij katiyar Date: Mon, 23 Sep 2024 15:16:32 +0530 Subject: [PATCH] [MM-1025]: Updated the icon and added svg wrapper --- .../jira_ticket_tooltip.tsx | 15 +++++--- .../jira_ticket_tooltip/ticketStyle.scss | 1 + .../src/components/plugin_constants/icons.tsx | 19 ++++++++++ webapp/src/components/svgWrapper/index.tsx | 36 +++++++++++++++++++ 4 files changed, 66 insertions(+), 5 deletions(-) create mode 100644 webapp/src/components/plugin_constants/icons.tsx create mode 100644 webapp/src/components/svgWrapper/index.tsx diff --git a/webapp/src/components/jira_ticket_tooltip/jira_ticket_tooltip.tsx b/webapp/src/components/jira_ticket_tooltip/jira_ticket_tooltip.tsx index 7433d9ba9..0baecc861 100644 --- a/webapp/src/components/jira_ticket_tooltip/jira_ticket_tooltip.tsx +++ b/webapp/src/components/jira_ticket_tooltip/jira_ticket_tooltip.tsx @@ -1,6 +1,8 @@ import React, {ReactNode} from 'react'; import {Instance} from 'types/model'; +import SVGWrapper from 'components/svgWrapper'; +import {SVGIcons} from 'components/plugin_constants/icons'; import {TicketData, TicketDetails} from 'types/tooltip'; import DefaultAvatar from 'components/default_avatar/default_avatar'; @@ -177,11 +179,14 @@ export default class TicketPopover extends React.PureComponent { if (error) { return (
- + + {SVGIcons.exclamationTriangle} +
{error}

{'Check your connection or try again later'}

diff --git a/webapp/src/components/jira_ticket_tooltip/ticketStyle.scss b/webapp/src/components/jira_ticket_tooltip/ticketStyle.scss index 510c28b73..e340d1769 100644 --- a/webapp/src/components/jira_ticket_tooltip/ticketStyle.scss +++ b/webapp/src/components/jira_ticket_tooltip/ticketStyle.scss @@ -239,6 +239,7 @@ flex-direction: column; justify-content: center; gap: 10px; + padding: 12px; .jira-issue-error-message { font-size: 19px; diff --git a/webapp/src/components/plugin_constants/icons.tsx b/webapp/src/components/plugin_constants/icons.tsx new file mode 100644 index 000000000..e5983c0c6 --- /dev/null +++ b/webapp/src/components/plugin_constants/icons.tsx @@ -0,0 +1,19 @@ +import React from 'react'; + +type SvgIconNames = 'exclamationTriangle'; + +export const SVGIcons: Record = { + exclamationTriangle: ( + + + + + ), +}; diff --git a/webapp/src/components/svgWrapper/index.tsx b/webapp/src/components/svgWrapper/index.tsx new file mode 100644 index 000000000..706de1b73 --- /dev/null +++ b/webapp/src/components/svgWrapper/index.tsx @@ -0,0 +1,36 @@ +import React from 'react'; + +type SVGWrapperProps = { + viewBox?: string; + height?: number; + width?: number; + fill?: string; + onHoverFill?: string; + children: React.ReactNode; + className?: string; +} + +const SVGWrapper = ({ + children, + viewBox = '0 0 36 36', + height = 36, + width = 36, + fill = 'none', + onHoverFill, + className = '', +}: SVGWrapperProps): JSX.Element => { + return ( + + {children} + + ); +}; + +export default SVGWrapper;