1.0.5 • Published 10 months ago

@wpmudev/shared-notifications-discount v1.0.5

Weekly downloads
-
License
GPL-3.0
Repository
github
Last release
10 months ago

License: GPLv3 npm

Discount Notification

This package works as a Shared Module between WPMU DEV plugins and it allows us to notify users about an special price for our products.

Installation

npm i @wpmudev/shared-notifications-discount --save-dev

Usage

Javascript Instantiation

import React from 'react';
import { NoticeDiscount } from '@wpmudev/shared-notifications-discount';

import image1x from './sample-image.png';
import image2x from './sample-image@2x.png';

const MyApp = () => {
    return (
        <NoticeDiscount
            price={65}
            discount={20}
            priceLabel="Pay Only"
            priceTime="month"
            title="Don't Miss Out On Subscription / Recurring Payment Support"
            image={ image1x }
            imageRetina={ image2x }
            disclaimer="Only admin users can see this message"
            buttonLabel="Get 20% Off Forminator Pro"
            buttonLink="https://premium.wpmudev.com/"
        >
            <p>We'd hate for free users to miss out on Subscription / Recurring Payment Support, so we're temporarily slashing the price of Forminator Pro.</p>
        </NoticeDiscount>
    );
}

Properties

Prop NameTypeDescription
pricestringSet the base price to promote.
discountstringEnter the amount to be discounted in percentage from price.
priceLabelstringHighlight promotional price with catchy text.
priceTimestringBy default it is set to month for montly payments.
title*stringSet a catchy title for notification.
imagestringWhen not empty, allows you to show an image at left of the main content.
imageRetinastringMake sure image shows up correctly on bigger displays.
disclaimerstringThis text goes below content in smaller size to highlight it from the rest.
buttonLabelstringSets call to action button label.
buttonLinkstringSets call to action button URL.