From a58423e46932ed11a6712844ee293b078fc9dc39 Mon Sep 17 00:00:00 2001 From: Cherik Date: Sun, 26 Nov 2023 16:24:48 +0330 Subject: [PATCH 1/2] Revert "Add verify button to inline toast" --- .../views/project/ProjectGIVbackToast.tsx | 21 ++----------- .../projectActionCard/AdminActions.tsx | 31 +++++++++++++++++-- 2 files changed, 31 insertions(+), 21 deletions(-) diff --git a/src/components/views/project/ProjectGIVbackToast.tsx b/src/components/views/project/ProjectGIVbackToast.tsx index 45df5a383d..c21e332ca7 100644 --- a/src/components/views/project/ProjectGIVbackToast.tsx +++ b/src/components/views/project/ProjectGIVbackToast.tsx @@ -6,7 +6,6 @@ import { IconChevronRight, IconGIVBack, IconRocketInSpace16, - IconVerifiedBadge16, mediaQueries, neutralColors, OutlineButton, @@ -14,7 +13,7 @@ import { semanticColors, } from '@giveth/ui-design-system'; import { useIntl } from 'react-intl'; -import React, { useEffect, useState } from 'react'; +import { useEffect, useState } from 'react'; import { useRouter } from 'next/router'; import { useWeb3Modal } from '@web3modal/wagmi/react'; import { Flex } from '@/components/styled-components/Flex'; @@ -26,10 +25,8 @@ import { isSSRMode } from '@/lib/helpers'; import BoostModal from '@/components/modals/Boost/BoostModal'; import { useAppSelector } from '@/features/hooks'; import { formatDonation } from '@/helpers/number'; -import { VerificationModal } from '@/components/modals/VerificationModal'; const ProjectGIVbackToast = () => { - const [showVerificationModal, setShowVerificationModal] = useState(false); const [showBoost, setShowBoost] = useState(false); const { projectData, isAdmin } = useProjectContext(); const verified = projectData?.verified; @@ -167,15 +164,6 @@ const ProjectGIVbackToast = () => { /> )} - {isOwnerNotVerified && ( - - setShowVerificationModal(true)} - label='Verify Project' - icon={} - /> - - )} {showBoost && ( { setShowModal={setShowBoost} /> )} - {showVerificationModal && ( - setShowVerificationModal(false)} - /> - )} ); }; @@ -238,7 +221,7 @@ const Wrapper = styled(Flex)` justify-content: space-between; align-items: center; gap: 24px; - padding: 16px 24px; + padding: 16px; background: #ffffff; border-radius: 16px; margin-top: 12px; diff --git a/src/components/views/project/projectActionCard/AdminActions.tsx b/src/components/views/project/projectActionCard/AdminActions.tsx index 106adba6b2..d9e784f451 100644 --- a/src/components/views/project/projectActionCard/AdminActions.tsx +++ b/src/components/views/project/projectActionCard/AdminActions.tsx @@ -3,6 +3,7 @@ import { IconChevronDown24, IconEdit16, IconShare16, + IconVerifiedBadge16, mediaQueries, neutralColors, } from '@giveth/ui-design-system'; @@ -12,6 +13,7 @@ import { captureException } from '@sentry/nextjs'; import { useRouter } from 'next/router'; import styled from 'styled-components'; import { useProjectContext } from '@/context/project.context'; +import { VerificationModal } from '@/components/modals/VerificationModal'; import DeactivateProjectModal from '@/components/modals/deactivateProject/DeactivateProjectIndex'; import { client } from '@/apollo/apolloClient'; import { ACTIVATE_PROJECT } from '@/apollo/gql/gqlProjects'; @@ -35,6 +37,7 @@ interface IMobileActionsModalProps { } export const AdminActions = () => { + const [showVerificationModal, setShowVerificationModal] = useState(false); const [deactivateModal, setDeactivateModal] = useState(false); const [showShareModal, setShowShareModal] = useState(false); const [showMobileActionsModal, setShowMobileActionsModal] = useState(false); @@ -77,6 +80,17 @@ export const AdminActions = () => { icon: , cb: () => router.push(idToProjectEdit(projectData?.id || '')), }, + { + label: capitalizeAllWords( + formatMessage({ + id: 'label.verify_your_project', + }), + ), + type: OptionType.ITEM, + icon: , + cb: () => setShowVerificationModal(true), + disabled: verified, + }, { label: capitalizeAllWords( formatMessage({ @@ -87,7 +101,10 @@ export const AdminActions = () => { ), type: OptionType.ITEM, icon: , - cb: () => (isActive ? setDeactivateModal(true) : activeProject()), + cb: () => { + console.log('verify'); + isActive ? setDeactivateModal(true) : activeProject(); + }, }, { label: formatMessage({ @@ -105,7 +122,7 @@ export const AdminActions = () => { borderRadius: '8px', }; - const activeOptions = isActive ? options : [options[0], options[1]]; + const activeOptions = isActive ? options : [options[0], options[2]]; return !isMobile ? ( { label='Project Actions' options={activeOptions} /> + {showVerificationModal && ( + setShowVerificationModal(false)} + /> + )} {deactivateModal && ( { ))} + {showVerificationModal && ( + setShowVerificationModal(false)} + /> + )} {deactivateModal && ( Date: Sun, 26 Nov 2023 16:28:45 +0330 Subject: [PATCH 2/2] update version --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 81c08bca4e..4fd31ad9a0 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "givethdapp", - "version": "2.20.2", + "version": "2.20.3", "private": true, "scripts": { "build": "next build",