generated from eea/volto-addon-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
57 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
/* eslint-disable jsx-a11y/no-static-element-interactions */ | ||
/* eslint-disable jsx-a11y/click-events-have-key-events */ | ||
/* eslint-disable jsx-a11y/anchor-is-valid */ | ||
|
||
import React from 'react'; | ||
import { UniversalLink, Icon } from '@plone/volto/components'; | ||
|
||
import rightKeySVG from '@plone/volto/icons/right-key.svg'; | ||
import downKeySVG from '@plone/volto/icons/down-key.svg'; | ||
|
||
import './style.css'; | ||
|
||
const SourcesWidget = ({ sources }) => { | ||
const [expand, setExpand] = React.useState(true); | ||
return ( | ||
<div> | ||
<a className="embed-sources-header" onClick={() => setExpand(!expand)}> | ||
<h3> | ||
<Icon | ||
name={expand ? downKeySVG : rightKeySVG} | ||
title={expand ? 'Collapse' : 'Expand'} | ||
size="17px" | ||
/> | ||
Source: | ||
</h3> | ||
</a> | ||
{expand && ( | ||
<li className="embed-source-param"> | ||
<UniversalLink | ||
className="embed-sources-param-title" | ||
href={sources?.data?.tableau_visualization_data?.general?.url} | ||
> | ||
{sources?.data?.tableau_visualization_data?.general?.url} | ||
</UniversalLink> | ||
</li> | ||
)} | ||
</div> | ||
); | ||
}; | ||
|
||
export default SourcesWidget; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import Sources from './Sources'; | ||
|
||
export { Sources }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
.embed-sources-header { | ||
cursor: pointer; | ||
} | ||
|
||
.embed-sources-param-description { | ||
margin-left: 5px; | ||
} |