From 360540457b497d17dd2a695ade8f01947e8737be Mon Sep 17 00:00:00 2001 From: ani-kalpachka Date: Fri, 19 Aug 2022 13:51:08 +0300 Subject: [PATCH 1/3] Disable Beta Popup Dialog --- src/components/index/IndexPage.tsx | 4 +--- src/components/index/sections/BetaPopUpDialog.tsx | 4 ---- 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/src/components/index/IndexPage.tsx b/src/components/index/IndexPage.tsx index 7df3a8bc3..c73d4d87c 100644 --- a/src/components/index/IndexPage.tsx +++ b/src/components/index/IndexPage.tsx @@ -3,12 +3,10 @@ import Layout from 'components/layout/Layout' import Jumbotron from './sections/Jumbotron' import CampaignsSection from './sections/CampaignsSection' import HowWeWorkSection from './sections/HowWeWorkSection' -import ReadyToStartCampaignSection from './sections/ReadyToStartCampaignSection' import WhatUnitesUsSection from './sections/WhatUnitesUsSection' import WantToHelpPodkrepiBgSection from './sections/WantToHelpPodkrepiBg' import FaqSection from './sections/FaqSection' import TeamMembersSection from './sections/TeamMembersSection' -import BetaPopUpDialog from './sections/BetaPopUpDialog' export default function IndexPage() { const { t } = useTranslation() @@ -20,7 +18,7 @@ export default function IndexPage() { disableGutters title={t('index:title2')} metaDescription={t('index:metaDescription')}> - + {/* */} diff --git a/src/components/index/sections/BetaPopUpDialog.tsx b/src/components/index/sections/BetaPopUpDialog.tsx index 16623a2fe..3fa042cbd 100644 --- a/src/components/index/sections/BetaPopUpDialog.tsx +++ b/src/components/index/sections/BetaPopUpDialog.tsx @@ -11,12 +11,8 @@ import { FormControlLabel, Typography, } from '@mui/material' -import { CircleOutlined } from '@mui/icons-material' -import CheckCircleOutlineIcon from '@mui/icons-material/CheckCircleOutline' import BetaPopUpTextCard from 'components/index/helpers/betaPopUp/BetaPopUpTextCard' -import BetaManIcon from 'components/index/icons/BetaManIcon' -import BetaWomanIcon from 'components/index/icons/BetaWomanIcon' let showAgainProp = true From da55dea6589bdfb30b7765434b18dc0683624f8f Mon Sep 17 00:00:00 2001 From: ani-kalpachka Date: Tue, 23 Aug 2022 16:27:59 +0300 Subject: [PATCH 2/3] Fix tests --- e2e/local/homepage.spec.ts | 10 ---------- e2e/local/support.spec.ts | 10 ---------- e2e/staging/anon-donation-fixed.spec.ts | 3 --- e2e/staging/homepage.spec.ts | 10 ---------- 4 files changed, 33 deletions(-) diff --git a/e2e/local/homepage.spec.ts b/e2e/local/homepage.spec.ts index 08bd673b7..04d7ecf0a 100644 --- a/e2e/local/homepage.spec.ts +++ b/e2e/local/homepage.spec.ts @@ -5,16 +5,6 @@ test.beforeEach(async ({ page }) => { }) test('test homepage', async ({ page }) => { - // Click text=Това е бета версията на платформата на Подкрепи.бг преди предстоящия наесен офиц - await expect( - page.locator( - 'text=Това е бета версията на платформата на Подкрепи.бг преди предстоящия наесен офиц', - ), - ).toBeDefined() - - // Click text=Затвори - await page.locator('text=Затвори').click() - // Click text=Текущи кампании await page.locator('text=Текущи кампании').click() diff --git a/e2e/local/support.spec.ts b/e2e/local/support.spec.ts index 09f8aeecf..22ba82620 100644 --- a/e2e/local/support.spec.ts +++ b/e2e/local/support.spec.ts @@ -5,16 +5,6 @@ test.beforeEach(async ({ page }) => { }) test('test support page', async ({ page }) => { - // Click text=Това е бета версията на платформата на Подкрепи.бг преди предстоящия наесен офиц - await expect( - page.locator( - 'text=Това е бета версията на платформата на Подкрепи.бг преди предстоящия наесен офиц', - ), - ).toBeDefined() - - // Click text=Затвори - await page.locator('text=Затвори').click() - // Click text=Станете доброволец >> nth=0 await page.locator('text=Станете доброволец').first().click() diff --git a/e2e/staging/anon-donation-fixed.spec.ts b/e2e/staging/anon-donation-fixed.spec.ts index 32d9d4366..8e4b09e45 100644 --- a/e2e/staging/anon-donation-fixed.spec.ts +++ b/e2e/staging/anon-donation-fixed.spec.ts @@ -4,9 +4,6 @@ test('test anonymous donation on staging - fixed amount', async ({ page }) => { // Go to https://dev.podkrepi.bg/ await page.goto('https://dev.podkrepi.bg/') - // Click text=Затвори - await page.locator('text=Затвори').click() - // Click text=Дарете сега >> nth=0 await page.locator('text=Дарете сега').first().click() await expect(page).toHaveURL( diff --git a/e2e/staging/homepage.spec.ts b/e2e/staging/homepage.spec.ts index f1865ae35..a39eab9de 100644 --- a/e2e/staging/homepage.spec.ts +++ b/e2e/staging/homepage.spec.ts @@ -10,19 +10,9 @@ test('test homepage on staging', async ({ page }) => { // Click text=Текущи кампании await page.locator('text=Текущи кампании').click() - // Click text=Това е бета версията на платформата на Подкрепи.бг преди предстоящия наесен офиц - await page - .locator( - 'text=Това е бета версията на платформата на Подкрепи.бг преди предстоящия наесен офиц', - ) - .click() - // Check input[type="checkbox"] await page.locator('input[type="checkbox"]').check() - // Click text=Затвори - await page.locator('text=Затвори').click() - // Click text=Как работи Подкрепи.бг? await page.locator('text=Как работи Подкрепи.бг?').click() From 059c16bd5b6600b53657632512aa2bff87799088 Mon Sep 17 00:00:00 2001 From: ani-kalpachka Date: Wed, 24 Aug 2022 11:10:52 +0300 Subject: [PATCH 3/3] Remove all beta pop up related code --- e2e/staging/homepage.spec.ts | 3 - public/locales/bg/index.json | 6 - public/locales/en/index.json | 6 - src/components/index/IndexPage.tsx | 1 - .../helpers/betaPopUp/BetaPopUpTextCard.tsx | 34 ---- .../index/sections/BetaPopUpDialog.tsx | 163 ------------------ 6 files changed, 213 deletions(-) delete mode 100644 src/components/index/helpers/betaPopUp/BetaPopUpTextCard.tsx delete mode 100644 src/components/index/sections/BetaPopUpDialog.tsx diff --git a/e2e/staging/homepage.spec.ts b/e2e/staging/homepage.spec.ts index a39eab9de..883a39bf0 100644 --- a/e2e/staging/homepage.spec.ts +++ b/e2e/staging/homepage.spec.ts @@ -10,9 +10,6 @@ test('test homepage on staging', async ({ page }) => { // Click text=Текущи кампании await page.locator('text=Текущи кампании').click() - // Check input[type="checkbox"] - await page.locator('input[type="checkbox"]').check() - // Click text=Как работи Подкрепи.бг? await page.locator('text=Как работи Подкрепи.бг?').click() diff --git a/public/locales/bg/index.json b/public/locales/bg/index.json index 5cb5b7cf9..e64779526 100644 --- a/public/locales/bg/index.json +++ b/public/locales/bg/index.json @@ -3,12 +3,6 @@ "title": "прозрачна дарителска онлайн платформа", "title2": "Подкрепи.бг - прозрачна дарителска онлайн платформа", "metaDescription": "Подкрепи.бг е прозрачна и безплатна онлайн дарителска платформа, създадена от доброволния труд на членовете на сдружение Подкрепи БГ.", - "beta-pop-up": { - "beta-version": "Това е бета версията на платформата на <1>Подкрепи.бг преди предстоящия наесен официален старт.", - "feedback": "Ще сме благодарни, ако ни помогнете като тествате платформата и ни върнете обратна връзка на <1>feedback@podkrepi.bg с нещата, които според Вас могат да се подобрят.", - "close": "Затвори", - "do-not-show-again": "Не показвай отново" - }, "jumbotron": { "heading": "Стимулираме дарителската култура чрез прозрачност в набирането и разпределянето на средства за каузите, без да удържаме такси и комисиони за Подкрепи.бг.", "maximum-transparency": "с максимална степен на прозрачност", diff --git a/public/locales/en/index.json b/public/locales/en/index.json index 88b00870f..e498c9d8e 100644 --- a/public/locales/en/index.json +++ b/public/locales/en/index.json @@ -3,12 +3,6 @@ "title": "a transparent online donation platform", "title2": "Podkrepi.bg - a transparent online donation platform", "metaDescription": "Podkrepi.bg is a transparent online donation platform created by a team of volunteers from the Podkrepi BG organization.", - "beta-pop-up": { - "beta-version": "This is the beta version of the <1>Podkrepi.bg platform before the official launch in the fall.", - "feedback": "We would be grateful if you could help us by testing the platform and giving us feedback at <1>feedback@podkrepi.bg with the things you think can be improved.", - "close": "Close", - "do-not-show-again": "Don't show again!" - }, "jumbotron": { "heading": "We stimulate the donation culture through transparency in raising and allocating funds to the causes without deducting fees and commissions for Podkrepi.bg.", "maximum-transparency": "with maximum transparency", diff --git a/src/components/index/IndexPage.tsx b/src/components/index/IndexPage.tsx index c73d4d87c..a276d53ad 100644 --- a/src/components/index/IndexPage.tsx +++ b/src/components/index/IndexPage.tsx @@ -18,7 +18,6 @@ export default function IndexPage() { disableGutters title={t('index:title2')} metaDescription={t('index:metaDescription')}> - {/* */} diff --git a/src/components/index/helpers/betaPopUp/BetaPopUpTextCard.tsx b/src/components/index/helpers/betaPopUp/BetaPopUpTextCard.tsx deleted file mode 100644 index 599f50924..000000000 --- a/src/components/index/helpers/betaPopUp/BetaPopUpTextCard.tsx +++ /dev/null @@ -1,34 +0,0 @@ -import React from 'react' -import { Trans, useTranslation } from 'next-i18next' -import { Grid, Typography } from '@mui/material' -import CheckCircleIcon from '@mui/icons-material/CheckCircle' - -type BetaPopUpTextProps = { - translationKey: string -} -export default function BetaPopUpTextCard({ translationKey }: BetaPopUpTextProps) { - const { t } = useTranslation() - - return ( - - ({ height: '28px', color: '#00B0FF', marginRight: '10px' })} /> - ({ - marginBottom: '10px', - lineHeight: '28px', - fontWeight: '500', - letterSpacing: '0.15px', - [theme.breakpoints.down('md')]: { - lineHeight: '24px', - fontWeight: '500', - marginBottom: '5px', - }, - })}> - - {t(translationKey)} - - - - - ) -} diff --git a/src/components/index/sections/BetaPopUpDialog.tsx b/src/components/index/sections/BetaPopUpDialog.tsx deleted file mode 100644 index 3fa042cbd..000000000 --- a/src/components/index/sections/BetaPopUpDialog.tsx +++ /dev/null @@ -1,163 +0,0 @@ -import React, { ChangeEvent, useEffect, useState } from 'react' -import { useTranslation } from 'next-i18next' -import { - Button, - Grid, - Checkbox, - Dialog, - DialogActions, - DialogContent, - FormControl, - FormControlLabel, - Typography, -} from '@mui/material' - -import BetaPopUpTextCard from 'components/index/helpers/betaPopUp/BetaPopUpTextCard' - -let showAgainProp = true - -export default function BetaPopUpDialog() { - const { t } = useTranslation('index') - const [open, setOpen] = useState(false) - const [showAgain, setShowAgain] = useState(true) - useEffect(() => { - if (!showAgain) { - // Only set it if we are switching it off. The other way around is not possible - localStorage.setItem('showBetaPopup', JSON.stringify(showAgain)) - } - }, [showAgain]) - - useEffect(() => { - const initialShowAgain = localStorage.getItem('showBetaPopup') - if (initialShowAgain !== undefined && initialShowAgain !== null) { - const showBetaPopup = JSON.parse(initialShowAgain) as boolean - showAgainProp = showBetaPopup - } - }) - - const handleClose = () => { - setOpen(false) - showAgainProp = showAgain - } - - useEffect(() => { - if (showAgainProp === true && open === false) { - setTimeout(() => { - setOpen(true) - }, 10000) - } - }, [showAgainProp]) - - const handleCheckboxChange = (event: ChangeEvent, checked: boolean) => { - setShowAgain(!checked) - } - - return ( - - ({ - width: '600px', - margin: '0 auto', - padding: theme.spacing(7, 6, 0, 6), - border: '16px solid #E3E3E3', - borderRadius: '40px', - background: 'white', - [theme.breakpoints.down('md')]: { - width: '322px', - padding: theme.spacing(6, 1, 0, 1), - border: '8px solid #E3E3E3', - }, - })}> - ({ padding: 0 })}> - - - - - ({ - display: 'flex', - flexDirection: 'column', - })}> - - - - } - label={ - - {t('beta-pop-up.do-not-show-again').toString()} - - } - /> - - - - - ({ - display: 'flex', - justifyContent: 'space-between', - alignContent: 'flex-end', - position: 'relative', - margin: '0 auto', - top: '-125px', - width: '800px', - [theme.breakpoints.down('md')]: { - top: '-35px', - width: '370px', - }, - })}> - {/* ({ - height: '325px', - width: '180px', - [theme.breakpoints.down('md')]: { - height: '205px', - width: '115px', - }, - })} - /> - ({ - height: '325px', - width: '200px', - [theme.breakpoints.down('md')]: { - height: '205px', - width: '131px', - }, - })} - /> */} - - - ) -}