@opexa/portal-components 0.0.158 → 0.0.159
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/NewsFeed/News.d.ts +6 -0
- package/dist/components/NewsFeed/News.js +9 -0
- package/dist/components/NewsFeed/NewsFeedCarousel.d.ts +2 -2
- package/dist/components/NewsFeed/NewsFeedCarousel.js +2 -4
- package/dist/components/NewsFeed/NewsFeedList.d.ts +2 -2
- package/dist/components/NewsFeed/NewsFeedList.js +2 -6
- package/dist/components/Promos/Cashback.js +1 -1
- package/dist/components/Promos/CustomPromo.js +1 -1
- package/dist/components/Promos/Promo.js +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import Image from 'next/image';
|
|
3
|
+
import Link from 'next/link';
|
|
4
|
+
import { Button } from '../../ui/Button/index.js';
|
|
5
|
+
export function News({ news, viewDetailsUrl }) {
|
|
6
|
+
return (_jsxs("div", { className: "bg-bg-primary-alt border-border-primary flex flex-col overflow-hidden rounded-2xl border shadow-md", children: [_jsx(Image, { src: news.image, alt: "", width: 400, height: 274, loading: "lazy", unoptimized: true, className: "block h-[15.25rem] w-full object-cover" }), _jsxs("div", { className: "flex grow flex-col p-3xl", children: [_jsxs("div", { className: "grow", children: [_jsx("p", { className: "text-brand-400 text-sm font-semibold", children: news.category }), _jsx("h2", { className: "mt-2 line-clamp-1 text-lg font-semibold", children: news.title }), _jsx("p", { className: "text-text-tertiary-600 mt-xs line-clamp-3", dangerouslySetInnerHTML: {
|
|
7
|
+
__html: news.content,
|
|
8
|
+
} })] }), _jsx(Button, { asChild: true, className: "mt-2xl", children: _jsx(Link, { href: `${viewDetailsUrl}/${news.id}`, "aria-label": `Read more about ${news.title}`, children: "Read More" }) })] })] }, news.id));
|
|
9
|
+
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { type CSSProperties } from 'react';
|
|
2
|
-
import type { News } from '../../types';
|
|
2
|
+
import type { News as TNews } from '../../types';
|
|
3
3
|
export interface NewsFeedCarouselProps {
|
|
4
4
|
layout: 'carousel';
|
|
5
|
-
newsFeed:
|
|
5
|
+
newsFeed: TNews[];
|
|
6
6
|
/** @default 'News' */
|
|
7
7
|
heading?: string;
|
|
8
8
|
/** @default '/news' */
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
3
|
import useEmblaCarousel, {} from 'embla-carousel-react';
|
|
4
|
-
import Image from 'next/image';
|
|
5
4
|
import Link from 'next/link';
|
|
6
5
|
import { useCallback, useEffect, useState } from 'react';
|
|
7
6
|
import { twMerge } from 'tailwind-merge';
|
|
@@ -11,6 +10,7 @@ import { ChevronRightIcon } from '../../icons/ChevronRightIcon.js';
|
|
|
11
10
|
import { Tv03Icon } from '../../icons/Tv03Icon.js';
|
|
12
11
|
import { Button } from '../../ui/Button/index.js';
|
|
13
12
|
import { Empty } from '../shared/Empty.js';
|
|
13
|
+
import { News } from './News.js';
|
|
14
14
|
export function NewsFeedCarousel(props) {
|
|
15
15
|
const empty = props.newsFeed.length <= 0;
|
|
16
16
|
const heading = props.heading ?? 'News';
|
|
@@ -41,7 +41,5 @@ export function NewsFeedCarousel(props) {
|
|
|
41
41
|
onSelect(emblaApi);
|
|
42
42
|
emblaApi.on('reInit', onSelect).on('select', onSelect);
|
|
43
43
|
}, [emblaApi, onSelect]);
|
|
44
|
-
return (_jsxs("div", { style: props.style, className: props.className, children: [_jsxs("div", { className: "flex items-center", children: [_jsx("h2", { className: "text-lg font-semibold", children: heading }), _jsx("div", { className: "grow" }), _jsxs("div", { className: "flex items-center justify-center gap-xl", children: [_jsxs(Link, { href: viewAllUrl, className: "text-button-tertiary-fg flex gap-sm text-sm font-semibold", children: ["See All", _jsx(ChevronRightIcon, { className: "size-5 lg:hidden" })] }), _jsxs("div", { className: "hidden lg:flex", children: [_jsx(Button, { variant: "outline", colorScheme: "gray", className: "rounded-r-none border-r-0", onClick: onPrevButtonClick, disabled: prevBtnDisabled, "aria-label": "Previous", children: _jsx(ArrowLeftIcon, { className: "size-5" }) }), _jsx(Button, { variant: "outline", colorScheme: "gray", className: "rounded-l-none", onClick: onNextButtonClick, disabled: nextBtnDisabled, "aria-label": "Next", children: _jsx(ArrowRightIcon, { className: "size-5" }) })] })] })] }), empty && (_jsx(Empty, { icon: Tv03Icon, title: "No News", message: "No news is currently available.", className: "mt-8" })), !empty && (_jsx(_Fragment, { children: _jsx("div", { ref: emblaRef, className: "relative mt-lg lg:overflow-hidden", children: _jsx("div", { className: twMerge('grid auto-cols-[100%] grid-flow-col gap-1.5 lg:auto-cols-[calc((100%-(1.25rem*2))/3)] lg:gap-2xl'), children: props.newsFeed.map((news) => (
|
|
45
|
-
__html: news.content,
|
|
46
|
-
} })] }), _jsx(Button, { asChild: true, className: "mt-2xl", children: _jsx(Link, { href: `${viewDetailsUrl}/${news.id}`, children: "Read More" }) })] })] }, news.id))) }) }) }))] }));
|
|
44
|
+
return (_jsxs("div", { style: props.style, className: props.className, children: [_jsxs("div", { className: "flex items-center", children: [_jsx("h2", { className: "text-lg font-semibold", children: heading }), _jsx("div", { className: "grow" }), _jsxs("div", { className: "flex items-center justify-center gap-xl", children: [_jsxs(Link, { href: viewAllUrl, className: "text-button-tertiary-fg flex gap-sm text-sm font-semibold", children: ["See All", _jsx(ChevronRightIcon, { className: "size-5 lg:hidden" })] }), _jsxs("div", { className: "hidden lg:flex", children: [_jsx(Button, { variant: "outline", colorScheme: "gray", className: "rounded-r-none border-r-0", onClick: onPrevButtonClick, disabled: prevBtnDisabled, "aria-label": "Previous", children: _jsx(ArrowLeftIcon, { className: "size-5" }) }), _jsx(Button, { variant: "outline", colorScheme: "gray", className: "rounded-l-none", onClick: onNextButtonClick, disabled: nextBtnDisabled, "aria-label": "Next", children: _jsx(ArrowRightIcon, { className: "size-5" }) })] })] })] }), empty && (_jsx(Empty, { icon: Tv03Icon, title: "No News", message: "No news is currently available.", className: "mt-8" })), !empty && (_jsx(_Fragment, { children: _jsx("div", { ref: emblaRef, className: "relative mt-lg lg:overflow-hidden", children: _jsx("div", { className: twMerge('grid auto-cols-[100%] grid-flow-col gap-1.5 lg:auto-cols-[calc((100%-(1.25rem*2))/3)] lg:gap-2xl'), children: props.newsFeed.map((news) => (_jsx(News, { news: news, viewDetailsUrl: viewDetailsUrl }, news.id))) }) }) }))] }));
|
|
47
45
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { CSSProperties } from 'react';
|
|
2
|
-
import type { News } from '../../types';
|
|
2
|
+
import type { News as TNews } from '../../types';
|
|
3
3
|
export interface NewsFeedListProps {
|
|
4
4
|
layout: 'list';
|
|
5
|
-
newsFeed:
|
|
5
|
+
newsFeed: TNews[];
|
|
6
6
|
/** @default 'News' */
|
|
7
7
|
heading?: string;
|
|
8
8
|
/**
|
|
@@ -1,14 +1,10 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import Image from 'next/image';
|
|
3
|
-
import Link from 'next/link';
|
|
4
2
|
import { Tv03Icon } from '../../icons/Tv03Icon.js';
|
|
5
|
-
import { Button } from '../../ui/Button/index.js';
|
|
6
3
|
import { Empty } from '../shared/Empty.js';
|
|
4
|
+
import { News } from './News.js';
|
|
7
5
|
export function NewsFeedList(props) {
|
|
8
6
|
const empty = props.newsFeed.length <= 0;
|
|
9
7
|
const heading = props.heading ?? 'News';
|
|
10
8
|
const viewDetailsUrl = props.viewDetailsUrl ?? '/news';
|
|
11
|
-
return (_jsxs("div", { style: props.style, className: props.className, children: [_jsx("h2", { className: "text-lg font-semibold", children: heading }), empty && (_jsx(Empty, { icon: Tv03Icon, title: "No News", message: "No news is currently available.", className: "mt-8" })), !empty && (_jsx("div", { className: "mt-lg grid gap-3xl lg:grid-cols-3 lg:gap-2xl", children: props.newsFeed.map((news) => (
|
|
12
|
-
__html: news.content,
|
|
13
|
-
} })] }), _jsx(Button, { asChild: true, className: "mt-2xl", children: _jsx(Link, { href: `${viewDetailsUrl}/${news.id}`, children: "Read More" }) })] })] }, news.id))) }))] }));
|
|
9
|
+
return (_jsxs("div", { style: props.style, className: props.className, children: [_jsx("h2", { className: "text-lg font-semibold", children: heading }), empty && (_jsx(Empty, { icon: Tv03Icon, title: "No News", message: "No news is currently available.", className: "mt-8" })), !empty && (_jsx("div", { className: "mt-lg grid gap-3xl lg:grid-cols-3 lg:gap-2xl", children: props.newsFeed.map((news) => (_jsx(News, { news: news, viewDetailsUrl: viewDetailsUrl }, news.id))) }))] }));
|
|
14
10
|
}
|
|
@@ -14,5 +14,5 @@ export function Cashback({ data, viewDetailsUrl }) {
|
|
|
14
14
|
return (_jsxs("div", { className: "border-border-secondary bg-accent-50 bg-bg-primary-alt relative flex h-full flex-col overflow-hidden rounded-2xl border", children: [data.banner.url && (_jsx(Image, { src: data.banner.url, alt: data.name, width: 400, height: 202, loading: "lazy", unoptimized: true, className: "block aspect-[365/180] w-full object-cover" })), _jsxs("div", { className: "flex flex-grow flex-col px-4 pb-3xl pt-2xl", children: [_jsx("div", { className: "w-full grow text-center text-xl font-semibold", children: data.name }), _jsxs("div", { className: "mt-auto flex flex-col gap-3 pt-4 lg:flex-row", children: [claimable && (_jsx(Button, { size: "sm", onClick: () => {
|
|
15
15
|
globalStore.depositWithdrawal.setOpen(true);
|
|
16
16
|
globalStore.depositWithdrawal.setPromo(data.id);
|
|
17
|
-
}, children: "Get bonus" })), _jsx(Button, { size: "sm", variant: "outline", asChild: true, children: _jsx(Link, { href: `${viewDetailsUrl}/${data.id}`, children: "Read more" }) })] })] })] }));
|
|
17
|
+
}, children: "Get bonus" })), _jsx(Button, { size: "sm", variant: "outline", asChild: true, children: _jsx(Link, { href: `${viewDetailsUrl}/${data.id}`, "aria-label": `Read more about ${data.name}`, children: "Read more" }) })] })] })] }));
|
|
18
18
|
}
|
|
@@ -3,5 +3,5 @@ import Image from 'next/image';
|
|
|
3
3
|
import Link from 'next/link';
|
|
4
4
|
import { Button } from '../../ui/Button/index.js';
|
|
5
5
|
export function CustomPromo({ data, viewDetailsUrl }) {
|
|
6
|
-
return (_jsxs("div", { className: "border-border-secondary bg-accent-50 bg-bg-primary-alt relative flex h-full flex-col overflow-hidden rounded-2xl border", children: [_jsx(Image, { src: data.banner, alt: data.name, width: 400, height: 202, loading: "lazy", unoptimized: true, className: "block aspect-[365/180] w-full object-cover" }), _jsxs("div", { className: "flex flex-grow flex-col px-4 pb-3xl pt-2xl", children: [_jsx("div", { className: "w-full grow text-center text-xl font-semibold", children: data.name }), _jsx("div", { className: "mt-auto flex flex-col gap-3 pt-4 lg:flex-row", children: _jsx(Button, { size: "sm", variant: "outline", asChild: true, children: _jsx(Link, { href: `${viewDetailsUrl}/${data.id}`, children: "Read more" }) }) })] })] }));
|
|
6
|
+
return (_jsxs("div", { className: "border-border-secondary bg-accent-50 bg-bg-primary-alt relative flex h-full flex-col overflow-hidden rounded-2xl border", children: [_jsx(Image, { src: data.banner, alt: data.name, width: 400, height: 202, loading: "lazy", unoptimized: true, className: "block aspect-[365/180] w-full object-cover" }), _jsxs("div", { className: "flex flex-grow flex-col px-4 pb-3xl pt-2xl", children: [_jsx("div", { className: "w-full grow text-center text-xl font-semibold", children: data.name }), _jsx("div", { className: "mt-auto flex flex-col gap-3 pt-4 lg:flex-row", children: _jsx(Button, { size: "sm", variant: "outline", asChild: true, children: _jsx(Link, { href: `${viewDetailsUrl}/${data.id}`, "aria-label": `Read more about ${data.name}`, children: "Read more" }) }) })] })] }));
|
|
7
7
|
}
|
|
@@ -14,5 +14,5 @@ export function Promo({ data, viewDetailsUrl }) {
|
|
|
14
14
|
return (_jsxs("div", { className: "border-border-secondary bg-accent-50 bg-bg-primary-alt relative flex h-full flex-col overflow-hidden rounded-2xl border", children: [data.banner.url && (_jsx(Image, { src: data.banner.url, alt: data.name, width: 400, height: 202, loading: "lazy", unoptimized: true, className: "block aspect-[365/180] w-full object-cover" })), _jsxs("div", { className: "flex flex-grow flex-col px-4 pb-3xl pt-2xl", children: [_jsx("div", { className: "w-full grow text-center text-xl font-semibold", children: data.name }), _jsxs("div", { className: "mt-auto flex flex-col gap-3 pt-4 lg:flex-row", children: [claimable && (_jsx(Button, { size: "sm", onClick: () => {
|
|
15
15
|
globalStore.depositWithdrawal.setOpen(true);
|
|
16
16
|
globalStore.depositWithdrawal.setPromo(data.id);
|
|
17
|
-
}, children: "Get bonus" })), _jsx(Button, { size: "sm", variant: "outline", asChild: true, children: _jsx(Link, { href: `${viewDetailsUrl}/${data.id}`, children: "Read more" }) })] })] })] }));
|
|
17
|
+
}, children: "Get bonus" })), _jsx(Button, { size: "sm", variant: "outline", asChild: true, children: _jsx(Link, { href: `${viewDetailsUrl}/${data.id}`, "aria-label": `Read more about ${data.name}`, children: "Read more" }) })] })] })] }));
|
|
18
18
|
}
|