Skip to content

Commit

Permalink
Added tooltips
Browse files Browse the repository at this point in the history
  • Loading branch information
razvanMiu committed Dec 17, 2020
1 parent 78af983 commit afa335b
Show file tree
Hide file tree
Showing 12 changed files with 78 additions and 47 deletions.
1 change: 0 additions & 1 deletion public/robots.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
User-agent: *

Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,12 @@ const CompetentAuthority = (props) => {
)}
>
<h3 className="blue">Competent Authority</h3>
<span className="floating-icon" data-tip={'This is a tooltip'}>
<span
className="floating-icon"
data-tip={
'Authority, body or bodies responsible for regulating the facility and reporting the associated E-PRTR data, as designated by the reporting country'
}
>
<Icon
className="firefox-icon"
name={infoSVG}
Expand Down
4 changes: 2 additions & 2 deletions src/components/manage/Blocks/SiteBlocks/Header/Edit.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { useState, useEffect } from 'react';
import React, { useState } from 'react';
import { connect } from 'react-redux';
import { compose } from 'redux';
import _uniqueId from 'lodash/uniqueId';
Expand All @@ -11,7 +11,7 @@ const getSchema = (props) => {
};

const Edit = (props) => {
const [state, setState] = useState({
const [state] = useState({
schema: getSchema({ ...props, providerUrl: settings.providerUrl }),
id: _uniqueId('block_'),
});
Expand Down
10 changes: 6 additions & 4 deletions src/components/manage/Blocks/SiteBlocks/Header/View.jsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
import React, { useState, useEffect, useRef } from 'react';
import React from 'react';
import { compose } from 'redux';
import { connect } from 'react-redux';
import { Tab, Dropdown, Table } from 'semantic-ui-react';
import { Dropdown } from 'semantic-ui-react';
import QueryBuilder from '../QueryBuilder';
import { setQueryParam, deleteQueryParam } from '@eeacms/volto-datablocks/actions';
import cx from 'classnames';
import {
setQueryParam,
deleteQueryParam,
} from '@eeacms/volto-datablocks/actions';
import './style.css';

const View = (props) => {
Expand Down
12 changes: 4 additions & 8 deletions src/components/manage/Blocks/SiteBlocks/LcpDetails/View.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,15 @@ import { compose } from 'redux';
import { connect } from 'react-redux';
import ReactTooltip from 'react-tooltip';
import { Link } from 'react-router-dom';
import { setQueryParam, deleteQueryParam } from '@eeacms/volto-datablocks/actions';
import Icon from '@plone/volto/components/theme/Icon/Icon';
import infoSVG from '@plone/volto/icons/info.svg';
import CompetentAuthority from '../CompetentAuthority';
import { getDate } from '../helpers';
import cx from 'classnames';
import {
setQueryParam,
deleteQueryParam,
} from '@eeacms/volto-datablocks/actions';
import './style.css';

const View = (props) => {
const {
siteInspireId = null,
facilityInspireId = null,
installationInspireId = null,
lcpInspireId = null,
siteReportingYear = null,
} = props.discodata_query.search;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,12 @@ const PermitingAuthority = (props) => {
<div>
<div className={cx('header-tooltip', 'mb-1')}>
<h3 className="blue">Permiting Authority</h3>
<span className="floating-icon" data-tip={'This is a tooltip'}>
<span
className="floating-icon"
data-tip={
'Authority, body or bodies responsible for issuing a permit to a given facility'
}
>
<Icon
className="firefox-icon"
name={infoSVG}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@ import React from 'react';
import { compose } from 'redux';
import { connect } from 'react-redux';
import ReactTooltip from 'react-tooltip';
import { setQueryParam, deleteQueryParam } from '@eeacms/volto-datablocks/actions';
import {
setQueryParam,
deleteQueryParam,
} from '@eeacms/volto-datablocks/actions';
import Icon from '@plone/volto/components/theme/Icon/Icon';
import infoSVG from '@plone/volto/icons/info.svg';
import CompetentAuthority from '../CompetentAuthority';
Expand Down Expand Up @@ -59,7 +62,7 @@ const View = (props) => {
{facility[0]?.facilityIndustrialActivity}{' '}
{facility[0]?.facilityMainActivity}
</span>
<span
{/* <span
className="floating-icon"
data-tip={'This is a tooltip 2'}
>
Expand All @@ -69,7 +72,7 @@ const View = (props) => {
size="20"
color="#D63D27"
/>
</span>
</span> */}
</p>
</div>
) : (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@ import { useHistory } from 'react-router-dom';
import { compose } from 'redux';
import { connect } from 'react-redux';
import ReactTooltip from 'react-tooltip';
import { setQueryParam, deleteQueryParam } from '@eeacms/volto-datablocks/actions';
import {
setQueryParam,
deleteQueryParam,
} from '@eeacms/volto-datablocks/actions';
import _uniqueId from 'lodash/uniqueId';
import Icon from '@plone/volto/components/theme/Icon/Icon';
import CompetentAuthority from '../CompetentAuthority';
Expand Down Expand Up @@ -62,9 +65,10 @@ const View = (props) => {
site.eprtrReportingYear
? 'xs-6 sm-6 md-6 lg-6'
: 'xs-12 sm-12 md-12 lg-12',
'mb-0',
)}
>
<span
{/* <span
className="floating-icon"
data-tip={'This is a tooltip'}
>
Expand All @@ -74,14 +78,18 @@ const View = (props) => {
size="20"
color="#fff"
/>
</span>
</span> */}
<p className="lighter mb-0">Last report was submitted on:</p>
<p className="bold">{getDate(site.authLastUpdated)}</p>
<p className="bold" style={{ marginBottom: '0' }}>
{getDate(site.authLastUpdated)}
</p>
</div>
{site.eprtrReportingYear ? (
<div className="xs-6 sm-6 md-6 lg-6">
<p className="lighter mb-0">EPRTR reporting year</p>
<p className="bold">{site.eprtrReportingYear}</p>
<p className="bold" style={{ marginBottom: '0' }}>
{site.eprtrReportingYear}
</p>
</div>
) : (
''
Expand Down
Original file line number Diff line number Diff line change
@@ -1,21 +1,19 @@
import React, { useState, useEffect } from 'react';
import { useHistory } from 'react-router-dom';
import React, { useState } from 'react';
import { compose } from 'redux';
import { connect } from 'react-redux';
import ReactTooltip from 'react-tooltip';
import { setQueryParam, deleteQueryParam } from '@eeacms/volto-datablocks/actions';
import _uniqueId from 'lodash/uniqueId';
import {
setQueryParam,
deleteQueryParam,
} from '@eeacms/volto-datablocks/actions';
import Icon from '@plone/volto/components/theme/Icon/Icon';
import RenderTable from '../RenderTable';
import PermitingAuthority from '../PermitingAuthority';
import moment from 'moment';
import cx from 'classnames';
import { getDate, getLonLat } from '../helpers';
import { getDate } from '../helpers';
import infoSVG from '@plone/volto/icons/info.svg';
import './style.css';

const View = (props) => {
const history = useHistory();
const [aels, setAels] = useState(false);
const {
siteInspireId = null,
Expand Down Expand Up @@ -79,7 +77,12 @@ const View = (props) => {
{/* BAT CONCLUSION */}
<div className={cx('header-tooltip', 'mb-1')}>
<h3 className="blue">BAT conclusions</h3>
<span className="floating-icon" data-tip={'This is a tooltip'}>
<span
className="floating-icon"
data-tip={
'Number of individual conclusions that indicate which techniques or combinations of techniques are BAT for achieving a specific environmental objective'
}
>
<Icon
className="firefox-icon"
name={infoSVG}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { useState, useEffect } from 'react';
import React, { useState } from 'react';
import { connect } from 'react-redux';
import { compose } from 'redux';
import _uniqueId from 'lodash/uniqueId';
Expand All @@ -11,7 +11,7 @@ const getSchema = (props) => {
};

const Edit = (props) => {
const [state, setState] = useState({
const [state] = useState({
schema: getSchema({ ...props, providerUrl: settings.providerUrl }),
id: _uniqueId('block_'),
});
Expand Down
Original file line number Diff line number Diff line change
@@ -1,21 +1,19 @@
import React, { useState, useEffect } from 'react';
import { useHistory } from 'react-router-dom';
import React, { useState } from 'react';
import { compose } from 'redux';
import { connect } from 'react-redux';
import ReactTooltip from 'react-tooltip';
import { setQueryParam, deleteQueryParam } from '@eeacms/volto-datablocks/actions';
import _uniqueId from 'lodash/uniqueId';
import {
setQueryParam,
deleteQueryParam,
} from '@eeacms/volto-datablocks/actions';
import Icon from '@plone/volto/components/theme/Icon/Icon';
import RenderTable from '../RenderTable';
import PermitingAuthority from '../PermitingAuthority';
import moment from 'moment';
import cx from 'classnames';
import { getDate, getLonLat } from '../helpers';
import { getDate } from '../helpers';
import infoSVG from '@plone/volto/icons/info.svg';
import './style.css';

const View = (props) => {
const history = useHistory();
const [aels, setAels] = useState(false);
const {
siteInspireId = null,
Expand Down Expand Up @@ -67,7 +65,12 @@ const View = (props) => {
{/* ABOUT THE ENTITY */}
<div className={cx('header-tooltip', 'mb-1')}>
<h3 className="blue">About the entity</h3>
<span className="floating-icon" data-tip={'This is a tooltip'}>
<span
className="floating-icon"
data-tip={
'Information regarding the facilities included in the industrial site'
}
>
<Icon
className="firefox-icon"
name={infoSVG}
Expand Down Expand Up @@ -97,7 +100,12 @@ const View = (props) => {
{/* BAT CONCLUSION */}
<div className={cx('header-tooltip', 'mb-1')}>
<h3 className="blue">BAT conclusions</h3>
<span className="floating-icon" data-tip={'This is a tooltip'}>
<span
className="floating-icon"
data-tip={
'Number of individual conclusions that indicate which techniques or combinations of techniques are BAT for achieving a specific environmental objective'
}
>
<Icon
className="firefox-icon"
name={infoSVG}
Expand Down
4 changes: 3 additions & 1 deletion theme/site/globals/site.overrides
Original file line number Diff line number Diff line change
Expand Up @@ -1636,7 +1636,9 @@ b {
border-radius: 10px;
p {
color: #fff;
margin-bottom: 0.5em !important;
&:not(:last-child) {
margin-bottom: 0.5em !important;
}
}
.floating-icon {
position: absolute;
Expand Down

0 comments on commit afa335b

Please sign in to comment.