Skip to content

Commit

Permalink
Sync branch [skip ci]
Browse files Browse the repository at this point in the history
  • Loading branch information
pirate-bot authored Oct 30, 2023
2 parents f4d1981 + 163a53f commit e85808e
Show file tree
Hide file tree
Showing 17 changed files with 507 additions and 3 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
##### [Version 3.7.3](https://github.com/Codeinwp/neve/compare/v3.7.2...v3.7.3) (2023-10-23)

### New Features
- **Black Friday Preparations**: Get ready for exciting Black Friday updates and offers!

### Improvements
- **Update Google Fonts**: Get the freshest updates from the public font library from Google.

##### [Version 3.7.2](https://github.com/Codeinwp/neve/compare/v3.7.1...v3.7.2) (2023-10-05)

### Bug Fixes
Expand Down
13 changes: 13 additions & 0 deletions assets/apps/customizer-controls/src/@types/utils.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,19 @@ declare global {
nonce: string;
hideConditionalHeaderSelector: boolean;
dashUpdatesMessage: string;
deal?: {
active?: boolean;
dealSlug?: string;
urgencyText?: string;
remaningTime?: string;
bannerUrl?: string;
customizerBannerUrl?: string;
linkDashboard?: string;
linkGlobal?: string;
linkCustomizer?: string;
customizerBannerAlt?: string;
bannerAlt?: string;
};
};
NeveProReactCustomize: undefined | StringObjectKeys;
}
Expand Down
25 changes: 25 additions & 0 deletions assets/apps/customizer-controls/src/builder-upsell/Upsells.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,31 @@ const Upsells: React.FC<Props> = ({ control }) => {
const { params } = control;
const { title, url } = params;

if (window?.NeveReactCustomize?.deal?.active) {
return (
<div className="upsell-inner">
<a
href={window?.NeveReactCustomize?.deal?.linkCustomizer}
target="_blank"
rel="external noreferrer noopener"
style={{ width: '100%', lineHeight: '0' }}
>
<img
src={
window?.NeveReactCustomize?.deal
?.customizerBannerUrl
}
alt={
window?.NeveReactCustomize?.deal
?.customizerBannerAlt
}
style={{ width: '100%' }}
/>
</a>
</div>
);
}

return (
<div className="upsell-inner">
{title && (
Expand Down
2 changes: 2 additions & 0 deletions assets/apps/dashboard/src/Components/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { fetchOptions } from '../utils/rest';
import { withDispatch, withSelect } from '@wordpress/data';
import { compose } from '@wordpress/compose';
import { useState, Fragment, useEffect } from '@wordpress/element';
import Deal from './Deal';

const App = ({ setSettings, toast, currentTab, setTab }) => {
const [loading, setLoading] = useState(true);
Expand All @@ -27,6 +28,7 @@ const App = ({ setSettings, toast, currentTab, setTab }) => {
<div className="content-wrap">
<div className="container content">
<div className="main">
<Deal />
{'starter-sites' !== currentTab && <Notifications />}
<TabsContent currentTab={currentTab} setTab={setTab} />
</div>
Expand Down
25 changes: 25 additions & 0 deletions assets/apps/dashboard/src/Components/Deal.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/* global neveDash */

const Deal = () => {
if (!Boolean(window.neveDash?.deal?.active)) {
return <></>;
}

return (
<div className="nv-deal">
<a
href={neveDash?.deal?.linkDashboard}
target="_blank"
rel="external noreferrer noopener"
>
<img
src={neveDash?.deal?.bannerUrl}
alt={neveDash?.deal?.bannerAlt}
/>
<div className="nv-urgency">{neveDash?.deal?.urgencyText}</div>
</a>
</div>
);
};

export default Deal;
43 changes: 43 additions & 0 deletions assets/apps/dashboard/src/scss/content/_start.scss
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,46 @@
}
}
}

.nv-deal {
margin-bottom: 10px;
display: flex;

a {
position: relative;
width: 100%;
}

img {
width: 100%;
}

.nv-urgency {
position: absolute;

top: 10%;
left: 2.7%;

color: #FFF;
font-family: -apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", sans-serif;
font-size: 14px;
font-style: normal;
font-weight: 700;
line-height: normal;
letter-spacing: 0.3px;
text-transform: uppercase;
}
}

@media(max-width: 480px) {
.nv-deal .nv-urgency {
font-size: 7px;
}
}

@media (min-width: 481px) and (max-width: 1024px) {
.nv-deal .nv-urgency {
font-size: 10px;
}
}

Binary file added assets/img/dashboard/black-friday-banner.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* @package Neve
*/

define( 'NEVE_VERSION', '3.7.2' );
define( 'NEVE_VERSION', '3.7.3' );
define( 'NEVE_INC_DIR', trailingslashit( get_template_directory() ) . 'inc/' );
define( 'NEVE_ASSETS_URL', trailingslashit( get_template_directory_uri() ) . 'assets/' );
define( 'NEVE_MAIN_DIR', get_template_directory() . '/' );
Expand Down
5 changes: 5 additions & 0 deletions inc/admin/dashboard/main.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

namespace Neve\Admin\Dashboard;

use Neve\Core\Limited_Offers;
use Neve\Core\Theme_Info;
/**
* Class Main
Expand Down Expand Up @@ -315,6 +316,9 @@ public function enqueue() {
* @return array
*/
private function get_localization() {

$offer = new Limited_Offers();

$old_about_config = apply_filters( 'ti_about_config_filter', [ 'useful_plugins' => true ] );
$theme_name = apply_filters( 'ti_wl_theme_name', $this->theme_args['name'] );
$plugin_name = apply_filters( 'ti_wl_plugin_name', 'Neve Pro' );
Expand Down Expand Up @@ -376,6 +380,7 @@ private function get_localization() {
'getPluginStateBaseURL' => esc_url( rest_url( '/nv/v1/dashboard/plugin-state/' ) ),
'canInstallPlugins' => current_user_can( 'install_plugins' ),
'canActivatePlugins' => current_user_can( 'activate_plugins' ),
'deal' => ! defined( 'NEVE_PRO_VERSION' ) ? $offer->get_localized_data() : array(),
];

if ( defined( 'NEVE_PRO_PATH' ) ) {
Expand Down
8 changes: 8 additions & 0 deletions inc/core/admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,14 @@ function () {

add_action( 'rest_api_init', [ $this, 'register_rest_routes' ] );
add_filter( 'neve_pro_react_controls_localization', [ $this, 'adapt_conditional_headers' ] );


if ( ! defined( 'NEVE_PRO_VERSION' ) ) {
$offer = new Limited_Offers();
if ( $offer->can_show_dashboard_banner() && $offer->is_active() ) {
$offer->load_dashboard_hooks();
}
}
}

/**
Expand Down
Loading

0 comments on commit e85808e

Please sign in to comment.