Skip to content

Commit

Permalink
chore: bit Social promotional banner updated
Browse files Browse the repository at this point in the history
New product nav button hide option added
  • Loading branch information
MdSoikot committed Dec 1, 2024
1 parent 1f91041 commit 57b62e6
Show file tree
Hide file tree
Showing 12 changed files with 71 additions and 22 deletions.
2 changes: 1 addition & 1 deletion backend/app/Config.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class Config

public const VAR_PREFIX = 'bit_smtp_';

public const VERSION = '1.1.5';
public const VERSION = '1.1.6';

public const DB_VERSION = '1.0';

Expand Down
12 changes: 12 additions & 0 deletions backend/app/HTTP/Controllers/SMTPController.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,4 +55,16 @@ public function sendTestEmail(MailTestRequest $request)
return Response::error($error);
}
}

public function newProductNavBtnVisibleCheck()
{
$data = get_option(Config::VAR_PREFIX . 'new_product_nav_btn_hide');

return (bool) ($data);
}

public function newProductNavBtnHide()
{
update_option(Config::VAR_PREFIX . 'new_product_nav_btn_hide', true);
}
}
2 changes: 2 additions & 0 deletions backend/hooks/ajax.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,6 @@
Route::post('send_test_mail', [SMTPController::class, 'sendTestEmail']);
Route::post('telemetry_permission_handle', [TelemetryPopupController::class, 'handleTelemetryPermission']);
Route::get('telemetry_popup_disable_check', [TelemetryPopupController::class, 'isPopupDisabled']);
Route::get('new_product_nav_btn_visible_check', [SMTPController::class, 'newProductNavBtnVisibleCheck']);
Route::post('hide_new_product_nav_btn', [SMTPController::class, 'newProductNavBtnHide']);
})->middleware('nonce:admin');
2 changes: 1 addition & 1 deletion bit_smtp.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* Plugin Name: BIT SMTP
* Plugin URI: https://www.bitapps.pro/bit-smtp
* Description: Send email via SMTP using BIT SMTP plugin by Bit Apps
* Version: 1.1.5
* Version: 1.1.6
* Author: Bit Apps
* Author URI: https://bitapps.pro
* Text Domain: bit-smtp
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/TelemetryPopup/TelemetryPopup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import type React from 'react'
import { useState } from 'react'
import request from '@common/helpers/request'
import exclusiveEarlyBirdOffer from '@resource/img/exclusiveEarlyBirdOffer.jpg'
import exclusiveEarlyBirdOffer from '@resource/img/exclusiveEarlyBirdOffer.png'
import { Modal as AntModal, Button, Popconfirm, Steps } from 'antd'
import changeLogs from '../../changeLogs'
import cls from './TelemetryPopup.module.css'
Expand Down
9 changes: 4 additions & 5 deletions frontend/src/pages/Homepage/SMTP.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -241,14 +241,13 @@ export default function SMTP() {
/>
</div>
</div>

<Button type="submit" className={cls.btn}>
Save Changes
</Button>
</>
)}
<Toaster />
<Button type="submit" className={cls.btn}>
Save Changes
</Button>
</form>
<Toaster />
</div>

{isTelemetryModalOpen ? (
Expand Down
6 changes: 6 additions & 0 deletions frontend/src/pages/Layout/Layout.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -203,3 +203,9 @@ input[type='password']:focus {
.footerBtn a:focus {
box-shadow: none;
}

.footerBtn .skipNewProductBtn {
border: none;
background: none;
cursor: pointer;
}
49 changes: 38 additions & 11 deletions frontend/src/pages/Layout/Layout.tsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
/* eslint-disable @typescript-eslint/no-explicit-any */
import { useState } from 'react'
import { useEffect, useState } from 'react'
import { NavLink, Outlet } from 'react-router-dom'
import request from '@common/helpers/request'
import Logo from '@resource/img/bitSmtpLogo.svg'
import exclusiveEarlyBirdOffer from '@resource/img/exclusiveEarlyBirdOffer.jpg'
import exclusiveEarlyBirdOffer from '@resource/img/exclusiveEarlyBirdOffer.png'
import { Layout as AntLayout, Modal } from 'antd'
// eslint-disable-next-line import/no-extraneous-dependencies
import confetti from 'canvas-confetti'
import cls from './Layout.module.css'

function Header() {
const [isModalOpen, setIsModalOpen] = useState(false)
const [hideNewProductBtn, setHideNewProductBtn] = useState(false)

const handleConfetti = () => {
confetti({
Expand Down Expand Up @@ -43,6 +45,20 @@ function Header() {
color: isActive ? '#fff' : ''
})

useEffect(() => {
request('new_product_nav_btn_visible_check', null, null, 'GET').then((res: any) => {
if (res.data) {
setHideNewProductBtn(true)
}
})
}, [])

const handleNewProductNavBtn = () => {
request('hide_new_product_nav_btn')
setHideNewProductBtn(true)
setIsModalOpen(false)
}

return (
<div className={cls.layout}>
<div className={cls.topbar}>
Expand All @@ -66,15 +82,19 @@ function Header() {
</NavLink>
))}
</div>
<div className={cls.bitSocialMenu}>
<button type="button" onClick={() => showModal()} className={cls.btn}>
New Product Launch
<span className={cls.star} />
<span className={cls.star} />
<span className={cls.star} />
<span className={cls.star} />
</button>
</div>
{!hideNewProductBtn ? (
<div className={cls.bitSocialMenu}>
<button type="button" onClick={() => showModal()} className={cls.btn}>
New Product Launch
<span className={cls.star} />
<span className={cls.star} />
<span className={cls.star} />
<span className={cls.star} />
</button>
</div>
) : (
''
)}
</div>

<Modal
Expand All @@ -100,6 +120,13 @@ function Header() {
>
{`Grab It Before It's Gone!`}
</a>
<button
type="button"
className={cls.skipNewProductBtn}
onClick={() => handleNewProductNavBtn()}
>
Don&apos;t show it again
</button>
</div>
</Modal>
</div>
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/pages/Others/Others.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import bitAssistLogo from '@resource/img/bitAssist.svg'
import bitFileManagerLogo from '@resource/img/bitFileManager.svg'
import bitFormLogo from '@resource/img/bitForm.svg'
import bitIntegrationsLogo from '@resource/img/bitIntegrations.svg'
import exclusiveEarlyBirdOffer from '@resource/img/exclusiveEarlyBirdOffer.jpg'
import exclusiveEarlyBirdOffer from '@resource/img/exclusiveEarlyBirdOffer.png'
import { Button, Card } from 'antd'
import cls from './Others.module.css'

Expand Down
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 5 additions & 2 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
Contributors: bitpressadmin
Tags: smtp, wp mail smtp, gmail smtp, sendgrid smtp, phpmailer
Requires at least: 5.0
Tested up to: 6.6
Tested up to: 6.7.1
Requires PHP: 7.4
Stable tag: 1.1.5
Stable tag: 1.1.6
License: GPLv2 or later

Enable SMTP plugin to authenticate mail service of your site by configuring SMTP server of your desired mail service.
Expand Down Expand Up @@ -241,6 +241,9 @@ Yes, possible to send WordPress emails using Hotmail.

== Changelog ==

= 1.1.6 (01 Dec, 2024) =
* Bit Social promotional banner updated

= 1.1.5 (05 Nov, 2024) =
* Plugin deletion issue fixed

Expand Down

0 comments on commit 57b62e6

Please sign in to comment.