1- import React , { useEffect , useMemo , useState } from 'react' ;
1+ import React , { ComponentType , SVGProps , useEffect , useMemo , useState } from 'react' ;
22import { useLocation } from '@reach/router' ;
33import Icon from 'src/components/Icon' ;
44import { IconName } from 'src/components/Icon/types' ;
5- import Status , { StatusUrl } from '@ably/ui/core /Status' ;
5+ import Status , { StatusUrl } from 'src/components/ui /Status' ;
66import cn from 'src/utilities/cn' ;
77import type { PageContextType } from './Layout' ;
88import { useLayoutContext } from 'src/contexts/layout-context' ;
9- import Button from '@ably/ui/core/Button' ;
9+ import Button from 'src/components/ui/Button' ;
10+ import { HandRaisedIcon , HandThumbDownIcon , HandThumbUpIcon } from '@heroicons/react/24/outline' ;
11+ import {
12+ HandRaisedIcon as HandRaisedSolidIcon ,
13+ HandThumbDownIcon as HandThumbDownSolidIcon ,
14+ HandThumbUpIcon as HandThumbUpSolidIcon ,
15+ } from '@heroicons/react/24/solid' ;
1016
1117const ENABLE_FEEDBACK = false ;
1218
1319type FeedbackMode = 'yes' | 'no' | 'feedback' ;
1420
1521type FeedbackButton = {
1622 label : string ;
17- monoIcon : IconName ;
18- colorIcon : IconName ;
23+ monoIcon : ComponentType < SVGProps < SVGSVGElement > > ;
24+ colorIcon : ComponentType < SVGProps < SVGSVGElement > > ;
1925 placeholder : string ;
2026 description ?: string ;
2127} ;
@@ -65,22 +71,22 @@ const socialLinks: { key: string; icon: IconName; link: string }[] = [
6571const feedbackButtons : Record < FeedbackMode , FeedbackButton > = {
6672 yes : {
6773 label : 'Yes' ,
68- monoIcon : 'icon-gui-hand-thumb-up-outline' ,
69- colorIcon : 'icon-gui-hand-thumb-up-solid' ,
74+ monoIcon : HandThumbUpIcon ,
75+ colorIcon : HandThumbUpSolidIcon ,
7076 description : 'Great! Thanks for letting us know, what are we doing well?' ,
7177 placeholder : 'Optional feedback.' ,
7278 } ,
7379 no : {
7480 label : 'No' ,
75- monoIcon : 'icon-gui-hand-thumb-down-outline' ,
76- colorIcon : 'icon-gui-hand-thumb-down-solid' ,
81+ monoIcon : HandThumbDownIcon ,
82+ colorIcon : HandThumbDownSolidIcon ,
7783 description : 'Yikes! Thanks for letting us know, what can we do better?' ,
7884 placeholder : 'Optional feedback.' ,
7985 } ,
8086 feedback : {
8187 label : 'I have feedback' ,
82- monoIcon : 'icon-gui-hand-raised-outline' ,
83- colorIcon : 'icon-gui-hand-raised-solid' ,
88+ monoIcon : HandRaisedIcon ,
89+ colorIcon : HandRaisedSolidIcon ,
8490 placeholder : 'What would you like to say?' ,
8591 } ,
8692} ;
@@ -189,6 +195,8 @@ const Footer: React.FC<{ pageContext: PageContextType }> = ({ pageContext }) =>
189195 < div className = "flex items-center gap-6" >
190196 { Object . entries ( feedbackButtons ) . map ( ( [ key , button ] ) => {
191197 const isActive = feedbackMode === key ;
198+ const ColorIcon = button . colorIcon ;
199+ const MonoIcon = button . monoIcon ;
192200
193201 return (
194202 < button
@@ -198,22 +206,19 @@ const Footer: React.FC<{ pageContext: PageContextType }> = ({ pageContext }) =>
198206 setFeedbackMode ( key as FeedbackMode ) ;
199207 } }
200208 >
201- < Icon
202- name = { button . colorIcon }
203- size = "20px"
204- additionalCSS = "transition-colors"
205- color = {
209+ < ColorIcon
210+ aria-hidden
211+ className = { cn (
212+ 'size-5 transition-colors' ,
206213 isActive
207214 ? 'text-orange-600'
208- : 'hidden group-hover/feedback-button:block text-neutral-1300 dark:text-neutral-000'
209- }
215+ : 'hidden group-hover/feedback-button:block text-neutral-1300 dark:text-neutral-000' ,
216+ ) }
210217 />
211218 { ! isActive && (
212- < Icon
213- name = { button . monoIcon }
214- size = "20px"
215- additionalCSS = "transition-colors"
216- color = "text-neutral-900 dark:text-neutral-400 group-hover/feedback-button:hidden"
219+ < MonoIcon
220+ aria-hidden
221+ className = "size-5 transition-colors text-neutral-900 dark:text-neutral-400 group-hover/feedback-button:hidden"
217222 />
218223 ) }
219224 < span
0 commit comments