PluginProbe
Extendify / 3.1.5
Extendify v3.1.5
3.2.0 3.1.6 3.1.5 3.1.4 3.1.3 3.1.2 3.1.1 3.1.0 3.0.6 3.0.5 3.0.4 trunk 0.1.0 0.10.0 0.10.1 0.10.2 0.11.0 0.11.1 0.2.0 0.3.0 0.3.1 0.4.0 0.5.0 0.6.0 0.7.0 All 126 releases
extendify / src / Notifications / templates / Card.jsx

Card.jsx in Extendify 3.1.5, at src/Notifications/templates/Card.jsx

40 lines 1.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 import { DismissButton } from '../DismissButton';
2 import { externalLinkProps } from '../notification-link';
3
4 export const Card = ({ notification, href, external, onDismiss, onClick }) => {
5 const { title, content, image } = notification;
6 const ctaLabel = notification['cta-label'];
7
8 return (
9 <div
10 className="relative h-full min-h-32 w-full rounded-sm border border-[#d1d5db] bg-white px-5 py-5 text-base text-gray-900 lg:px-8 lg:py-6"
11 data-test="notification-card"
12 >
13 <DismissButton
14 onClick={onDismiss}
15 size={32}
16 className="absolute right-0 top-0 flex h-8 w-8 items-center justify-center rounded-bl rounded-se bg-[#f3f4f6] p-1.5 text-center text-gray-900 hover:bg-[#d1d5db] rtl:left-0 rtl:right-auto rtl:rounded-bl-none rtl:rounded-br"
17 />
18 <div className="flex flex-col items-start gap-4">
19 {image && (
20 <img src={image} alt="" className="max-h-8 w-auto rounded-xs" />
21 )}
22 <div>
23 <div className="text-lg font-semibold">{title}</div>
24 <div className="mt-1 text-sm">{content}</div>
25 </div>
26 {ctaLabel && href && (
27 <a
28 href={href}
29 {...externalLinkProps(external)}
30 onClick={onClick}
31 className="inline-flex h-10 cursor-pointer items-center rounded-xs bg-design-main px-4 text-sm text-design-text no-underline hover:opacity-90"
32 >
33 {ctaLabel}
34 </a>
35 )}
36 </div>
37 </div>
38 );
39 };
40