File tree Expand file tree Collapse file tree 4 files changed +29
-26
lines changed Expand file tree Collapse file tree 4 files changed +29
-26
lines changed Original file line number Diff line number Diff line change @@ -30,7 +30,6 @@ Checklist for creating a new component:
3030
3131-  Does it have proper type definitions?
3232-  Does it have prop types?
33- -  Can it pass a ref with forwardRef?
3433-  Does it have a story in the Storybook?
3534
3635## Contributing  
Original file line number Diff line number Diff line change 1- import  {  forwardRef ,  ReactElement  }  from  'react' 
1+ import  {  ComponentPropsWithRef ,  ReactElement  }  from  'react' 
22import  {  useTheme  }  from  'styled-components' 
33
44enum  AWSIconName  { 
@@ -470,28 +470,29 @@ interface AWSIconProps {
470470  size ?: number 
471471} 
472472
473- const  AWSIcon  =  forwardRef < HTMLImageElement ,  AWSIconProps > ( 
474-   ( {  name,  size =  24 ,  ...props  } ,  ref )  =>  { 
475-     const  theme  =  useTheme ( ) 
476-     const  icon  =  AWSIcons [ name ] ?.( size )  ??  null 
473+ function  AWSIcon ( { 
474+   name, 
475+   size =  24 , 
476+   ...props 
477+ } : AWSIconProps  &  ComponentPropsWithRef < 'div' > )  { 
478+   const  theme  =  useTheme ( ) 
479+   const  icon  =  AWSIcons [ name ] ?.( size )  ??  null 
477480
478-     return  icon  ? ( 
479-       < div 
480-         ref = { ref } 
481-         style = { { 
482-           display : 'block' , 
483-           borderRadius : theme . borderRadiuses . medium , 
484-           overflow : 'hidden' , 
485-           width : size , 
486-           height : size , 
487-         } } 
488-         { ...props } 
489-       > 
490-         { icon } 
491-       </ div > 
492-     )  : null 
493-   } 
494- ) 
481+   return  icon  ? ( 
482+     < div 
483+       style = { { 
484+         display : 'block' , 
485+         borderRadius : theme . borderRadiuses . medium , 
486+         overflow : 'hidden' , 
487+         width : size , 
488+         height : size , 
489+       } } 
490+       { ...props } 
491+     > 
492+       { icon } 
493+     </ div > 
494+   )  : null 
495+ } 
495496
496497export  default  AWSIcon 
497498
Original file line number Diff line number Diff line change @@ -242,4 +242,3 @@ export { default as WebhooksIcon } from './components/icons/WebhooksIcon'
242242export  {  default  as  WindowsLogoIcon  }  from  './components/icons/WindowsLogoIcon' 
243243export  {  default  as  WorkspaceIcon  }  from  './components/icons/WorkspaceIcon' 
244244export  {  default  as  YouTubeIcon  }  from  './components/icons/YouTubeIcon' 
245- export  {  default  as  AWSIcon ,  AWSIconName  }  from  './components/icons/AWSIcon' 
Original file line number Diff line number Diff line change @@ -8,8 +8,12 @@ export * from './icons'
88export  *  from  './plural-logos' 
99
1010// Components 
11- export  {  default  as  Accordion ,  AccordionItem  }  from  './components/Accordion' 
12- export  type  {  AccordionProps  }  from  './components/Accordion' 
11+ export  { 
12+   default  as  Accordion , 
13+   AccordionItem , 
14+   type  AccordionProps , 
15+ }  from  './components/Accordion' 
16+ export  {  default  as  AWSIcon ,  AWSIconName  }  from  './components/icons/AWSIcon' 
1317export  {  AnimatedDiv  }  from  './components/AnimatedDiv' 
1418export  {  default  as  AppIcon  }  from  './components/AppIcon' 
1519export  {  default  as  ArrowScroll  }  from  './components/ArrowScroll' 
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments