Skip to content

Commit

Permalink
Single Template Fav Button - Authenticated
Browse files Browse the repository at this point in the history
  • Loading branch information
iamibrahimriaz committed Nov 11, 2024
1 parent 243c093 commit f7bb90a
Showing 1 changed file with 46 additions and 21 deletions.
67 changes: 46 additions & 21 deletions src/js/components/Bookmark/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,27 +88,52 @@ const Bookmark = ( props ) => {
return (
<>
{ type === 'single' ? (
<a
href="#"
className={ `templatiq__details__header__action__link add-to-favorite templatiq-btn templatiq-btn-white ${
addedToFavorite ? 'active' : ''
} ${isFavProcessing ? 'disabled' : ''} `}
onClick={ ( e ) =>
handleFavorite( e, number_of_bookmarks )
}
>
<ReactSVG
src={ addedToFavorite ? heartSolidIcon : heartIcon }
width={ 16 }
height={ 16 }
/>
{
isFavProcessing && (
<span className="image-loader"></span>
)
}

</a>
! isLoggedIn ? (
<>
{ authModalOpen ? (
<AuthModal
slug={ slug }
modalEnable={ true }
onClose={ handleAuthModalClose }
/>
) : (
''
) }
<a
href="#"
className="templatiq__details__header__action__link add-to-favorite templatiq-btn templatiq-btn-white"
onClick={ addAuthModal }
>
<ReactSVG
src={ heartIcon }
width={ 14 }
height={ 14 }
/>
</a>
</>
) : (
<a
href="#"
className={ `templatiq__details__header__action__link add-to-favorite templatiq-btn templatiq-btn-white ${
addedToFavorite ? 'active' : ''
} ${isFavProcessing ? 'disabled' : ''} `}
onClick={ ( e ) =>
handleFavorite( e, number_of_bookmarks )
}
>
<ReactSVG
src={ addedToFavorite ? heartSolidIcon : heartIcon }
width={ 16 }
height={ 16 }
/>
{
isFavProcessing && (
<span className="image-loader"></span>
)
}

</a>
)
) : ! isLoggedIn ? (
<>
{ authModalOpen ? (
Expand Down

0 comments on commit f7bb90a

Please sign in to comment.