From 9e3cc0a5113c8965b19538b30423514448d62bee Mon Sep 17 00:00:00 2001 From: kkatusic Date: Thu, 30 May 2024 12:24:33 +0200 Subject: [PATCH 01/87] Fixing share modal icons outline --- src/components/modals/ShareModal.tsx | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/components/modals/ShareModal.tsx b/src/components/modals/ShareModal.tsx index 61a9d2c89d..3541b323f9 100644 --- a/src/components/modals/ShareModal.tsx +++ b/src/components/modals/ShareModal.tsx @@ -79,12 +79,22 @@ const ShareModal: FC = props => { title={shareTitleFacebookAndLinkedin} url={url} > - linkedin icon + linkedin icon - facebook icon + facebook icon From 3dde03a75cfb3d6a8442886f0a79d24ef454c2d4 Mon Sep 17 00:00:00 2001 From: kkatusic Date: Thu, 30 May 2024 12:41:55 +0200 Subject: [PATCH 02/87] Adding share option and modal to project verification step --- .../projectContact/ProjectContactIndex.tsx | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/src/components/views/verification/projectContact/ProjectContactIndex.tsx b/src/components/views/verification/projectContact/ProjectContactIndex.tsx index 5c7204282f..e60e5420d0 100644 --- a/src/components/views/verification/projectContact/ProjectContactIndex.tsx +++ b/src/components/views/verification/projectContact/ProjectContactIndex.tsx @@ -25,8 +25,16 @@ import { EVerificationSteps, IProjectContact } from '@/apollo/types/types'; // import AddSocialModal from '@/components/views/verification/projectContact/AddSocialModal'; import { EMainSocials, IMainSocials } from './common.types'; import { OtherInput } from '@/components/views/verification/projectContact/common'; +import ShareLikeBadge from '@/components/badges/ShareLikeBadge'; +import useDetectDevice from '@/hooks/useDetectDevice'; +import ShareModal from '@/components/modals/ShareModal'; +import { EContentType } from '@/lib/constants/shareContent'; export default function ProjectContactIndex() { + const [showModal, setShowShareModal] = useState(false); + + const { isMobile } = useDetectDevice(); + const { verificationData, setVerificationData, setStep, isDraft } = useVerificationData(); @@ -41,6 +49,8 @@ export default function ProjectContactIndex() { const socials = verificationData?.projectContacts || []; + const slug = verificationData?.project.slug || ''; + const findOtherSocials = () => { return socials.filter( i => !(Object as any).values(EMainSocials).includes(i.name), @@ -182,6 +192,11 @@ export default function ProjectContactIndex() { registerOptions={isDraft ? requiredOptions.website : {}} disabled={!isDraft} /> + setShowShareModal(true)} + isSimple={isMobile} + />
@@ -201,6 +216,13 @@ export default function ProjectContactIndex() {
+ {showModal && slug && ( + + )} ); } From 17333cc6bcf792e8d7fae546ad6f6668e21fc1f9 Mon Sep 17 00:00:00 2001 From: kkatusic Date: Sat, 1 Jun 2024 16:49:27 +0200 Subject: [PATCH 03/87] adding different text to verification share modal --- lang/ca.json | 2 ++ lang/en.json | 2 ++ lang/es.json | 2 ++ src/components/modals/ShareModal.tsx | 33 ++++++++++++++++--- .../projectContact/ProjectContactIndex.tsx | 4 ++- src/lib/constants/shareContent.ts | 3 ++ 6 files changed, 41 insertions(+), 5 deletions(-) diff --git a/lang/ca.json b/lang/ca.json index bd8ec3c9ac..a249803449 100644 --- a/lang/ca.json +++ b/lang/ca.json @@ -872,6 +872,8 @@ "label.share_this": "Compartiu-ho amb els vostres amics", "label.share_this_page_with_your_friends": "Comparteix aquesta pàgina amb els teus amics, i guanya recompenses quan donin a projectes verificats!", "label.share_this_project_on_social_media_and_ask_friends_for_a_boost": "Comparteix aquest projecte a xarxes socials i demana-li als teus amics per un boost!", + "label.share_your": "Comparteix el teu projecte", + "label.share_your_desc": "Comparteix aquest projecte directament a les xarxes socials o utilitza l'enllaç per publicar-lo en les teves altres plataformes.\nAssegura't que estàs publicant aquest enllaç des dels canals oficials de l'organització!", "label.share_your_link_on_your_social_media": "Comparteix el teu enllaç a les teves xarxes socials, lloc web i canals de comunitat favorits.", "label.share_your_referral_link_with_your_friends": "Comparteix el teu enllaç de referència amb els teus amics, família i comunitat.", "label.share_your_unique_link_to_get_started": " Comparteix el teu enllaç únic per començar:", diff --git a/lang/en.json b/lang/en.json index d2bca8bc67..154ebc839d 100644 --- a/lang/en.json +++ b/lang/en.json @@ -872,6 +872,8 @@ "label.share_this": "Share this with your friends", "label.share_this_page_with_your_friends": "Share this page with your friends, and get rewarded when they donate to verified projects!", "label.share_this_project_on_social_media_and_ask_friends_for_a_boost": "Share this project on social media and ask your friends for a boost!", + "label.share_your": "Share your project", + "label.share_your_desc": "Share this project directly to social media or use the link to post it on your other platforms.\nEnsure you are posting this link from the organization's official channels!", "label.share_your_link_on_your_social_media": "Share your link on your social media, website, and favorite community channels.", "label.share_your_referral_link_with_your_friends": "Share your referral link with your friends, family, and community.", "label.share_your_unique_link_to_get_started": " Share your unique link to get started:", diff --git a/lang/es.json b/lang/es.json index 152d163b1f..ff56ef8b71 100644 --- a/lang/es.json +++ b/lang/es.json @@ -872,6 +872,8 @@ "label.share_this": "Comparte esto con tus amigos", "label.share_this_page_with_your_friends": "Comparte esta página con tus amigos", "label.share_this_project_on_social_media_and_ask_friends_for_a_boost": "Comparte este proyecto en redes sociales y pídele a tus amigos por un boost!", + "label.share_your": "Comparte tu proyecto", + "label.share_your_desc": "Comparte este proyecto directamente en redes sociales o utiliza el enlace para publicarlo en tus otras plataformas.\n¡Asegúrate de que estás publicando este enlace desde los canales oficiales de la organización!", "label.share_your_link_on_your_social_media": "Comparte tu enlace en redes sociales, sitios web y canales comunitarios favoritos.", "label.share_your_referral_link_with_your_friends": "Comparte tu enlace de referencia con tus amigos, familia y comunidad.", "label.share_your_unique_link_to_get_started": "Comparte tu link para iniciar:", diff --git a/src/components/modals/ShareModal.tsx b/src/components/modals/ShareModal.tsx index 3541b323f9..8346291cbe 100644 --- a/src/components/modals/ShareModal.tsx +++ b/src/components/modals/ShareModal.tsx @@ -35,10 +35,18 @@ import { interface IShareModal extends IModal { projectHref: string; contentType: EContentType; + shareTitle?: string | undefined; + shareDescription?: string | undefined; } const ShareModal: FC = props => { - const { projectHref, setShowModal, contentType } = props; + const { + projectHref, + setShowModal, + contentType, + shareTitle, + shareDescription, + } = props; const url = fullPath(slugToProjectView(projectHref)); const { isAnimating, closeModal } = useModalAnimation(setShowModal); const { formatMessage } = useIntl(); @@ -52,6 +60,16 @@ const ShareModal: FC = props => { ESocialType.facebook, ); + const shareModalTitle = + shareTitle != undefined + ? formatMessage({ id: shareTitle }) + : formatMessage({ id: 'label.share_this' }); + + const shareModalDesciption = + shareDescription != undefined + ? formatMessage({ id: shareDescription }) + : null; + return ( = props => { headerTitlePosition='left' > - - {formatMessage({ id: 'label.share_this' })}! - + {shareModalTitle}! + {shareModalDesciption && ( + {shareModalDesciption} + )} {showModal && slug && ( )} diff --git a/src/lib/constants/shareContent.ts b/src/lib/constants/shareContent.ts index 6da0263248..3a91559865 100644 --- a/src/lib/constants/shareContent.ts +++ b/src/lib/constants/shareContent.ts @@ -3,6 +3,7 @@ export enum EContentType { ourProject = 'ourProject', justDonated = 'justDonated', justDonatedRecurring = 'justDonatedRecurring', + verifyProject = 'verifyProject', } export enum ESocialType { @@ -26,6 +27,8 @@ export const shareContentCreator = ( 100% of every donation goes directly to our wallet to help us make an impact. Check out our project here 👇\n\n`; } else if (contentType === EContentType.justDonatedRecurring) { message = `I just started a recurring donation to this awesome project on ${socialHandle} with @Superfluid_HQ using @optimism. Read about their impact or support them here:\n\n`; + } else if (contentType === EContentType.verifyProject) { + message = `We're applying to become a verified project on ${socialHandle}, a zero fee crypto donation platform. Check out our project here:\n`; } else { message = `I just donated to this awesome project on ${socialHandle}! 💜 Read about their impact or support them here:\n\n`; } From e481128caa9449df0a7d3b8dc49310b726c1c2dd Mon Sep 17 00:00:00 2001 From: kkatusic Date: Sun, 2 Jun 2024 12:20:41 +0200 Subject: [PATCH 04/87] started maintenance mode bypass --- pages/_app.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pages/_app.tsx b/pages/_app.tsx index e1c298b711..0542880bb7 100644 --- a/pages/_app.tsx +++ b/pages/_app.tsx @@ -8,6 +8,7 @@ import { ApolloProvider } from '@apollo/client'; import NProgress from 'nprogress'; import * as snippet from '@segment/snippet'; import { useRouter } from 'next/router'; +import { cookies } from 'next/headers'; import { Provider as ReduxProvider } from 'react-redux'; import { SpeedInsights } from '@vercel/speed-insights/next'; import Script from 'next/script'; @@ -106,7 +107,9 @@ function MyApp({ Component, pageProps }: AppProps) { const { pathname, asPath, query } = router; const locale = router ? router.locale : defaultLocale; const apolloClient = useApollo(pageProps); - const isMaintenanceMode = process.env.NEXT_PUBLIC_IS_MAINTENANCE === 'true'; + const isMaintenanceMode = + process.env.NEXT_PUBLIC_IS_MAINTENANCE === 'true' && + !cookies().get?.('bypassMaintenance'); useEffect(() => { const handleStart = (url: string) => { From ed90f1ef2cd3127509af65204a203da8c1064250 Mon Sep 17 00:00:00 2001 From: kkatusic Date: Sun, 2 Jun 2024 15:28:27 +0200 Subject: [PATCH 05/87] added bypass maintenance mode --- .env.example | 4 +++- pages/_app.tsx | 18 ++++++++++++--- .../views/Errors/MaintenanceIndex.tsx | 23 +++++++++++++++++++ 3 files changed, 41 insertions(+), 4 deletions(-) diff --git a/.env.example b/.env.example index 9180efab56..119d3915c7 100644 --- a/.env.example +++ b/.env.example @@ -29,4 +29,6 @@ MONGO_DONATION_COLLECTION= MONGO_DONATION_DATA_SOURCE= MONGO_DONATION_DATABASE= -NEXT_PUBLIC_NOTIFICATION_CENTER_ENABLED= \ No newline at end of file +NEXT_PUBLIC_NOTIFICATION_CENTER_ENABLED= + +NEXT_PUBLIC_IS_MAINTENANCE= \ No newline at end of file diff --git a/pages/_app.tsx b/pages/_app.tsx index 0542880bb7..8188dd58cf 100644 --- a/pages/_app.tsx +++ b/pages/_app.tsx @@ -1,4 +1,4 @@ -import React, { useEffect } from 'react'; +import React, { useEffect, useState } from 'react'; import { createWeb3Modal } from '@web3modal/wagmi/react'; import Head from 'next/head'; import { IntlProvider } from 'react-intl'; @@ -8,7 +8,6 @@ import { ApolloProvider } from '@apollo/client'; import NProgress from 'nprogress'; import * as snippet from '@segment/snippet'; import { useRouter } from 'next/router'; -import { cookies } from 'next/headers'; import { Provider as ReduxProvider } from 'react-redux'; import { SpeedInsights } from '@vercel/speed-insights/next'; import Script from 'next/script'; @@ -107,9 +106,22 @@ function MyApp({ Component, pageProps }: AppProps) { const { pathname, asPath, query } = router; const locale = router ? router.locale : defaultLocale; const apolloClient = useApollo(pageProps); + + // read bypass value from local storage for skipping maintenance mode only if maintenance mode is enabled inside ENV file4 + const [isBypassingMaintenance, setIsBypassingMaintenance] = + useState(false); + + useEffect(() => { + if (typeof window !== 'undefined') { + const bypass = localStorage.getItem('bypassMaintenance') === 'true'; + setIsBypassingMaintenance(bypass); + } + }, []); + + // enable maintenance mode only if it is enabled inside ENV file and user has not bypassed it const isMaintenanceMode = process.env.NEXT_PUBLIC_IS_MAINTENANCE === 'true' && - !cookies().get?.('bypassMaintenance'); + !isBypassingMaintenance; useEffect(() => { const handleStart = (url: string) => { diff --git a/src/components/views/Errors/MaintenanceIndex.tsx b/src/components/views/Errors/MaintenanceIndex.tsx index 1c6a6ca36a..3099505450 100644 --- a/src/components/views/Errors/MaintenanceIndex.tsx +++ b/src/components/views/Errors/MaintenanceIndex.tsx @@ -4,6 +4,7 @@ import { useEffect } from 'react'; import { useIntl } from 'react-intl'; import Link from 'next/link'; import Head from 'next/head'; +import { useRouter } from 'next/router'; import links from '@/lib/constants/links'; import givFontLogo from '/public/images/icons/giv_font_logo.svg'; import twitter from '/public/images/icons/twitter.svg'; @@ -30,6 +31,7 @@ import { useAppDispatch } from '@/features/hooks'; const MaintenanceIndex = () => { const dispatch = useAppDispatch(); const { formatMessage } = useIntl(); + const router = useRouter(); const { TWITTER: twitterLink, @@ -44,6 +46,13 @@ const MaintenanceIndex = () => { }; }, [dispatch]); + // you can bypass maintenance mode by setting bypassMaintenance to true in local storage or + // by clicking on transparent button in top left corner + const bypassMaintenance = () => { + localStorage.setItem('bypassMaintenance', JSON.stringify(true)); + router.reload(); + }; + return ( @@ -130,6 +139,20 @@ const MaintenanceIndex = () => { /> +