@kitconcept/volto-button-block
Advanced tools
Comparing version 2.2.0 to 2.3.0
@@ -11,2 +11,9 @@ # kitconcept's volto-button-block Release Notes | ||
## 2.3.0 (2023-06-23) | ||
### Feature | ||
- Add new Feature Button opens in new window @iRohitSingh [#9](https://github.com/kitconcept/volto-export/pull/9) | ||
## 2.2.0 (2023-06-06) | ||
@@ -13,0 +20,0 @@ |
{ | ||
"name": "@kitconcept/volto-button-block", | ||
"version": "2.2.0", | ||
"version": "2.3.0", | ||
"description": "volto-button-block: Volto add-on that provides a configurable button as a block.", | ||
@@ -5,0 +5,0 @@ "main": "src/index.js", |
@@ -24,2 +24,6 @@ import { defineMessages } from 'react-intl'; | ||
}, | ||
openLinkInNewTab: { | ||
id: 'Open in a new tab', | ||
defaultMessage: 'Open in a new tab', | ||
}, | ||
}); | ||
@@ -36,3 +40,3 @@ | ||
title: 'Default', | ||
fields: ['title', 'href', 'inneralign'], | ||
fields: ['title', 'href', 'openLinkInNewTab', 'inneralign'], | ||
}, | ||
@@ -57,2 +61,6 @@ ], | ||
}, | ||
openLinkInNewTab: { | ||
title: intl.formatMessage(messages.openLinkInNewTab), | ||
type: 'boolean', | ||
}, | ||
}, | ||
@@ -59,0 +67,0 @@ required: [], |
@@ -5,3 +5,2 @@ import React from 'react'; | ||
import { ConditionalLink } from '@plone/volto/components'; | ||
import { flattenToAppURL, isInternalURL } from '@plone/volto/helpers'; | ||
import { defineMessages, useIntl } from 'react-intl'; | ||
@@ -34,6 +33,7 @@ | ||
let link = hasLink ? ( | ||
data.href.length > 0 && isInternalURL(data.href[0]['@id']) ? ( | ||
data.href.length > 0 && ( | ||
<ConditionalLink | ||
to={data.href.length > 0 ? flattenToAppURL(data.href[0]['@id']) : ''} | ||
to={data.href[0]?.['@id']} | ||
condition={!isEditMode} | ||
openLinkInNewTab={data.openLinkInNewTab} | ||
> | ||
@@ -44,10 +44,2 @@ <Button className={(cx('button'), data.align)}> | ||
</ConditionalLink> | ||
) : ( | ||
data.href.length > 0 && ( | ||
<a href={flattenToAppURL(data.href[0]['@id'])}> | ||
<Button className={(cx('button'), data.align)}> | ||
{data.title || intl.formatMessage(messages.ButtonText)} | ||
</Button> | ||
</a> | ||
) | ||
) | ||
@@ -54,0 +46,0 @@ ) : ( |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
35172641
675