Skip to content

Commit

Permalink
Update FooterSitesButton.jsx
Browse files Browse the repository at this point in the history
  • Loading branch information
dobri1408 authored Aug 28, 2024
1 parent 73090a4 commit f5cdae0
Showing 1 changed file with 5 additions and 14 deletions.
19 changes: 5 additions & 14 deletions src/ui/Footer/FooterSitesButton.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import React from 'react';
import { Button } from 'semantic-ui-react';
import PropTypes from 'prop-types';
import { isInternalURL, flattenToAppURL } from '@plone/volto/helpers';
import { UniversalLink } from '@plone/volto/components';

const SitesButton = (props) => {
if (props.children) {
Expand All @@ -11,20 +9,13 @@ const SitesButton = (props) => {
//fallback to props
return (
<div className="theme-sites">
<Button
<UniversalLink
href={props.hrefButton}
className="theme-sites-button"
onClick={() => {
if (__CLIENT__ && window) {
window.location.assign(
isInternalURL(props.hrefButton)
? flattenToAppURL(props.hrefButton)
: props.hrefButton,
);
}
}}
openLinkInNewTab={false}
>
{props.buttonName}
</Button>
</UniversalLink>
</div>
);
};
Expand Down

0 comments on commit f5cdae0

Please sign in to comment.