mirror of
https://github.com/labring/FastGPT.git
synced 2025-12-25 20:02:47 +00:00
modal
This commit is contained in:
parent
60d042a0cf
commit
fa4c28db98
|
|
@ -3,7 +3,8 @@ export enum SystemConfigsTypeEnum {
|
|||
fastgptPro = 'fastgptPro',
|
||||
systemMsgModal = 'systemMsgModal',
|
||||
license = 'license',
|
||||
operationalAd = 'operationalAd'
|
||||
operationalAd = 'operationalAd',
|
||||
activityAd = 'activityAd'
|
||||
}
|
||||
|
||||
export const SystemConfigsTypeMap = {
|
||||
|
|
@ -21,5 +22,8 @@ export const SystemConfigsTypeMap = {
|
|||
},
|
||||
[SystemConfigsTypeEnum.operationalAd]: {
|
||||
label: 'operationalAd'
|
||||
},
|
||||
[SystemConfigsTypeEnum.activityAd]: {
|
||||
label: 'activityAd'
|
||||
}
|
||||
};
|
||||
|
|
|
|||
|
|
@ -8,7 +8,17 @@ import { imageBaseUrl } from '@fastgpt/global/common/file/image/constants';
|
|||
|
||||
export const useUploadAvatar = (
|
||||
api: (params: { filename: string }) => Promise<CreatePostPresignedUrlResult>,
|
||||
{ onSuccess }: { onSuccess?: (avatar: string) => void } = {}
|
||||
{
|
||||
onSuccess,
|
||||
maxW = 300,
|
||||
maxH = 300,
|
||||
maxSize = 1024 * 500 // 500KB
|
||||
}: {
|
||||
onSuccess?: (avatar: string) => void;
|
||||
maxW?: number;
|
||||
maxH?: number;
|
||||
maxSize?: number;
|
||||
} = {}
|
||||
) => {
|
||||
const { toast } = useToast();
|
||||
const { t } = useTranslation();
|
||||
|
|
@ -32,8 +42,9 @@ export const useUploadAvatar = (
|
|||
const compressed = base64ToFile(
|
||||
await compressBase64Img({
|
||||
base64Img: await fileToBase64(file),
|
||||
maxW: 300,
|
||||
maxH: 300
|
||||
maxW,
|
||||
maxH,
|
||||
maxSize
|
||||
}),
|
||||
file.name
|
||||
);
|
||||
|
|
|
|||
|
|
@ -98,6 +98,10 @@
|
|||
"Warning": "Warning",
|
||||
"Website": "Website",
|
||||
"action_confirm": "Confirm",
|
||||
"activity_ad.desc": "You can get up to 1.66 million additional points by recharging, and you can get new points at the old price of the annual package.",
|
||||
"activity_ad.join_now": "Participate now",
|
||||
"activity_ad.later": "wait a moment",
|
||||
"activity_ad.title": "Double Festival Gift · Limited Time Upgrade",
|
||||
"add_new": "add_new",
|
||||
"add_new_param": "Add new param",
|
||||
"add_success": "Added Successfully",
|
||||
|
|
|
|||
|
|
@ -99,6 +99,10 @@
|
|||
"Warning": "警告",
|
||||
"Website": "网站",
|
||||
"action_confirm": "操作确认",
|
||||
"activity_ad.desc": "充值最高可得额外166万积分,年费套餐旧价享新量",
|
||||
"activity_ad.join_now": "立即参与",
|
||||
"activity_ad.later": "稍等一会儿",
|
||||
"activity_ad.title": "双节献礼 · 限时升级",
|
||||
"add_new": "新增",
|
||||
"add_new_param": "新增参数",
|
||||
"add_success": "添加成功",
|
||||
|
|
|
|||
|
|
@ -98,6 +98,10 @@
|
|||
"Warning": "警告",
|
||||
"Website": "網站",
|
||||
"action_confirm": "確認",
|
||||
"activity_ad.desc": "充值最高可得額外166萬積分,年費套餐舊價享新量",
|
||||
"activity_ad.join_now": "立即參與",
|
||||
"activity_ad.later": "稍等一會兒",
|
||||
"activity_ad.title": "雙節獻禮 · 限時升級",
|
||||
"add_new": "新增",
|
||||
"add_new_param": "新增參數",
|
||||
"add_success": "新增成功",
|
||||
|
|
|
|||
|
|
@ -0,0 +1,3 @@
|
|||
<svg width="27" height="28" viewBox="0 0 27 28" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M6.62226 -2.00591C6.23794 -1.79022 5.95648 -1.43496 5.83917 -1.01752L4.96831 1.85934L2.0224 1.00889C1.80798 0.943838 1.58239 0.921415 1.35895 0.942944C1.13551 0.964473 0.91876 1.02952 0.721498 1.13423C0.427919 1.2902 0.188641 1.52812 0.0342524 1.81759C-0.120136 2.10705 -0.182618 2.4349 -0.145207 2.75922C-0.107796 3.08355 0.0278096 3.38961 0.244271 3.63827C0.460734 3.88694 0.748218 4.06691 1.06997 4.15519L4.95928 5.27799L8.02483 10.7845L1.82406 10.5278L-1.60572 7.39941C-1.76707 7.2523 -1.95652 7.13767 -2.16324 7.06205C-2.36996 6.98644 -2.5899 6.95133 -2.81052 6.95873C-3.03114 6.96612 -3.2481 7.01588 -3.44902 7.10516C-3.64995 7.19444 -3.83089 7.3215 -3.98154 7.47907C-4.13218 7.63664 -4.24957 7.82165 -4.32699 8.02352C-4.40442 8.2254 -4.44038 8.44019 -4.4328 8.65563C-4.42523 8.87108 -4.37427 9.08296 -4.28285 9.27917C-4.19143 9.47538 -4.06132 9.65209 -3.89997 9.79921L-1.24539 12.2195L-3.72375 14.8118C-4.02798 15.1301 -4.19031 15.5533 -4.17501 15.9884C-4.15972 16.4235 -3.96805 16.8349 -3.64218 17.132C-3.31631 17.4291 -2.88293 17.5876 -2.43738 17.5727C-1.99183 17.5577 -1.5706 17.3706 -1.26636 17.0523L1.83225 13.8097L8.04926 14.0687L4.89153 19.305L0.420006 20.0815C-0.0189056 20.1578 -0.408794 20.4013 -0.663889 20.7583C-0.790198 20.9351 -0.879614 21.1345 -0.927029 21.345C-0.974445 21.5555 -0.978932 21.7731 -0.940233 21.9854C-0.901536 22.1976 -0.820411 22.4003 -0.701492 22.5819C-0.582571 22.7636 -0.428188 22.9205 -0.24715 23.0439C0.11847 23.293 0.570451 23.3901 1.00936 23.3137L4.5848 22.692L5.22145 26.1837C5.26012 26.3959 5.34122 26.5987 5.46013 26.7803C5.57903 26.962 5.73342 27.119 5.91447 27.2423C6.09551 27.3657 6.29967 27.4531 6.51529 27.4994C6.7309 27.5457 6.95375 27.5501 7.1711 27.5123C7.38845 27.4745 7.59605 27.3953 7.78204 27.2791C7.96803 27.163 8.12877 27.0122 8.25508 26.8353C8.38139 26.6585 8.47079 26.4591 8.51818 26.2486C8.56557 26.038 8.57003 25.8204 8.53129 25.6081L7.70753 21.0961L10.8584 15.8744L13.924 21.3809L12.7742 25.1791C12.7065 25.3871 12.682 25.6062 12.7021 25.8236C12.7222 26.041 12.7865 26.2523 12.8912 26.4451C12.996 26.638 13.1391 26.8084 13.3122 26.9466C13.4852 27.0847 13.6848 27.1877 13.8991 27.2496C14.1135 27.3115 14.3383 27.331 14.5605 27.307C14.7826 27.2829 14.9977 27.2158 15.1929 27.1096C15.3882 27.0034 15.5598 26.8602 15.6977 26.6884C15.8356 26.5167 15.937 26.3197 15.996 26.1092L16.8669 23.2323L19.8128 24.0828C20.0258 24.1489 20.2502 24.1729 20.4728 24.1532C20.6955 24.1336 20.9118 24.0708 21.1093 23.9685C21.3067 23.8662 21.4813 23.7265 21.6227 23.5575C21.7642 23.3884 21.8697 23.1936 21.9331 22.9842C21.9964 22.7749 22.0164 22.5553 21.9918 22.3384C21.9672 22.1214 21.8985 21.9115 21.7897 21.7208C21.6809 21.5301 21.5343 21.3625 21.3584 21.2278C21.1825 21.0931 20.9808 20.9941 20.7652 20.9365L16.8759 19.8137L13.8104 14.3071L20.0112 14.5638L23.4409 17.6922C23.6023 17.8394 23.7917 17.9541 23.9985 18.0298C24.2052 18.1054 24.4252 18.1406 24.6458 18.1332C24.8665 18.1258 25.0835 18.0761 25.2844 17.9868C25.4854 17.8975 25.6664 17.7704 25.817 17.6128C25.9677 17.4553 26.0851 17.2702 26.1625 17.0683C26.2399 16.8664 26.2759 16.6516 26.2683 16.4361C26.2607 16.2206 26.2097 16.0087 26.1182 15.8125C26.0268 15.6163 25.8966 15.4396 25.7352 15.2925L23.0806 12.8722L25.559 10.2798C25.7097 10.1223 25.8271 9.93724 25.9046 9.73535C25.9821 9.53346 26.018 9.31864 26.0105 9.10316C26.0029 8.88769 25.952 8.67577 25.8606 8.47952C25.7691 8.28328 25.639 8.10654 25.4777 7.9594C25.3163 7.81227 25.1268 7.69762 24.92 7.62201C24.7133 7.5464 24.4933 7.5113 24.2727 7.51872C24.052 7.52614 23.835 7.57594 23.6341 7.66527C23.4331 7.7546 23.2522 7.8817 23.1016 8.03933L20.003 11.282L13.786 11.023L16.9437 5.7867L21.4152 5.01018C21.6326 4.97243 21.8402 4.89323 22.0262 4.77711C22.2122 4.66099 22.373 4.51022 22.4993 4.33342C22.6257 4.15662 22.7151 3.95724 22.7626 3.74667C22.81 3.53611 22.8145 3.31848 22.7758 3.10622C22.7371 2.89396 22.6559 2.69122 22.537 2.50959C22.418 2.32795 22.2636 2.17098 22.0826 2.04763C21.9015 1.92429 21.6973 1.83698 21.4817 1.7907C21.266 1.74442 21.0432 1.74008 20.8258 1.77792L17.2504 2.39965L16.6138 -1.09199C16.5356 -1.52062 16.2863 -1.90137 15.9207 -2.15048C15.5551 -2.3996 15.1031 -2.49667 14.6642 -2.42035C14.2253 -2.34403 13.8354 -2.10056 13.5803 -1.74351C13.3252 -1.38646 13.2258 -0.945071 13.3039 -0.516447L14.1277 3.99557L10.9768 9.21726L7.91123 3.71074L9.06098 -0.0874187C9.16328 -0.402515 9.16573 -0.740436 9.06802 -1.05692C8.97031 -1.3734 8.77699 -1.65368 8.51339 -1.86104C8.2498 -2.06841 7.92821 -2.19319 7.59076 -2.21903C7.25331 -2.24488 6.91574 -2.1706 6.62226 -2.00591Z" fill="white" fill-opacity="0.2"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 4.6 KiB |
|
|
@ -0,0 +1,3 @@
|
|||
<svg xmlns="http://www.w3.org/2000/svg" width="23" height="24" viewBox="0 0 23 24" fill="none">
|
||||
<path d="M15.3871 0.000406097C15.0178 0.0095006 14.667 0.170233 14.4109 0.44759L12.6008 2.33317L10.7906 0.44759C10.6602 0.30789 10.5041 0.196845 10.3318 0.121017C10.1594 0.0451883 9.97422 0.00611411 9.78712 0.00610271C9.50861 0.0061789 9.23645 0.0927728 9.00544 0.254814C8.77443 0.416854 8.59506 0.646979 8.49026 0.915768C8.38546 1.18456 8.35999 1.47979 8.41712 1.76374C8.47424 2.04768 8.61136 2.30742 8.81095 2.50976L11.2008 4.99919V10.5705L6.76564 7.79907L5.5297 3.93392C5.47153 3.75213 5.37955 3.58406 5.25902 3.4393C5.1385 3.29454 4.99178 3.17593 4.82724 3.09024C4.66271 3.00454 4.48358 2.95344 4.30009 2.93986C4.1166 2.92627 3.93234 2.95047 3.75782 3.01107C3.58331 3.07166 3.42196 3.16747 3.28299 3.29302C3.14402 3.41857 3.03015 3.5714 2.94789 3.74279C2.86562 3.91418 2.81657 4.10077 2.80353 4.29191C2.79048 4.48304 2.81371 4.67498 2.87189 4.85677L3.82892 7.84749L0.957823 8.8444C0.605375 8.96678 0.314032 9.22999 0.147887 9.57612C-0.0182588 9.92226 -0.0455975 10.323 0.0718851 10.6901C0.189368 11.0572 0.442048 11.3607 0.774339 11.5338C1.10663 11.7069 1.49131 11.7353 1.84376 11.613L5.43399 10.3654L9.88009 13.1453L5.43399 15.9253L1.84376 14.6777C1.49131 14.5554 1.10663 14.5838 0.774339 14.7569C0.609805 14.8426 0.463086 14.9612 0.342559 15.106C0.222032 15.2507 0.130057 15.4188 0.0718851 15.6006C0.0137136 15.7824 -0.00951502 15.9743 0.00352535 16.1654C0.0165657 16.3566 0.0656195 16.5432 0.147886 16.7146C0.314032 17.0607 0.605375 17.3239 0.957823 17.4463L3.82892 18.4432L2.87189 21.4339C2.81368 21.6157 2.79042 21.8077 2.80343 21.9988C2.81645 22.19 2.86549 22.3766 2.94775 22.548C3.03001 22.7194 3.14389 22.8723 3.28287 22.9979C3.42185 23.1234 3.58321 23.2193 3.75774 23.2799C3.93228 23.3405 4.11656 23.3647 4.30008 23.3511C4.48359 23.3375 4.66273 23.2864 4.82728 23.2006C4.99182 23.1149 5.13854 22.9963 5.25907 22.8515C5.37959 22.7067 5.47155 22.5386 5.5297 22.3568L6.76564 18.4916L11.2008 15.7202V21.2915L8.81095 23.7809C8.67658 23.9153 8.56931 24.0763 8.49541 24.2544C8.42151 24.4325 8.38247 24.6241 8.38058 24.8182C8.37868 25.0122 8.41397 25.2046 8.48437 25.3843C8.55478 25.5639 8.65889 25.7271 8.7906 25.8643C8.92231 26.0015 9.07897 26.1099 9.25142 26.1833C9.42387 26.2566 9.60863 26.2934 9.79489 26.2914C9.98115 26.2894 10.1652 26.2488 10.3361 26.1718C10.5071 26.0948 10.6616 25.9831 10.7906 25.8431L12.6008 23.9575L14.4109 25.8431C14.5399 25.9831 14.6945 26.0948 14.8654 26.1718C15.0364 26.2488 15.2204 26.2894 15.4067 26.2914C15.5929 26.2934 15.7777 26.2566 15.9502 26.1833C16.1226 26.1099 16.2793 26.0015 16.411 25.8643C16.5427 25.7271 16.6468 25.5639 16.7172 25.3843C16.7876 25.2046 16.8229 25.0122 16.821 24.8182C16.8191 24.6241 16.7801 24.4325 16.7062 24.2544C16.6323 24.0763 16.525 23.9153 16.3906 23.7809L14.0008 21.2915V15.7202L18.4359 18.4916L19.6719 22.3568C19.73 22.5386 19.822 22.7067 19.9425 22.8515C20.063 22.9963 20.2097 23.115 20.3743 23.2007C20.5388 23.2864 20.718 23.3375 20.9015 23.3511C21.085 23.3647 21.2693 23.3405 21.4439 23.2799C21.6184 23.2193 21.7798 23.1235 21.9188 22.9979C22.0577 22.8724 22.1716 22.7195 22.2539 22.5481C22.3361 22.3766 22.3852 22.19 22.3982 21.9988C22.4112 21.8077 22.3879 21.6157 22.3297 21.4339L21.3727 18.4432L24.2438 17.4463C24.4183 17.3857 24.5797 17.2899 24.7187 17.1644C24.8577 17.0389 24.9716 16.886 25.0539 16.7146C25.1362 16.5432 25.1853 16.3566 25.1984 16.1654C25.2114 15.9743 25.1882 15.7823 25.13 15.6005C25.0718 15.4187 24.9798 15.2506 24.8593 15.1058C24.7387 14.961 24.592 14.8424 24.4274 14.7567C24.2628 14.671 24.0837 14.62 23.9002 14.6064C23.7166 14.5928 23.5323 14.6171 23.3578 14.6777L19.7676 15.9253L15.3215 13.1453L19.7676 10.3654L23.3578 11.613C23.5323 11.6736 23.7166 11.6978 23.9001 11.6843C24.0837 11.6707 24.2628 11.6196 24.4274 11.5339C24.5919 11.4483 24.7387 11.3296 24.8592 11.1849C24.9798 11.0401 25.0718 10.872 25.13 10.6902C25.1881 10.5084 25.2114 10.3164 25.1983 10.1253C25.1853 9.9341 25.1362 9.74749 25.0539 9.57608C24.9716 9.40468 24.8577 9.25184 24.7187 9.1263C24.5797 9.00076 24.4183 8.90497 24.2438 8.8444L21.3727 7.84749L22.3297 4.85677C22.4472 4.48964 22.4198 4.08893 22.2537 3.74279C22.0875 3.39665 21.7962 3.13344 21.4438 3.01107C21.0913 2.88869 20.7066 2.91717 20.3743 3.09023C20.042 3.2633 19.7894 3.56679 19.6719 3.93392L18.4359 7.79907L14.0008 10.5705V4.99919L16.3906 2.50976C16.594 2.30611 16.7335 2.04323 16.7909 1.75556C16.8484 1.4679 16.8211 1.16887 16.7126 0.897634C16.6042 0.626403 16.4196 0.395623 16.1831 0.235524C15.9465 0.0754252 15.6691 -0.00652579 15.3871 0.000406097Z" fill="white" fill-opacity="0.2"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 4.5 KiB |
|
|
@ -40,6 +40,9 @@ const ManualCopyModal = dynamic(
|
|||
() => import('@fastgpt/web/hooks/useCopyData').then((mod) => mod.ManualCopyModal),
|
||||
{ ssr: false }
|
||||
);
|
||||
const ActivityAdModal = dynamic(() => import('@/components/support/activity/ActivityAdModal'), {
|
||||
ssr: false
|
||||
});
|
||||
|
||||
const pcUnShowLayoutRoute: Record<string, boolean> = {
|
||||
'/': true,
|
||||
|
|
@ -187,6 +190,7 @@ const Layout = ({ children }: { children: JSX.Element }) => {
|
|||
)}
|
||||
|
||||
<ManualCopyModal />
|
||||
<ActivityAdModal />
|
||||
<Loading loading={loading} zIndex={999999} />
|
||||
</>
|
||||
);
|
||||
|
|
|
|||
|
|
@ -0,0 +1,188 @@
|
|||
import React, { useCallback, useMemo } from 'react';
|
||||
import { useDisclosure } from '@chakra-ui/react';
|
||||
import { useTranslation } from 'next-i18next';
|
||||
import { getActivityAd } from '@/web/common/system/api';
|
||||
import { useRequest2 } from '@fastgpt/web/hooks/useRequest';
|
||||
import {
|
||||
Box,
|
||||
Flex,
|
||||
Button,
|
||||
Image,
|
||||
Modal,
|
||||
ModalOverlay,
|
||||
ModalContent,
|
||||
ModalCloseButton
|
||||
} from '@chakra-ui/react';
|
||||
|
||||
// LocalStorage key for tracking closed ads
|
||||
const CLOSED_AD_KEY = 'activity_ad_closed';
|
||||
const CLOSED_AD_DURATION = 24 * 60 * 60 * 1000; // 24 hours
|
||||
|
||||
const ActivityAdModal = () => {
|
||||
const { isOpen, onOpen, onClose } = useDisclosure();
|
||||
const { t } = useTranslation();
|
||||
|
||||
// Check if ad was recently closed
|
||||
const shouldShowAd = useMemo(() => {
|
||||
const closedData = localStorage.getItem(CLOSED_AD_KEY);
|
||||
if (!closedData) return true;
|
||||
|
||||
try {
|
||||
const { timestamp } = JSON.parse(closedData);
|
||||
const now = Date.now();
|
||||
// Show if 24 hours passed
|
||||
return now - timestamp > CLOSED_AD_DURATION;
|
||||
} catch {
|
||||
return true;
|
||||
}
|
||||
}, []);
|
||||
|
||||
const { data } = useRequest2(
|
||||
async () => {
|
||||
return getActivityAd();
|
||||
},
|
||||
{
|
||||
manual: false,
|
||||
onSuccess(res) {
|
||||
if (res?.activityAdImage && shouldShowAd) {
|
||||
onOpen();
|
||||
}
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
const handleClose = useCallback(() => {
|
||||
if (data?.id) {
|
||||
localStorage.setItem(CLOSED_AD_KEY, JSON.stringify({ timestamp: Date.now(), adId: data.id }));
|
||||
}
|
||||
onClose();
|
||||
}, [data?.id, onClose]);
|
||||
|
||||
const handleJoin = useCallback(() => {
|
||||
if (data?.activityAdLink) {
|
||||
window.open(data.activityAdLink, '_blank');
|
||||
}
|
||||
// handleClose();
|
||||
}, [data?.activityAdLink, handleClose]);
|
||||
|
||||
if (!data?.activityAdImage) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return isOpen ? (
|
||||
<Modal
|
||||
isOpen={isOpen}
|
||||
onClose={handleClose}
|
||||
isCentered
|
||||
size="xl"
|
||||
closeOnOverlayClick={false}
|
||||
blockScrollOnMount
|
||||
>
|
||||
<ModalOverlay bg="blackAlpha.600" />
|
||||
<ModalContent
|
||||
maxW="400px"
|
||||
bg="white"
|
||||
borderRadius="10px"
|
||||
overflow="hidden"
|
||||
position="relative"
|
||||
p={0}
|
||||
>
|
||||
<ModalCloseButton
|
||||
position="absolute"
|
||||
top={1}
|
||||
right={1}
|
||||
zIndex={10}
|
||||
bg={'rgba(244, 246, 248, 0.40)'}
|
||||
borderRadius={'full'}
|
||||
boxSize={9}
|
||||
display={'flex'}
|
||||
alignItems={'center'}
|
||||
justifyContent="center"
|
||||
color={'white'}
|
||||
_hover={{ bg: 'rgba(244, 246, 248, 0.60)' }}
|
||||
/>
|
||||
|
||||
<Flex direction="column">
|
||||
{/* Activity Image */}
|
||||
<Box position="relative">
|
||||
<Image
|
||||
src={data.activityAdImage}
|
||||
alt="Activity"
|
||||
w="100%"
|
||||
h="auto"
|
||||
objectFit="cover"
|
||||
userSelect="none"
|
||||
draggable={false}
|
||||
/>
|
||||
{/* Gradient overlay for smooth transition */}
|
||||
<Box
|
||||
position="absolute"
|
||||
bottom={0}
|
||||
left={0}
|
||||
right={0}
|
||||
h={10}
|
||||
bg="linear-gradient(180deg, rgba(255, 255, 255, 0.00) 0%, #FFF 100%)"
|
||||
pointerEvents="none"
|
||||
/>
|
||||
</Box>
|
||||
|
||||
<Flex
|
||||
mt={6}
|
||||
justifyContent={'center'}
|
||||
color={'black'}
|
||||
fontSize="20px"
|
||||
fontWeight={'medium'}
|
||||
>
|
||||
{t('common:activity_ad.title')}
|
||||
</Flex>
|
||||
|
||||
<Flex mt={6} color={'black'} justifyContent={'center'} fontSize={'14px'}>
|
||||
{t('common:activity_ad.desc')}
|
||||
</Flex>
|
||||
|
||||
<Flex direction="column" align="center" p={8} bg="white">
|
||||
<Flex direction="column" width="100%" gap={3}>
|
||||
<Button
|
||||
width={'100%'}
|
||||
bg={'#ED372C'}
|
||||
color={'white'}
|
||||
borderRadius={'6px'}
|
||||
h={10}
|
||||
sx={{
|
||||
'&::before': {
|
||||
content: '""',
|
||||
position: 'absolute',
|
||||
left: '0',
|
||||
top: '0',
|
||||
width: '30px',
|
||||
height: '30px',
|
||||
backgroundImage: `url('/imgs/system/snowflakeLeft.svg')`,
|
||||
backgroundRepeat: 'no-repeat'
|
||||
},
|
||||
'&::after': {
|
||||
content: '""',
|
||||
position: 'absolute',
|
||||
right: '0',
|
||||
bottom: '0',
|
||||
width: '25px',
|
||||
height: '25px',
|
||||
backgroundImage: `url('/imgs/system/snowflakeRight.svg')`
|
||||
}
|
||||
}}
|
||||
_hover={{ bg: '#DE0D00' }}
|
||||
onClick={handleJoin}
|
||||
>
|
||||
{t('common:activity_ad.join_now')}
|
||||
</Button>
|
||||
<Button width="100%" variant="outline" h={10} onClick={handleClose}>
|
||||
{t('common:activity_ad.later')}
|
||||
</Button>
|
||||
</Flex>
|
||||
</Flex>
|
||||
</Flex>
|
||||
</ModalContent>
|
||||
</Modal>
|
||||
) : null;
|
||||
};
|
||||
|
||||
export default React.memo(ActivityAdModal);
|
||||
|
|
@ -28,3 +28,8 @@ export const getOperationalAd = () =>
|
|||
GET<{ id: string; operationalAdImage: string; operationalAdLink: string }>(
|
||||
'/proApi/support/user/inform/getOperationalAd'
|
||||
);
|
||||
|
||||
export const getActivityAd = () =>
|
||||
GET<{ id: string; activityAdImage: string; activityAdLink: string }>(
|
||||
'/proApi/support/user/inform/getActivityAd'
|
||||
);
|
||||
|
|
|
|||
Loading…
Reference in New Issue