diff --git a/package-lock.json b/package-lock.json
index 027abe7..15a9ab4 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -18,6 +18,7 @@
"@types/react-dom": "^17.0.10",
"framer-motion": "^5.3.0",
"react": "^17.0.2",
+ "react-copy-to-clipboard": "^5.0.4",
"react-dom": "^17.0.2",
"react-icons": "^4.3.1",
"react-loader-spinner": "^4.0.0",
@@ -32,6 +33,7 @@
},
"devDependencies": {
"@craco/craco": "^6.4.0",
+ "@types/react-copy-to-clipboard": "^5.0.2",
"autoprefixer": "^9.8.8",
"gh-pages": "^3.2.3",
"postcss": "^7.0.39",
@@ -3651,6 +3653,15 @@
"csstype": "^3.0.2"
}
},
+ "node_modules/@types/react-copy-to-clipboard": {
+ "version": "5.0.2",
+ "resolved": "https://registry.npmjs.org/@types/react-copy-to-clipboard/-/react-copy-to-clipboard-5.0.2.tgz",
+ "integrity": "sha512-O29AThfxrkUFRsZXjfSWR2yaWo0ppB1yLEnHA+Oh24oNetjBAwTDu1PmolIqdJKzsZiO4J1jn6R6TmO96uBvGg==",
+ "dev": true,
+ "dependencies": {
+ "@types/react": "*"
+ }
+ },
"node_modules/@types/react-dom": {
"version": "17.0.10",
"resolved": "https://registry.npmjs.org/@types/react-dom/-/react-dom-17.0.10.tgz",
@@ -6293,6 +6304,14 @@
"node": ">=0.10.0"
}
},
+ "node_modules/copy-to-clipboard": {
+ "version": "3.3.1",
+ "resolved": "https://registry.npmjs.org/copy-to-clipboard/-/copy-to-clipboard-3.3.1.tgz",
+ "integrity": "sha512-i13qo6kIHTTpCm8/Wup+0b1mVWETvu2kIMzKoK8FpkLkFxlt0znUAHcMzox+T8sPlqtZXq3CulEjQHsYiGFJUw==",
+ "dependencies": {
+ "toggle-selection": "^1.0.6"
+ }
+ },
"node_modules/core-js": {
"version": "3.19.1",
"resolved": "https://registry.npmjs.org/core-js/-/core-js-3.19.1.tgz",
@@ -16699,6 +16718,18 @@
"node": ">=10"
}
},
+ "node_modules/react-copy-to-clipboard": {
+ "version": "5.0.4",
+ "resolved": "https://registry.npmjs.org/react-copy-to-clipboard/-/react-copy-to-clipboard-5.0.4.tgz",
+ "integrity": "sha512-IeVAiNVKjSPeGax/Gmkqfa/+PuMTBhutEvFUaMQLwE2tS0EXrAdgOpWDX26bWTXF3HrioorR7lr08NqeYUWQCQ==",
+ "dependencies": {
+ "copy-to-clipboard": "^3",
+ "prop-types": "^15.5.8"
+ },
+ "peerDependencies": {
+ "react": "^15.3.0 || ^16.0.0 || ^17.0.0"
+ }
+ },
"node_modules/react-dev-utils": {
"version": "11.0.4",
"resolved": "https://registry.npmjs.org/react-dev-utils/-/react-dev-utils-11.0.4.tgz",
@@ -20067,6 +20098,11 @@
"node": ">=8.0"
}
},
+ "node_modules/toggle-selection": {
+ "version": "1.0.6",
+ "resolved": "https://registry.npmjs.org/toggle-selection/-/toggle-selection-1.0.6.tgz",
+ "integrity": "sha1-bkWxJj8gF/oKzH2J14sVuL932jI="
+ },
"node_modules/toidentifier": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.0.tgz",
@@ -25135,6 +25171,15 @@
"csstype": "^3.0.2"
}
},
+ "@types/react-copy-to-clipboard": {
+ "version": "5.0.2",
+ "resolved": "https://registry.npmjs.org/@types/react-copy-to-clipboard/-/react-copy-to-clipboard-5.0.2.tgz",
+ "integrity": "sha512-O29AThfxrkUFRsZXjfSWR2yaWo0ppB1yLEnHA+Oh24oNetjBAwTDu1PmolIqdJKzsZiO4J1jn6R6TmO96uBvGg==",
+ "dev": true,
+ "requires": {
+ "@types/react": "*"
+ }
+ },
"@types/react-dom": {
"version": "17.0.10",
"resolved": "https://registry.npmjs.org/@types/react-dom/-/react-dom-17.0.10.tgz",
@@ -27255,6 +27300,14 @@
"resolved": "https://registry.npmjs.org/copy-descriptor/-/copy-descriptor-0.1.1.tgz",
"integrity": "sha1-Z29us8OZl8LuGsOpJP1hJHSPV40="
},
+ "copy-to-clipboard": {
+ "version": "3.3.1",
+ "resolved": "https://registry.npmjs.org/copy-to-clipboard/-/copy-to-clipboard-3.3.1.tgz",
+ "integrity": "sha512-i13qo6kIHTTpCm8/Wup+0b1mVWETvu2kIMzKoK8FpkLkFxlt0znUAHcMzox+T8sPlqtZXq3CulEjQHsYiGFJUw==",
+ "requires": {
+ "toggle-selection": "^1.0.6"
+ }
+ },
"core-js": {
"version": "3.19.1",
"resolved": "https://registry.npmjs.org/core-js/-/core-js-3.19.1.tgz",
@@ -35244,6 +35297,15 @@
"whatwg-fetch": "^3.4.1"
}
},
+ "react-copy-to-clipboard": {
+ "version": "5.0.4",
+ "resolved": "https://registry.npmjs.org/react-copy-to-clipboard/-/react-copy-to-clipboard-5.0.4.tgz",
+ "integrity": "sha512-IeVAiNVKjSPeGax/Gmkqfa/+PuMTBhutEvFUaMQLwE2tS0EXrAdgOpWDX26bWTXF3HrioorR7lr08NqeYUWQCQ==",
+ "requires": {
+ "copy-to-clipboard": "^3",
+ "prop-types": "^15.5.8"
+ }
+ },
"react-dev-utils": {
"version": "11.0.4",
"resolved": "https://registry.npmjs.org/react-dev-utils/-/react-dev-utils-11.0.4.tgz",
@@ -37895,6 +37957,11 @@
"is-number": "^7.0.0"
}
},
+ "toggle-selection": {
+ "version": "1.0.6",
+ "resolved": "https://registry.npmjs.org/toggle-selection/-/toggle-selection-1.0.6.tgz",
+ "integrity": "sha1-bkWxJj8gF/oKzH2J14sVuL932jI="
+ },
"toidentifier": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.0.tgz",
diff --git a/package.json b/package.json
index cb16ede..14da1d3 100644
--- a/package.json
+++ b/package.json
@@ -14,6 +14,7 @@
"@types/react-dom": "^17.0.10",
"framer-motion": "^5.3.0",
"react": "^17.0.2",
+ "react-copy-to-clipboard": "^5.0.4",
"react-dom": "^17.0.2",
"react-icons": "^4.3.1",
"react-loader-spinner": "^4.0.0",
@@ -55,9 +56,10 @@
},
"devDependencies": {
"@craco/craco": "^6.4.0",
+ "@types/react-copy-to-clipboard": "^5.0.2",
"autoprefixer": "^9.8.8",
"gh-pages": "^3.2.3",
"postcss": "^7.0.39",
"tailwindcss": "npm:@tailwindcss/postcss7-compat@^2.2.17"
}
-}
\ No newline at end of file
+}
diff --git a/src/Components/ClaimProject/Claim_CopySignatureCard.tsx b/src/Components/ClaimProject/Claim_CopySignatureCard.tsx
index f6caaa0..4640c11 100644
--- a/src/Components/ClaimProject/Claim_CopySignatureCard.tsx
+++ b/src/Components/ClaimProject/Claim_CopySignatureCard.tsx
@@ -1,32 +1,28 @@
import { motion } from 'framer-motion'
import { Direction, ModalId, replaceModal } from '../../redux/features/modals.slice';
-import { useAppDispatch } from '../../utils/hooks';
+import { useAppDispatch, useAppSelector } from '../../utils/hooks';
import { ModalCard, modalCardVariants } from '../Shared/ModalsContainer/ModalsContainer'
import { useCallback, useEffect, useState } from 'react';
import { IoClose } from 'react-icons/io5';
import { IoIosCopy } from 'react-icons/io'
+import CopyToClipboard from 'react-copy-to-clipboard';
export default function Claim_CopySignatureCard({ onClose, direction, ...props }: ModalCard) {
const dispatch = useAppDispatch();
+ const { projectName, image } = useAppSelector(state => ({ projectName: state.project.project?.title, image: state.project.project?.thumbnail_image, }))
+ const generatedHash = '0x000330RaaSt302440zxc327jjiaswf19987183345pRReuBNksbaaueee'
const handleNext = useCallback(() => {
dispatch(replaceModal({
- modalId: ModalId.Login_NativeWallet,
+ modalId: ModalId.Claim_Submitted,
direction: Direction.NEXT
}))
}, [dispatch])
- useEffect(() => {
-
- // const timeout = setTimeout(handleNext, 3000)
- // return () => clearTimeout(timeout)
- }, [handleNext])
-
const onCopy = () => {
- // Copy to Clipboard
- setTimeout(handleNext, 2000)
+ // Copy to Clipboard
}
return (
@@ -42,24 +38,28 @@ export default function Claim_CopySignatureCard({ onClose, direction, ...props }
Claim this project
- To claim ownership of Application Name and its tips, copy the signature hash below and paste it on the following URL:
-
-
- projectname.com/well-known/bolt.fun.json
+ >www.projectname.com/
-
+
-
+
+
+
+
+
+
+ Submit for review
diff --git a/src/Components/ClaimProject/Claim_FundWithdrawCard.tsx b/src/Components/ClaimProject/Claim_FundWithdrawCard.tsx
index 30799ee..09b019c 100644
--- a/src/Components/ClaimProject/Claim_FundWithdrawCard.tsx
+++ b/src/Components/ClaimProject/Claim_FundWithdrawCard.tsx
@@ -1,6 +1,6 @@
import { motion } from 'framer-motion'
import { Direction, ModalId, replaceModal } from '../../redux/features/modals.slice';
-import { useAppDispatch } from '../../utils/hooks';
+import { useAppDispatch, useAppSelector } from '../../utils/hooks';
import { ModalCard, modalCardVariants } from '../Shared/ModalsContainer/ModalsContainer'
import { useCallback, useEffect, useState } from 'react';
import { IoClose } from 'react-icons/io5';
@@ -11,8 +11,6 @@ export default function Claim_FundWithdrawCard({ onClose, direction, ...props }:
const dispatch = useAppDispatch();
-
-
return (
@@ -34,7 +32,7 @@ export default function Claim_FundWithdrawCard({ onClose, direction, ...props }:
2.78$
-
+
Fund
Withdraw
diff --git a/src/Components/ClaimProject/Claim_GenerateSignatureCard.tsx b/src/Components/ClaimProject/Claim_GenerateSignatureCard.tsx
index 6819c2c..987a349 100644
--- a/src/Components/ClaimProject/Claim_GenerateSignatureCard.tsx
+++ b/src/Components/ClaimProject/Claim_GenerateSignatureCard.tsx
@@ -1,6 +1,6 @@
import { motion } from 'framer-motion'
import { Direction, ModalId, replaceModal } from '../../redux/features/modals.slice';
-import { useAppDispatch } from '../../utils/hooks';
+import { useAppDispatch, useAppSelector } from '../../utils/hooks';
import { ModalCard, modalCardVariants } from '../Shared/ModalsContainer/ModalsContainer'
import { useCallback, useEffect } from 'react';
import { IoClose } from 'react-icons/io5';
@@ -8,11 +8,13 @@ import { IoClose } from 'react-icons/io5';
export default function Claim_GenerateSignatureCard({ onClose, direction, ...props }: ModalCard) {
const dispatch = useAppDispatch();
+ const { projectName, image } = useAppSelector(state => ({ projectName: state.project.project?.title, image: state.project.project?.thumbnail_image, }))
+
const handleNext = useCallback(() => {
dispatch(replaceModal({
- modalId: ModalId.Login_NativeWallet,
+ modalId: ModalId.Claim_CopySignature,
direction: Direction.NEXT
}))
}, [dispatch])
@@ -41,12 +43,12 @@ export default function Claim_GenerateSignatureCard({ onClose, direction, ...pro
Claim this project
- To claim ownership of Application Name and its tips, you need to sign a message and paste this on the project website so we can verify you are the real ownership
+ To claim ownership of {projectName} and its tips, you need to sign a message and paste this on the project website so we can verify you are the real ownership
Generate Signature
diff --git a/src/Components/ExplorePage/partials/ProjectsRow.tsx b/src/Components/ExplorePage/partials/ProjectsRow.tsx
index 89083be..94fe025 100644
--- a/src/Components/ExplorePage/partials/ProjectsRow.tsx
+++ b/src/Components/ExplorePage/partials/ProjectsRow.tsx
@@ -28,7 +28,7 @@ export default function ProjectsRow({ title, projects }: Props) {
const handleClick = (projectId: string) => {
projectId = '123123123';
if (!drag.current)
- dispatch(openModal({ modalId: ModalId.Project, initialModalProps: { projectId } }))
+ dispatch(openModal({ modalId: ModalId.Project, propsToPass: { projectId } }))
}
return (
diff --git a/src/Components/Login/Login_ExternalWalletCard.tsx b/src/Components/Login/Login_ExternalWalletCard.tsx
index 170ed61..08ad2dd 100644
--- a/src/Components/Login/Login_ExternalWalletCard.tsx
+++ b/src/Components/Login/Login_ExternalWalletCard.tsx
@@ -3,7 +3,7 @@ import { Direction, ModalId, replaceModal } from '../../redux/features/modals.sl
import { useAppDispatch } from '../../utils/hooks';
import { ModalCard, modalCardVariants } from '../Shared/ModalsContainer/ModalsContainer'
import { AiFillThunderbolt } from 'react-icons/ai';
-import Loader from 'react-loader-spinner';
+import { CopyToClipboard } from 'react-copy-to-clipboard';
import { useCallback, useEffect, useState } from 'react';
import { IoClose } from 'react-icons/io5';
import { IoIosCopy } from 'react-icons/io'
@@ -15,20 +15,17 @@ export default function Login_ExternalWalletCard({ onClose, direction, ...props
const handleNext = useCallback(() => {
dispatch(replaceModal({
- modalId: ModalId.Login_NativeWallet,
+ modalId: ModalId.Login_Success,
direction: Direction.NEXT
}))
}, [dispatch])
useEffect(() => {
-
- // const timeout = setTimeout(handleNext, 3000)
- // return () => clearTimeout(timeout)
}, [handleNext])
const onCopy = () => {
// Copy to Clipboard
- setTimeout(handleNext, 2000)
+ setTimeout(handleNext, 1000)
}
return (
@@ -45,19 +42,21 @@ export default function Login_ExternalWalletCard({ onClose, direction, ...props
Scan this code or copy the address below to login using Inurl-auth
-
+
-
+
+
+
diff --git a/src/Components/Login/Login_NativeWalletCard.tsx b/src/Components/Login/Login_NativeWalletCard.tsx
index 1d0d244..cf27322 100644
--- a/src/Components/Login/Login_NativeWalletCard.tsx
+++ b/src/Components/Login/Login_NativeWalletCard.tsx
@@ -10,7 +10,7 @@ export default function Login_NativeWalletCard({ onClose, direction, ...props }:
const handleNext = () => {
dispatch(replaceModal({
- modalId: ModalId.Login_Success,
+ modalId: ModalId.Login_ExternalWallet,
direction: Direction.NEXT
}))
}
diff --git a/src/Components/Login/Login_SuccessCard.tsx b/src/Components/Login/Login_SuccessCard.tsx
index b700c36..259380f 100644
--- a/src/Components/Login/Login_SuccessCard.tsx
+++ b/src/Components/Login/Login_SuccessCard.tsx
@@ -2,21 +2,21 @@ import { motion } from 'framer-motion'
import { useAppDispatch } from '../../utils/hooks';
import { ModalCard, modalCardVariants } from '../Shared/ModalsContainer/ModalsContainer'
import { useCallback, useEffect } from 'react';
+import { closeModal, openSceduledModal } from '../../redux/features/modals.slice';
+import { connectWallet } from '../../redux/features/wallet.slice';
export default function Login_SuccessCard({ onClose, direction, ...props }: ModalCard) {
const dispatch = useAppDispatch();
const handleNext = useCallback(() => {
- // dispatch(replaceModal({
- // modalId: ModalId.Login_ScanWallet,
- // direction: Direction.NEXT
- // }))
- onClose && onClose()
+ dispatch(closeModal())
+ dispatch(openSceduledModal())
}, [dispatch, onClose])
useEffect(() => {
+ dispatch(connectWallet());
const timeout = setTimeout(handleNext, 3000)
return () => clearTimeout(timeout)
}, [handleNext])
diff --git a/src/Components/Project/ProjectCard.tsx b/src/Components/Project/ProjectCard.tsx
index 3a94fea..b6e1e83 100644
--- a/src/Components/Project/ProjectCard.tsx
+++ b/src/Components/Project/ProjectCard.tsx
@@ -5,15 +5,22 @@ import { MdLocalFireDepartment } from 'react-icons/md';
import { ModalCard, modalCardVariants } from '../Shared/ModalsContainer/ModalsContainer';
import { useQuery } from 'react-query';
import { getProjectById } from '../../api';
-import { useAppDispatch } from '../../utils/hooks';
-import { ModalId, openModal } from '../../redux/features/modals.slice';
+import { useAppDispatch, useAppSelector } from '../../utils/hooks';
+import { ModalId, openModal, scheduleModal } from '../../redux/features/modals.slice';
+import { setProject } from '../../redux/features/project.slice';
export default function ProjectCard({ onClose, direction, ...props }: ModalCard) {
- const { data: project, isLoading } = useQuery(['get-project', props.projectId], () => getProjectById(props.projectId))
-
+ const { data: project, isLoading } = useQuery(
+ ['get-project', props.projectId],
+ () => getProjectById(props.projectId),
+ {
+ onSuccess: project => dispatch(setProject(project))
+ }
+ )
+ const { isWalletConnected } = useAppSelector(state => ({ isWalletConnected: state.wallet.isConnected }))
const dispatch = useAppDispatch();
if (isLoading || !project) return <>>;
@@ -21,14 +28,29 @@ export default function ProjectCard({ onClose, direction, ...props }: ModalCard)
const onVote = () => {
- dispatch(openModal({ modalId: ModalId.Vote, initialModalProps: { projectId: props.projectId } }))
+ if (!isWalletConnected) {
+ dispatch(scheduleModal({ modalId: ModalId.Vote, propsToPass: { projectId: props.projectId } }))
+ dispatch(openModal({
+ modalId: ModalId.Login_ScanWallet
+ }))
+ } else
+ dispatch(openModal({ modalId: ModalId.Vote, propsToPass: { projectId: props.projectId } }))
}
const onClaim = () => {
- dispatch(openModal({
- modalId: ModalId.Login_ScanWallet,
- initialModalProps: { projectId: props.projectId },
- }))
+ if (!isWalletConnected) {
+ dispatch(scheduleModal({
+ modalId: ModalId.Claim_GenerateSignature,
+ propsToPass: { projectId: props.projectId },
+ }))
+ dispatch(openModal({
+ modalId: ModalId.Login_ScanWallet
+ }))
+ } else
+ dispatch(openModal({
+ modalId: ModalId.Claim_GenerateSignature,
+ propsToPass: { projectId: props.projectId },
+ }))
}
return (
@@ -56,7 +78,7 @@ export default function ProjectCard({ onClose, direction, ...props }: ModalCard)
Play
- Vote
+ Vote
{project.description}
diff --git a/src/Components/Shared/ModalsContainer/ModalsContainer.tsx b/src/Components/Shared/ModalsContainer/ModalsContainer.tsx
index 97b36f0..c1eb88c 100644
--- a/src/Components/Shared/ModalsContainer/ModalsContainer.tsx
+++ b/src/Components/Shared/ModalsContainer/ModalsContainer.tsx
@@ -1,6 +1,6 @@
import { AnimatePresence, motion } from "framer-motion";
import { useEffect } from "react";
-import { closeModal, Direction, ModalId } from "../../../redux/features/modals.slice";
+import { closeModal, Direction, ModalId, removeScheduledModal } from "../../../redux/features/modals.slice";
import { useAppDispatch, useAppSelector } from "../../../utils/hooks";
import Claim_CopySignatureCard from "../../ClaimProject/Claim_CopySignatureCard";
import Claim_GenerateSignatureCard from "../../ClaimProject/Claim_GenerateSignatureCard";
@@ -85,7 +85,10 @@ export default function ModalsContainer() {
}))
const dispatch = useAppDispatch();
- const onClose = () => dispatch(closeModal());
+ const onClose = () => {
+ dispatch(removeScheduledModal());
+ dispatch(closeModal());
+ }
useEffect(() => {
if (isOpen) document.body.style.overflowY = "hidden";
diff --git a/src/Components/Shared/Navbar/Navbar.tsx b/src/Components/Shared/Navbar/Navbar.tsx
index 66a273c..f9bd56c 100644
--- a/src/Components/Shared/Navbar/Navbar.tsx
+++ b/src/Components/Shared/Navbar/Navbar.tsx
@@ -4,9 +4,11 @@ import { MdLocalFireDepartment } from 'react-icons/md';
import { IoExtensionPuzzle } from 'react-icons/io5';
import { AiFillThunderbolt } from 'react-icons/ai';
import { BsSearch } from "react-icons/bs";
-import { FormEvent, useState } from "react";
+import { FormEvent, useRef, useState } from "react";
import { motion } from "framer-motion";
import { GrClose } from 'react-icons/gr';
+import { useAppDispatch, useAppSelector } from "../../../utils/hooks";
+import { ModalId, openModal } from "../../../redux/features/modals.slice";
export const navLinks = [
{ text: "Explore", url: "/", icon: FaHome, color: 'text-primary-600' },
@@ -18,9 +20,13 @@ export const navLinks = [
export default function Navbar() {
const [searchOpen, setSearchOpen] = useState(false)
- const [searchInput, setSearchInput] = useState("")
+ const [searchInput, setSearchInput] = useState("");
+ const inputRef = useRef
(null)
+ const dispatch = useAppDispatch()
+ const { isWalletConnected } = useAppSelector(state => ({ isWalletConnected: state.wallet.isConnected }))
const toggleSearch = () => {
+ if (!searchOpen) inputRef.current?.focus();
setSearchOpen(!searchOpen);
}
@@ -29,6 +35,18 @@ export default function Navbar() {
alert(`Your Searched for: ${search}`)
}
+ const onConnectWallet = () => {
+ dispatch(openModal({
+ modalId: ModalId.Login_ScanWallet
+ }));
+ }
+
+ const onWithdraw = () => {
+ dispatch(openModal({
+ modalId: ModalId.Claim_FundWithdraw
+ }))
+ }
+
const handleSubmit = (e: FormEvent) => {
e.preventDefault();
// Make Search Request
@@ -53,17 +71,20 @@ export default function Navbar() {
animate={searchOpen ? { opacity: 0 } : { opacity: 1 }}
className="flex">
Submit Appī¸
- Connect Wallet
-
+ {isWalletConnected ?
+ 2.2k Sats
+ : Connect Wallet
+ }
diff --git a/src/api/mockData.json b/src/api/mockData.json
index f23eb8d..502a0b3 100644
--- a/src/api/mockData.json
+++ b/src/api/mockData.json
@@ -103,8 +103,8 @@
"id": "123123123",
"cover_image": "https://s3-alpha-sig.figma.com/img/07b8/5d84/145942255afd215b3da26dbbf1dd03bd?Expires=1638144000&Signature=Cl1DUQJIUsrrFi48M~qU1r3Z0agGdy-uiNUao5g8-nu34QtoyWTFPXvaH3naSZBYqcPyKFq1jaXF6Mw1uj1hdWwGhXhMPLnKNJFFrGViVXhXu-3YeCPY9p4-IcieFJBZPVA~zDY8zxY5b06loWsINAVx4eMHRAhSWl~~Mca5PjlSXloiYrT00W-6c9m8gevfMMX~PsHQedzwYzg0j2DlnhPX8LbRkli1G2OxtCaFwo3~HGHXIlFGuGU1uXRvi1qBWrdjdsuWgIly1ekcFfJWAKmwYXk06EtCmfWRgGYbD7cBK~lwOkFofbf1LW0yqLv0hr4svwToH~3FiHenrCF-1g__&Key-Pair-Id=APKAINTVSUGEWH5XD5UA",
"thumbnail_image": "https://s3-alpha-sig.figma.com/img/be1b/cd75/1baa911b3875134c0889d6755c4ba2cb?Expires=1637539200&Signature=QExmgJCGGSES~zIwM-2G8yd7aPR-j5eFnV3tOg6BkSdXVB9AMhHQPbRpbfOv~rD3hdMdSPMkS9kfjyFbAuonltV2zrf5GOwGxrF2GVdhpIGc6RiqGLWVVY8mXysEm6~0fVj~2SK8hec~YnV1h0oHDQiZF5YjGi143pImGmcVERPpB7MiksSoD0Vki6RXamySopj~f-~lUGy2uKRbQKxQ4LCFTz-H9O8vpkZpCVq274FYsqsEtUihwVjniNXV8ukLxdL~rfgf8L9MeiR7gDYYQ9MSLMZKEa~TnQ-JadlngQz78a2T801WaG2xp5hGHYQMtIi1ES-N4FOg5PwEjtIetA__&Key-Pair-Id=APKAINTVSUGEWH5XD5UA",
- "title": "Project Name",
- "website": "www.project.com",
+ "title": "{Project Name}",
+ "website": "https://www.project.com",
"description": "Lorem ipsum dolor sit amet consectetur adipisicing elit. Distinctio nobis aliquam, minima assumenda earum sapiente pariatur cupiditate error nihil, eius corporis ratione unde perspiciatis tenetur ipsa aut ex consequatur maiores eligendi quidem exercitationem suscipit. Ex hic reprehenderit deleniti possimus culpa animi velit? Dolores, nemo quis minima sapiente sed laborum ipsam?",
"tags": [
{
diff --git a/src/index.css b/src/index.css
index a1657d4..4e65e7d 100644
--- a/src/index.css
+++ b/src/index.css
@@ -5,19 +5,19 @@
@layer components {
.btn {
- @apply text-gray-900 px-42 bg-gray-25 hover:bg-gray-100 py-12 font-sans rounded-8 shadow-md font-regular;
+ @apply text-gray-900 px-42 bg-gray-25 hover:bg-gray-50 py-12 font-sans rounded-8 font-regular;
}
.btn-primary {
- @apply bg-primary-500 hover:bg-primary-400 text-white;
+ @apply bg-primary-500 shadow-md hover:bg-primary-400 text-white;
}
.btn-gray {
- @apply bg-gray-200 hover:bg-gray-100 text-gray-900;
+ @apply bg-gray-100 border-2 hover:bg-gray-200 text-gray-900;
}
.input-wrapper {
- @apply w-full relative border rounded-lg shadow flex h-42 overflow-hidden focus-within:outline-primary;
+ @apply w-full relative border rounded-lg shadow flex h-42 focus-within:outline-primary;
}
.input-field {
diff --git a/src/redux/features/modals.slice.ts b/src/redux/features/modals.slice.ts
index 2cf8151..a1217aa 100644
--- a/src/redux/features/modals.slice.ts
+++ b/src/redux/features/modals.slice.ts
@@ -23,13 +23,15 @@ export enum ModalId {
interface OpenModal {
modalId: ModalId;
- propsToPass: any;
+ propsToPass?: any;
}
interface StoreState {
isOpen: boolean;
isLoading: boolean;
direction: Direction;
+ flows: ModalId[];
+ toOpenLater: OpenModal | null;
openModals: OpenModal[];
}
@@ -37,9 +39,9 @@ const initialState = {
isOpen: false,
isLoading: false,
direction: Direction.START,
- openModals: [
- // { modalId: ModalId.Claim_FundWithdraw }
- ] as OpenModal[],
+ flows: [],
+ toOpenLater: null,
+ openModals: [] as OpenModal[],
} as StoreState;
export const modalSlice = createSlice({
@@ -50,15 +52,32 @@ export const modalSlice = createSlice({
state.direction = action.payload;
},
+ scheduleModal(state, action: PayloadAction) {
+ state.toOpenLater = action.payload;
+ },
+
+ openSceduledModal(state) {
+ if (state.toOpenLater) {
+ state.direction = Direction.START;
+ state.isOpen = true;
+ state.openModals.push(state.toOpenLater);
+ state.toOpenLater = null;
+ }
+ },
+
+ removeScheduledModal(state) {
+ state.toOpenLater = null;
+ },
+
openModal(
state,
- action: PayloadAction<{ modalId: ModalId; initialModalProps?: any }>
+ action: PayloadAction<{ modalId: ModalId; propsToPass?: any }>
) {
state.direction = Direction.START;
state.isOpen = true;
state.openModals.push({
modalId: action.payload.modalId,
- propsToPass: action.payload.initialModalProps || {},
+ propsToPass: action.payload.propsToPass,
});
},
@@ -66,7 +85,7 @@ export const modalSlice = createSlice({
state,
action: PayloadAction<{
modalId: ModalId;
- initialModalProps?: any;
+ propsToPass?: any;
direction: Direction;
}>
) {
@@ -74,7 +93,7 @@ export const modalSlice = createSlice({
state.openModals.pop();
state.openModals.push({
modalId: action.payload.modalId,
- propsToPass: action.payload.initialModalProps || {},
+ propsToPass: action.payload.propsToPass || {},
});
},
@@ -91,6 +110,9 @@ export const {
openModal,
replaceModal,
setDirection,
+ scheduleModal,
+ openSceduledModal,
+ removeScheduledModal,
} = modalSlice.actions;
export default modalSlice.reducer;
diff --git a/src/redux/features/project.slice.ts b/src/redux/features/project.slice.ts
new file mode 100644
index 0000000..149ca23
--- /dev/null
+++ b/src/redux/features/project.slice.ts
@@ -0,0 +1,30 @@
+import { createSlice, PayloadAction } from "@reduxjs/toolkit";
+import { Project } from "../../utils/interfaces";
+
+import mockData from "../../api/mockData.json";
+
+interface StoreState {
+ project: Project | null;
+}
+
+const initialState = {
+ project: mockData.project,
+} as StoreState;
+
+export const projectSlice = createSlice({
+ name: "project",
+ initialState,
+ reducers: {
+ setProject(state, action: PayloadAction) {
+ state.project = action.payload;
+ },
+
+ unsetProject(state) {
+ state.project = null;
+ },
+ },
+});
+
+export const { setProject } = projectSlice.actions;
+
+export default projectSlice.reducer;
diff --git a/src/redux/features/wallet.slice.ts b/src/redux/features/wallet.slice.ts
index 2344be7..5c38389 100644
--- a/src/redux/features/wallet.slice.ts
+++ b/src/redux/features/wallet.slice.ts
@@ -13,9 +13,13 @@ const initialState = {
export const walletSlice = createSlice({
name: "wallet",
initialState,
- reducers: {},
+ reducers: {
+ connectWallet(state) {
+ state.isConnected = true;
+ },
+ },
});
-export const {} = walletSlice.actions;
+export const { connectWallet } = walletSlice.actions;
export default walletSlice.reducer;
diff --git a/src/redux/store.ts b/src/redux/store.ts
index eb54e3e..c8f388c 100644
--- a/src/redux/store.ts
+++ b/src/redux/store.ts
@@ -1,9 +1,13 @@
import { configureStore } from "@reduxjs/toolkit";
import modalsSlice from "./features/modals.slice";
+import projectSlice from "./features/project.slice";
+import walletSlice from "./features/wallet.slice";
export const store = configureStore({
reducer: {
modals: modalsSlice,
+ project: projectSlice,
+ wallet: walletSlice,
},
});