Skip to content

Commit

Permalink
Merge pull request #433 from GatherPress/GP-432
Browse files Browse the repository at this point in the history
Added tooltip feature and tooltip to Online event block.
  • Loading branch information
mauteri authored Nov 27, 2023
2 parents f22724b + 06d2842 commit 0d06d3a
Show file tree
Hide file tree
Showing 14 changed files with 51 additions and 13 deletions.
2 changes: 1 addition & 1 deletion build/blocks/online-event/index.asset.php
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<?php return array('dependencies' => array('react', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-data', 'wp-element', 'wp-i18n'), 'version' => '1b76f3a1f111f2172711');
<?php return array('dependencies' => array('react', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-data', 'wp-element', 'wp-i18n'), 'version' => 'b66f96ca40ae99db9eb5');
2 changes: 1 addition & 1 deletion build/blocks/online-event/index.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion build/blocks/online-event/online-event.asset.php
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<?php return array('dependencies' => array('react', 'wp-components', 'wp-data', 'wp-dom-ready', 'wp-element', 'wp-i18n'), 'version' => '90ace17fa428328cb014');
<?php return array('dependencies' => array('react', 'wp-components', 'wp-data', 'wp-dom-ready', 'wp-element', 'wp-i18n'), 'version' => '4ad7014b0fafccb1931a');
2 changes: 1 addition & 1 deletion build/blocks/online-event/online-event.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion build/blocks/online-event/style-index.css
Original file line number Diff line number Diff line change
@@ -1 +1 @@

.gp-tooltip{border-bottom:1px dotted}
2 changes: 1 addition & 1 deletion build/blocks/venue/index.asset.php
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<?php return array('dependencies' => array('moment', 'react', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-data', 'wp-element', 'wp-i18n'), 'version' => '847746449816417b7f5e');
<?php return array('dependencies' => array('moment', 'react', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-data', 'wp-element', 'wp-i18n'), 'version' => '608bb08a9858c1be6bd0');
2 changes: 1 addition & 1 deletion build/blocks/venue/index.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion build/blocks/venue/venue.asset.php
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<?php return array('dependencies' => array('react', 'wp-components', 'wp-data', 'wp-dom-ready', 'wp-element', 'wp-i18n'), 'version' => 'ea7c2e6e3047c25484de');
<?php return array('dependencies' => array('react', 'wp-components', 'wp-data', 'wp-dom-ready', 'wp-element', 'wp-i18n'), 'version' => '67c19f3b3b0e6b2b4a1a');
2 changes: 1 addition & 1 deletion build/blocks/venue/venue.js

Large diffs are not rendered by default.

17 changes: 16 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@
"lodash": "^4.17.21",
"moment": "^2.29.4",
"playwright": "^1.40.0",
"react-modal": "^3.16.1"
"react-modal": "^3.16.1",
"react-tooltip": "^5.24.0"
}
}
3 changes: 3 additions & 0 deletions src/blocks/_tooltip.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.gp-tooltip {
border-bottom: 1px dotted;
}
1 change: 1 addition & 0 deletions src/blocks/online-event/style.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@import "../tooltip";
22 changes: 20 additions & 2 deletions src/components/OnlineEvent.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/**
* External dependencies.
*/
import { Tooltip } from 'react-tooltip';
/**
* WordPress dependencies.
*/
Expand All @@ -6,7 +10,7 @@ import { Flex, FlexItem, Icon } from '@wordpress/components';
import { useState } from '@wordpress/element';

/**
* Internal dependencies
* Internal dependencies.
*/
import { Listener } from '../helpers/broadcasting';
import { getFromGlobal } from '../helpers/globals';
Expand All @@ -25,7 +29,21 @@ const OnlineEvent = ({ onlineEventLinkDefault = '' }) => {
<Icon icon="video-alt2" />
</FlexItem>
<FlexItem>
{!onlineEventLink && <span>{text}</span>}
{!onlineEventLink && (
<>
<span
className="gp-tooltip"
data-tooltip-id="gp-online-event"
data-tooltip-content={__(
'Link active during event.',
'gatherpress'
)}
>
{text}
</span>
<Tooltip id="gp-online-event" />
</>
)}
{onlineEventLink && (
<a href={onlineEventLink} rel="noreferrer" target="_blank">
{text}
Expand Down

0 comments on commit 0d06d3a

Please sign in to comment.