Skip to content

Commit 57b62e6

Browse files
committed
chore: bit Social promotional banner updated
New product nav button hide option added
1 parent 1f91041 commit 57b62e6

File tree

12 files changed

+71
-22
lines changed

12 files changed

+71
-22
lines changed

backend/app/Config.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class Config
2121

2222
public const VAR_PREFIX = 'bit_smtp_';
2323

24-
public const VERSION = '1.1.5';
24+
public const VERSION = '1.1.6';
2525

2626
public const DB_VERSION = '1.0';
2727

backend/app/HTTP/Controllers/SMTPController.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,4 +55,16 @@ public function sendTestEmail(MailTestRequest $request)
5555
return Response::error($error);
5656
}
5757
}
58+
59+
public function newProductNavBtnVisibleCheck()
60+
{
61+
$data = get_option(Config::VAR_PREFIX . 'new_product_nav_btn_hide');
62+
63+
return (bool) ($data);
64+
}
65+
66+
public function newProductNavBtnHide()
67+
{
68+
update_option(Config::VAR_PREFIX . 'new_product_nav_btn_hide', true);
69+
}
5870
}

backend/hooks/ajax.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,6 @@
1414
Route::post('send_test_mail', [SMTPController::class, 'sendTestEmail']);
1515
Route::post('telemetry_permission_handle', [TelemetryPopupController::class, 'handleTelemetryPermission']);
1616
Route::get('telemetry_popup_disable_check', [TelemetryPopupController::class, 'isPopupDisabled']);
17+
Route::get('new_product_nav_btn_visible_check', [SMTPController::class, 'newProductNavBtnVisibleCheck']);
18+
Route::post('hide_new_product_nav_btn', [SMTPController::class, 'newProductNavBtnHide']);
1719
})->middleware('nonce:admin');

bit_smtp.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* Plugin Name: BIT SMTP
55
* Plugin URI: https://www.bitapps.pro/bit-smtp
66
* Description: Send email via SMTP using BIT SMTP plugin by Bit Apps
7-
* Version: 1.1.5
7+
* Version: 1.1.6
88
* Author: Bit Apps
99
* Author URI: https://bitapps.pro
1010
* Text Domain: bit-smtp

frontend/src/components/TelemetryPopup/TelemetryPopup.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import type React from 'react'
55
import { useState } from 'react'
66
import request from '@common/helpers/request'
7-
import exclusiveEarlyBirdOffer from '@resource/img/exclusiveEarlyBirdOffer.jpg'
7+
import exclusiveEarlyBirdOffer from '@resource/img/exclusiveEarlyBirdOffer.png'
88
import { Modal as AntModal, Button, Popconfirm, Steps } from 'antd'
99
import changeLogs from '../../changeLogs'
1010
import cls from './TelemetryPopup.module.css'

frontend/src/pages/Homepage/SMTP.tsx

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -241,14 +241,13 @@ export default function SMTP() {
241241
/>
242242
</div>
243243
</div>
244-
245-
<Button type="submit" className={cls.btn}>
246-
Save Changes
247-
</Button>
248244
</>
249245
)}
250-
<Toaster />
246+
<Button type="submit" className={cls.btn}>
247+
Save Changes
248+
</Button>
251249
</form>
250+
<Toaster />
252251
</div>
253252

254253
{isTelemetryModalOpen ? (

frontend/src/pages/Layout/Layout.module.css

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,3 +203,9 @@ input[type='password']:focus {
203203
.footerBtn a:focus {
204204
box-shadow: none;
205205
}
206+
207+
.footerBtn .skipNewProductBtn {
208+
border: none;
209+
background: none;
210+
cursor: pointer;
211+
}

frontend/src/pages/Layout/Layout.tsx

Lines changed: 38 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,17 @@
11
/* eslint-disable @typescript-eslint/no-explicit-any */
2-
import { useState } from 'react'
2+
import { useEffect, useState } from 'react'
33
import { NavLink, Outlet } from 'react-router-dom'
4+
import request from '@common/helpers/request'
45
import Logo from '@resource/img/bitSmtpLogo.svg'
5-
import exclusiveEarlyBirdOffer from '@resource/img/exclusiveEarlyBirdOffer.jpg'
6+
import exclusiveEarlyBirdOffer from '@resource/img/exclusiveEarlyBirdOffer.png'
67
import { Layout as AntLayout, Modal } from 'antd'
78
// eslint-disable-next-line import/no-extraneous-dependencies
89
import confetti from 'canvas-confetti'
910
import cls from './Layout.module.css'
1011

1112
function Header() {
1213
const [isModalOpen, setIsModalOpen] = useState(false)
14+
const [hideNewProductBtn, setHideNewProductBtn] = useState(false)
1315

1416
const handleConfetti = () => {
1517
confetti({
@@ -43,6 +45,20 @@ function Header() {
4345
color: isActive ? '#fff' : ''
4446
})
4547

48+
useEffect(() => {
49+
request('new_product_nav_btn_visible_check', null, null, 'GET').then((res: any) => {
50+
if (res.data) {
51+
setHideNewProductBtn(true)
52+
}
53+
})
54+
}, [])
55+
56+
const handleNewProductNavBtn = () => {
57+
request('hide_new_product_nav_btn')
58+
setHideNewProductBtn(true)
59+
setIsModalOpen(false)
60+
}
61+
4662
return (
4763
<div className={cls.layout}>
4864
<div className={cls.topbar}>
@@ -66,15 +82,19 @@ function Header() {
6682
</NavLink>
6783
))}
6884
</div>
69-
<div className={cls.bitSocialMenu}>
70-
<button type="button" onClick={() => showModal()} className={cls.btn}>
71-
New Product Launch
72-
<span className={cls.star} />
73-
<span className={cls.star} />
74-
<span className={cls.star} />
75-
<span className={cls.star} />
76-
</button>
77-
</div>
85+
{!hideNewProductBtn ? (
86+
<div className={cls.bitSocialMenu}>
87+
<button type="button" onClick={() => showModal()} className={cls.btn}>
88+
New Product Launch
89+
<span className={cls.star} />
90+
<span className={cls.star} />
91+
<span className={cls.star} />
92+
<span className={cls.star} />
93+
</button>
94+
</div>
95+
) : (
96+
''
97+
)}
7898
</div>
7999

80100
<Modal
@@ -100,6 +120,13 @@ function Header() {
100120
>
101121
{`Grab It Before It's Gone!`}
102122
</a>
123+
<button
124+
type="button"
125+
className={cls.skipNewProductBtn}
126+
onClick={() => handleNewProductNavBtn()}
127+
>
128+
Don&apos;t show it again
129+
</button>
103130
</div>
104131
</Modal>
105132
</div>

frontend/src/pages/Others/Others.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import bitAssistLogo from '@resource/img/bitAssist.svg'
22
import bitFileManagerLogo from '@resource/img/bitFileManager.svg'
33
import bitFormLogo from '@resource/img/bitForm.svg'
44
import bitIntegrationsLogo from '@resource/img/bitIntegrations.svg'
5-
import exclusiveEarlyBirdOffer from '@resource/img/exclusiveEarlyBirdOffer.jpg'
5+
import exclusiveEarlyBirdOffer from '@resource/img/exclusiveEarlyBirdOffer.png'
66
import { Button, Card } from 'antd'
77
import cls from './Others.module.css'
88

-297 KB
Binary file not shown.

0 commit comments

Comments
 (0)