Skip to content

Commit 0452b54

Browse files
Merge branch 'development' into fix/issue-1520
2 parents 83f32a3 + e4672e5 commit 0452b54

File tree

10 files changed

+162
-12
lines changed

10 files changed

+162
-12
lines changed

assets/js/build/about/about.js.map

Lines changed: 0 additions & 1 deletion
This file was deleted.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
<?php return array('dependencies' => array('wp-api', 'wp-block-editor', 'wp-components', 'wp-compose', 'wp-data', 'wp-edit-post', 'wp-element', 'wp-hooks', 'wp-plugins'), 'version' => '131069a497e8cc50cb69');
1+
<?php return array('dependencies' => array('wp-api', 'wp-block-editor', 'wp-components', 'wp-compose', 'wp-data', 'wp-edit-post', 'wp-element', 'wp-hooks', 'wp-plugins'), 'version' => '280d8027ed53a2483fb9');

assets/js/build/promos/index.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

assets/js/build/promos/index.js.map

Lines changed: 0 additions & 1 deletion
This file was deleted.

assets/js/build/promos/style-index.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

assets/js/build/promos/style-index.css.map

Lines changed: 0 additions & 1 deletion
This file was deleted.

assets/js/src/OptimoleNotice/style.scss

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -280,3 +280,24 @@
280280
padding: 0 10px 0 0;
281281
}
282282
}
283+
.ti-sdk-neve-fse-notice {
284+
position: relative;
285+
padding: 10px;
286+
287+
.neve-fse-notice-actions {
288+
display: flex;
289+
gap: 10px;
290+
291+
a {
292+
text-decoration: none;
293+
span:not(.dashicons) {
294+
text-decoration: underline;
295+
}
296+
}
297+
}
298+
299+
p {
300+
padding: 0 10px 0 0;
301+
font-size: 14px;
302+
}
303+
}

assets/js/src/index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
import './otter.js';
22
import './optimole.js';
3-
import './rop.js';
3+
import './rop.js';
4+
import './neve-fse.js';

assets/js/src/neve-fse.js

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
import { Fragment, render, useState } from '@wordpress/element';
2+
import { Button } from '@wordpress/components';
3+
import useSettings from './common/useSettings';
4+
5+
const NeveFSENotice = ({ onDismiss = () => {} }) => {
6+
const [getOption, updateOption] = useSettings();
7+
8+
const dismissNotice = async () => {
9+
const newValue = { ...window.themeisleSDKPromotions.option };
10+
newValue['neve-fse-themes-popular'] = new Date().getTime() / 1000 | 0;
11+
window.themeisleSDKPromotions.option = newValue;
12+
await updateOption( window.themeisleSDKPromotions.optionKey, JSON.stringify( newValue ) );
13+
14+
if ( onDismiss ) {
15+
onDismiss();
16+
}
17+
};
18+
19+
const { neveFSEMoreUrl } = window.themeisleSDKPromotions;
20+
21+
return (
22+
<Fragment>
23+
<Button
24+
onClick={ dismissNotice }
25+
className="notice-dismiss">
26+
<span className="screen-reader-text">Dismiss this notice.</span>
27+
</Button>
28+
29+
<p>Meet <b>Neve FSE</b> from the makes of { window.themeisleSDKPromotions.product }. A theme that makes full site editing on WordPress straightforward and user-friendly.</p>
30+
31+
<div className="neve-fse-notice-actions">
32+
<Button
33+
variant="link"
34+
target="_blank"
35+
href={ neveFSEMoreUrl }
36+
>
37+
<span className="dashicons dashicons-external"/>
38+
<span>Learn more</span>
39+
</Button>
40+
</div>
41+
</Fragment>
42+
);
43+
};
44+
45+
class NeveFSE {
46+
constructor() {
47+
const {showPromotion, debug} = window.themeisleSDKPromotions;
48+
this.promo = showPromotion;
49+
this.debug = debug === '1';
50+
this.domRef = null;
51+
52+
this.run();
53+
}
54+
55+
run() {
56+
if ( window.themeisleSDKPromotions.option['neve-fse-themes-popular'] ) {
57+
return;
58+
}
59+
60+
const root = document.querySelector( '#ti-neve-fse-notice' );
61+
62+
if ( !root ) {
63+
return;
64+
}
65+
66+
render(
67+
<NeveFSENotice
68+
onDismiss={() => {
69+
root.style.display = 'none';
70+
}}
71+
/>,
72+
root
73+
);
74+
}
75+
}
76+
77+
new NeveFSE();

0 commit comments

Comments
 (0)