diff --git a/src/custom/Feedback/FeedbackButton.tsx b/src/custom/Feedback/FeedbackButton.tsx index f47f9157f..3d5387553 100644 --- a/src/custom/Feedback/FeedbackButton.tsx +++ b/src/custom/Feedback/FeedbackButton.tsx @@ -1,5 +1,5 @@ import Typography from '@mui/material/Typography'; -import React, { CSSProperties, useState } from 'react'; +import React, { CSSProperties, FC, useState } from 'react'; import { CalenderIcon, CloseIcon, @@ -8,7 +8,8 @@ import { QuestionIcon, SuccessIcon } from '../../icons'; -import { CULTURED } from '../../theme'; +import { IconProps } from '../../icons/types'; +import { useTheme, CULTURED } from '../../theme'; import { CustomTooltip } from '../CustomTooltip'; import { ModalButtonPrimary } from '../Modal'; import { ModalCard } from '../ModalCard'; @@ -35,7 +36,7 @@ const tooltipContent = 'Some account and system information may be sent to Layer5. We will use it to fix problems and improve our services, subject to our [Privacy Policy](https://layer5.io/company/legal/privacy) and [Terms of Service](https://layer5.io/company/legal/terms-of-service). We may email you for more information or updates.'; interface FeedbackDataItem { - icon: JSX.Element; + icon: FC; label: string; placeholder?: string; isTextInput: boolean; @@ -44,19 +45,19 @@ interface FeedbackDataItem { const feedbackData: FeedbackDataItem[] = [ { - icon: , + icon: FeedbackIcon, label: 'Issue', placeholder: 'I’m having an issue with...', isTextInput: true }, { - icon: , + icon: IdeaIcon, label: 'Suggestion', placeholder: 'I have a suggestion about...', isTextInput: true }, { - icon: , + icon: CalenderIcon, label: 'Meet Request', isTextInput: false, innerComponent: ( @@ -99,6 +100,7 @@ const FeedbackComponent: React.FC = ({ defaultMessage = undefined, defaultOpen = false }) => { + const theme = useTheme(); const [isOpen, setIsOpen] = useState(defaultOpen); const [submitted, setSubmitted] = useState(false); const [category, setCategory] = useState(feedbackData[0]); @@ -190,18 +192,18 @@ const FeedbackComponent: React.FC = ({ {feedbackData?.map((item) => ( - { - setCategory(item); - }} - isOpen={category?.label === item.label} - > - {item.icon} - {item.label} - + { + setCategory(item); + }} + isOpen={category?.label === item.label} + > + + {item.label} + ))} {category?.isTextInput ? ( diff --git a/src/custom/Feedback/style.tsx b/src/custom/Feedback/style.tsx index 34844983c..277c7ba57 100644 --- a/src/custom/Feedback/style.tsx +++ b/src/custom/Feedback/style.tsx @@ -250,13 +250,7 @@ export const FeedbackOptionButton = styled(Button)(({ them flexDirection: 'column', borderBottom: isOpen ? `2px solid ${theme.palette.interactive.primary}` : '', background: isOpen ? SNOW_WHITE : theme.palette.navigation.secondary, - color: isOpen - ? theme.palette.mode === 'dark' - ? SNOW_WHITE - : BLACK - : theme.palette.mode === 'dark' - ? SNOW_WHITE - : SNOW_WHITE, + color: isOpen ? BLACK : SNOW_WHITE, fill: isOpen ? theme.palette.icon.default : SNOW_WHITE, stroke: isOpen ? theme.palette.icon.inverse : theme.palette.icon.brand, '&:hover': {