@@ -15,7 +15,7 @@ import {
1515} from '@patternfly/react-core' ;
1616import { ModalVariant } from '@patternfly/react-core/deprecated' ;
1717import { Modal as PfModal , ModalProps as PfModalProps } from '@patternfly/react-core/deprecated' ;
18- import { StarIcon } from '@patternfly/react-icons' ;
18+ import { OutlinedStarIcon , StarIcon } from '@patternfly/react-icons' ;
1919
2020import { useUserSettingsCompatibility } from './useUserSettingsCompatibility' ;
2121
@@ -34,7 +34,9 @@ const Modal: React.FC<ModalProps> = ({ isFullScreen = false, className, ...props
3434 < PfModal
3535 { ...props }
3636 className = { cx ( 'ocs-modal' , className ) }
37- appendTo = { ( ) => ( isFullScreen ? document . body : document . querySelector ( '#modal-container' ) ) }
37+ appendTo = { ( ) =>
38+ isFullScreen ? document . body : ( document . querySelector ( '#modal-container' ) ?? document . body )
39+ }
3840 />
3941) ;
4042
@@ -101,7 +103,8 @@ export const FavoriteButton = ({ defaultName }: FavoriteButtonProps) => {
101103 setIsModalOpen ( false ) ;
102104 } ;
103105
104- const handleConfirmStar = ( ) => {
106+ const handleConfirmStar = ( e ?: React . FormEvent ) => {
107+ e ?. preventDefault ( ) ;
105108 const trimmedName = name . trim ( ) ;
106109 if ( ! trimmedName ) {
107110 setError ( t ( 'Name is required.' ) ) ;
@@ -157,7 +160,7 @@ export const FavoriteButton = ({ defaultName }: FavoriteButtonProps) => {
157160 < div className = "co-fav-actions-icon" >
158161 < Tooltip content = { tooltipText } position = "top" >
159162 < Button
160- icon = { < StarIcon color = { isStarred ? ' gold' : 'gray' } /> }
163+ icon = { isStarred ? < StarIcon color = " gold" /> : < OutlinedStarIcon /> }
161164 className = "co-xl-icon-button"
162165 data-test = "favorite-button"
163166 variant = "plain"
@@ -188,10 +191,10 @@ export const FavoriteButton = ({ defaultName }: FavoriteButtonProps) => {
188191 ] }
189192 variant = { ModalVariant . small }
190193 >
191- < Form id = "confirm-favorite-form " onSubmit = { handleConfirmStar } >
194+ < Form id = "confirm-favorite" onSubmit = { handleConfirmStar } >
192195 < FormGroup label = { t ( 'Name' ) } isRequired fieldId = "input-name" >
193196 < TextInput
194- id = "confirm-favorite-form -name"
197+ id = "input -name"
195198 data-test = "input-name"
196199 name = "name"
197200 type = "text"
0 commit comments