|
@@ -44,6 +44,33 @@ const ActivityModal = () => {
|
|
|
console.log("activityContent", activityContent);
|
|
|
|
|
|
const hasBackgroundImage = !!activityContent?.backgroundImage;
|
|
|
+ const hasBackgroundImageLink = !!activityContent?.backgroundImageLink;
|
|
|
+
|
|
|
+ const CardContent = () => (
|
|
|
+ <div
|
|
|
+ className="bg-cover bg-center rounded-lg px-6 pb-6 pt-16 max-w-sm w-full mx-4 overflow-hidden"
|
|
|
+ style={{
|
|
|
+ backgroundImage: `url('${activityContent.backgroundImage}')`,
|
|
|
+ width: "80vw",
|
|
|
+ minHeight: "50vh",
|
|
|
+ backgroundPosition: "top center",
|
|
|
+ }}
|
|
|
+ >
|
|
|
+ <div className="relative z-10 text-white">
|
|
|
+ <div className="flex flex-col items-center mb-4 relative w-full">
|
|
|
+ <div
|
|
|
+ className="text-xl font-bold w-full text-center"
|
|
|
+ dangerouslySetInnerHTML={{ __html: activityContent.title }}
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+ <div
|
|
|
+ className="overflow-y-auto"
|
|
|
+ style={{ maxHeight: "calc(50vh - 100px)" }}
|
|
|
+ dangerouslySetInnerHTML={{ __html: activityContent.content }}
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ );
|
|
|
|
|
|
return (
|
|
|
<>
|
|
@@ -56,30 +83,17 @@ const ActivityModal = () => {
|
|
|
>
|
|
|
<X size={24} />
|
|
|
</button>
|
|
|
-
|
|
|
- <div
|
|
|
- className="bg-cover bg-center rounded-lg px-6 pb-6 pt-16 max-w-sm w-full mx-4 overflow-hidden"
|
|
|
- style={{
|
|
|
- backgroundImage: `url('${activityContent.backgroundImage}')`,
|
|
|
- width: "80vw",
|
|
|
- minHeight: "50vh",
|
|
|
- backgroundPosition: "top center",
|
|
|
- }}
|
|
|
- >
|
|
|
- <div className="relative z-10 text-white">
|
|
|
- <div className="flex flex-col items-center mb-4 relative w-full">
|
|
|
- <div
|
|
|
- className="text-xl font-bold w-full text-center"
|
|
|
- dangerouslySetInnerHTML={{ __html: activityContent.title }}
|
|
|
- ></div>
|
|
|
- </div>
|
|
|
- <div
|
|
|
- className="overflow-y-auto"
|
|
|
- style={{ maxHeight: "calc(50vh - 100px)" }}
|
|
|
- dangerouslySetInnerHTML={{ __html: activityContent.content }}
|
|
|
- />
|
|
|
- </div>
|
|
|
- </div>
|
|
|
+ {hasBackgroundImageLink ? (
|
|
|
+ <a
|
|
|
+ href={activityContent.backgroundImageLink}
|
|
|
+ target="_blank"
|
|
|
+ rel="noopener noreferrer"
|
|
|
+ >
|
|
|
+ <CardContent />
|
|
|
+ </a>
|
|
|
+ ) : (
|
|
|
+ <CardContent />
|
|
|
+ )}
|
|
|
</div>
|
|
|
</div>
|
|
|
) : (
|