11import Typography from '@mui/material/Typography' ;
2- import React , { CSSProperties , useState } from 'react' ;
2+ import React , { CSSProperties , FC , useState } from 'react' ;
33import {
44 CalenderIcon ,
55 CloseIcon ,
88 QuestionIcon ,
99 SuccessIcon
1010} from '../../icons' ;
11- import { CULTURED } from '../../theme' ;
11+ import { IconProps } from '../../icons/types' ;
12+ import { useTheme , CULTURED } from '../../theme' ;
1213import { CustomTooltip } from '../CustomTooltip' ;
1314import { ModalButtonPrimary } from '../Modal' ;
1415import { ModalCard } from '../ModalCard' ;
@@ -35,7 +36,7 @@ const tooltipContent =
3536 '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.' ;
3637
3738interface FeedbackDataItem {
38- icon : JSX . Element ;
39+ icon : FC < IconProps > ;
3940 label : string ;
4041 placeholder ?: string ;
4142 isTextInput : boolean ;
@@ -44,19 +45,19 @@ interface FeedbackDataItem {
4445
4546const feedbackData : FeedbackDataItem [ ] = [
4647 {
47- icon : < FeedbackIcon /> ,
48+ icon : FeedbackIcon ,
4849 label : 'Issue' ,
4950 placeholder : 'I’m having an issue with...' ,
5051 isTextInput : true
5152 } ,
5253 {
53- icon : < IdeaIcon /> ,
54+ icon : IdeaIcon ,
5455 label : 'Suggestion' ,
5556 placeholder : 'I have a suggestion about...' ,
5657 isTextInput : true
5758 } ,
5859 {
59- icon : < CalenderIcon /> ,
60+ icon : CalenderIcon ,
6061 label : 'Meet Request' ,
6162 isTextInput : false ,
6263 innerComponent : (
@@ -99,6 +100,7 @@ const FeedbackComponent: React.FC<FeedbackComponentProps> = ({
99100 defaultMessage = undefined ,
100101 defaultOpen = false
101102} ) => {
103+ const theme = useTheme ( ) ;
102104 const [ isOpen , setIsOpen ] = useState < boolean > ( defaultOpen ) ;
103105 const [ submitted , setSubmitted ] = useState < boolean > ( false ) ;
104106 const [ category , setCategory ] = useState < FeedbackDataItem | undefined > ( feedbackData [ 0 ] ) ;
@@ -190,18 +192,18 @@ const FeedbackComponent: React.FC<FeedbackComponentProps> = ({
190192 < FeedbackForm >
191193 < FeedbackOptions >
192194 { feedbackData ?. map ( ( item ) => (
193- < FeedbackOptionButton
194- key = { item . label }
195- style = { feedbackOptionStyles }
196- type = "button"
197- onClick = { ( ) => {
198- setCategory ( item ) ;
199- } }
200- isOpen = { category ?. label === item . label }
201- >
202- < FeedbackMiniIcon > { item . icon } </ FeedbackMiniIcon >
203- < Typography > { item . label } </ Typography >
204- </ FeedbackOptionButton >
195+ < FeedbackOptionButton
196+ key = { item . label }
197+ style = { feedbackOptionStyles }
198+ type = "button"
199+ onClick = { ( ) => {
200+ setCategory ( item ) ;
201+ } }
202+ isOpen = { category ?. label === item . label }
203+ >
204+ < FeedbackMiniIcon > < item . icon fill = { category ?. label === item . label ? theme . palette . icon . default : undefined } /> </ FeedbackMiniIcon >
205+ < Typography > { item . label } </ Typography >
206+ </ FeedbackOptionButton >
205207 ) ) }
206208 </ FeedbackOptions >
207209 { category ?. isTextInput ? (
0 commit comments