diff --git a/src/components/molecules/projectDisplay/ActivityBrief.tsx b/src/components/molecules/projectDisplay/ActivityBrief.tsx
index fc2cdbd70..bb8514149 100644
--- a/src/components/molecules/projectDisplay/ActivityBrief.tsx
+++ b/src/components/molecules/projectDisplay/ActivityBrief.tsx
@@ -9,16 +9,16 @@ import {
VStack,
} from '@chakra-ui/react'
import { useEffect, useMemo, useState } from 'react'
-import { AiOutlineEllipsis } from 'react-icons/ai'
import { useTranslation } from 'react-i18next'
+import { AiOutlineEllipsis } from 'react-icons/ai'
import { ExternalAccountType } from '../../../pages/auth'
-import { Countdown } from "../../../pages/projectView/projectActivityPanel/components"
+import { Countdown } from '../../../pages/projectView/projectActivityPanel/components'
import {
FunderWithUserFragment,
ProjectFragment,
ProjectMilestone,
-} from "../../../types"
+} from '../../../types'
import { isActive } from '../../../utils'
import { getProjectBalance } from '../../../utils/helpers'
import { SatoshiAmount } from '../../ui'
@@ -203,9 +203,11 @@ export const ActivityBrief = ({
size="lg"
variant="transparent"
>
- {t('Supporters')}
+ {loading || latestFunders.length ? (
+ {t('Supporters')}
+ ) : null}
- {latestFunders.length > 0
+ {!loading
? latestFunders.map((funder) => {
return (
({
+ color: `${colorScheme}.400`,
+ control: {
+ _checked: {
+ color: `${colorScheme}.400`,
+ },
+ },
+ }),
+ },
+ defaultProps: {
+ variant: 'primary',
+ colorScheme: 'primary',
+ },
+ },
Radio: {
variants: {
primary: ({ colorScheme = 'primary' }: StyleFunctionProps) => ({
diff --git a/src/defaults/projectReward.ts b/src/defaults/projectReward.ts
index afeadfa09..0d565bfb0 100644
--- a/src/defaults/projectReward.ts
+++ b/src/defaults/projectReward.ts
@@ -9,5 +9,8 @@ export const defaultProjectReward: ProjectReward = {
deleted: false,
stock: 0,
sold: 0,
+ hasShipping: false,
+ createdAt: new Date(),
+ updatedAt: new Date(),
project: {} as Project,
}
diff --git a/src/graphql/fragments/project.ts b/src/graphql/fragments/project.ts
index 26d60d628..35dddc80e 100644
--- a/src/graphql/fragments/project.ts
+++ b/src/graphql/fragments/project.ts
@@ -66,6 +66,7 @@ export const FRAGMENT_PROJECT_REWARD_FOR_CREATE_UPDATE = gql`
deleted
stock
sold
+ hasShipping
}
`
diff --git a/src/graphql/mutations/project.ts b/src/graphql/mutations/project.ts
index f8995d4da..8374605af 100644
--- a/src/graphql/mutations/project.ts
+++ b/src/graphql/mutations/project.ts
@@ -65,8 +65,8 @@ export const MUTATION_UPDATE_PROJECT = gql`
export const MUTATION_CREATE_PROJECT_REWARD = gql`
${FRAGMENT_PROJECT_REWARD_FOR_CREATE_UPDATE}
- mutation CreateProjectReward($input: CreateProjectRewardInput!) {
- createProjectReward(input: $input) {
+ mutation ProjectRewardCreate($input: CreateProjectRewardInput!) {
+ projectRewardCreate(input: $input) {
...ProjectRewardForCreateUpdate
}
}
@@ -74,8 +74,8 @@ export const MUTATION_CREATE_PROJECT_REWARD = gql`
export const MUTATION_UPDATE_PROJECT_REWARD = gql`
${FRAGMENT_PROJECT_REWARD_FOR_CREATE_UPDATE}
- mutation UpdateProjectReward($input: UpdateProjectRewardInput!) {
- updateProjectReward(input: $input) {
+ mutation ProjectRewardUpdate($input: UpdateProjectRewardInput!) {
+ projectRewardUpdate(input: $input) {
...ProjectRewardForCreateUpdate
}
}
diff --git a/src/hooks/useFundingFormState.tsx b/src/hooks/useFundingFormState.tsx
index 2278bba9d..6cf1dc909 100644
--- a/src/hooks/useFundingFormState.tsx
+++ b/src/hooks/useFundingFormState.tsx
@@ -45,6 +45,8 @@ export const useFundingFormState = ({ rewards }: UseFundStateProps) => {
const { user, isAnonymous } = useContext(AuthContext)
const { getUSDCentsAmount } = useBTCConverter()
+ const [needsShipping, setNeedsShipping] = useState(false)
+
const initialState: IFundForm = useMemo(
() => ({
donationAmount: 0,
@@ -89,6 +91,7 @@ export const useFundingFormState = ({ rewards }: UseFundStateProps) => {
rewardsCost: 0,
totalAmount: current.donationAmount,
}))
+ setNeedsShipping(false)
}, [])
const updateReward = useCallback(
@@ -113,6 +116,10 @@ export const useFundingFormState = ({ rewards }: UseFundStateProps) => {
)
if (reward && reward.id) {
+ if (reward.hasShipping) {
+ setNeedsShipping((current) => current || reward.hasShipping)
+ }
+
const rewardMultiplier = newRewardsCountInfo[rewardID.toString()]
if (!rewardMultiplier) {
return 0
@@ -142,8 +149,18 @@ export const useFundingFormState = ({ rewards }: UseFundStateProps) => {
const resetForm = useCallback(() => {
_setState(initialState)
+ setNeedsShipping(false)
}, [initialState])
+ const hasSelectedRewards = useMemo(
+ () =>
+ Boolean(
+ state.rewardsByIDAndCount &&
+ Object.keys(state.rewardsByIDAndCount).length > 0,
+ ),
+ [state.rewardsByIDAndCount],
+ )
+
return {
state,
setTarget,
@@ -151,5 +168,7 @@ export const useFundingFormState = ({ rewards }: UseFundStateProps) => {
updateReward,
resetForm,
resetRewards,
+ needsShipping,
+ hasSelectedRewards,
}
}
diff --git a/src/pages/projectView/projectMainBody/components/ContributionInfoBox.tsx b/src/pages/projectView/projectActivityPanel/components/ContributionInfoBox.tsx
similarity index 100%
rename from src/pages/projectView/projectMainBody/components/ContributionInfoBox.tsx
rename to src/pages/projectView/projectActivityPanel/components/ContributionInfoBox.tsx
diff --git a/src/pages/projectView/projectActivityPanel/components/ContributionShippingBox.tsx b/src/pages/projectView/projectActivityPanel/components/ContributionShippingBox.tsx
new file mode 100644
index 000000000..57a84c3bd
--- /dev/null
+++ b/src/pages/projectView/projectActivityPanel/components/ContributionShippingBox.tsx
@@ -0,0 +1,33 @@
+import { Text, VStack } from '@chakra-ui/react'
+import { useTranslation } from 'react-i18next'
+
+import { useProjectContext } from '../../../../context'
+import { CreatorEmailButton } from './CreatorEmailButton'
+import { CreatorEmailContentButton } from './CreatorEmailContentButton'
+
+export const ContributionShippingBox = () => {
+ const { t } = useTranslation()
+ const { project } = useProjectContext()
+ const ownerEmail = project?.owners[0]?.user.email || ''
+ return (
+
+ {t('Shipping')}
+
+ {t(
+ "To receive the selected items, you need to send your shipping details to the creator's email.",
+ )}
+
+
+
+
+
+ )
+}
diff --git a/src/pages/projectView/projectActivityPanel/components/CreatorEmailButton.tsx b/src/pages/projectView/projectActivityPanel/components/CreatorEmailButton.tsx
new file mode 100644
index 000000000..2cef5e797
--- /dev/null
+++ b/src/pages/projectView/projectActivityPanel/components/CreatorEmailButton.tsx
@@ -0,0 +1,37 @@
+import { CopyIcon } from '@chakra-ui/icons'
+import { Box, Button, ButtonProps } from '@chakra-ui/react'
+import { useState } from 'react'
+
+import { copyTextToClipboard } from '../../../../utils'
+
+export const CreatorEmailButton = ({
+ email,
+ ...props
+}: { email: string } & ButtonProps) => {
+ const [isEmailCopied, setEmailCopied] = useState(false)
+
+ const handleCopyEmail = () => {
+ copyTextToClipboard(email)
+
+ setEmailCopied(true)
+ setTimeout(() => {
+ setEmailCopied(false)
+ }, 1000)
+ }
+
+ return (
+ }
+ {...props}
+ >
+
+ {email}
+
+
+ )
+}
diff --git a/src/pages/projectView/projectActivityPanel/components/CreatorEmailContentButton.tsx b/src/pages/projectView/projectActivityPanel/components/CreatorEmailContentButton.tsx
new file mode 100644
index 000000000..4a820eda4
--- /dev/null
+++ b/src/pages/projectView/projectActivityPanel/components/CreatorEmailContentButton.tsx
@@ -0,0 +1,101 @@
+import { CopyIcon } from '@chakra-ui/icons'
+import { HStack, StackProps, Text, VStack } from '@chakra-ui/react'
+import { useRef, useState } from 'react'
+import { useTranslation } from 'react-i18next'
+
+import { useProjectContext } from '../../../../context'
+import { copyTextToClipboard } from '../../../../utils'
+
+export const CreatorEmailContentButton = ({ ...props }: StackProps) => {
+ const { t } = useTranslation()
+ const [isCopied, setCopied] = useState(false)
+
+ const ref = useRef(null)
+
+ const {
+ project,
+ fundingFlow: { fundingTx },
+ fundForm: { state },
+ } = useProjectContext()
+
+ const handleCopyContent = () => {
+ const content = ref.current?.innerText || ''
+ copyTextToClipboard(content)
+
+ if (content) {
+ setCopied(true)
+ setTimeout(() => {
+ setCopied(false)
+ }, 1000)
+ }
+ }
+
+ const rewards = project ? project.rewards : []
+
+ const rewardEntries = state.rewardsByIDAndCount
+ ? Object.entries(state.rewardsByIDAndCount)
+ : []
+
+ if (!fundingTx) {
+ return null
+ }
+
+ return (
+
+
+
+ {t('Hi,\nI just purchased the following items on Geyser:')}{' '}
+
+ {rewardEntries.map(([key, value], index) => {
+ const reward = rewards.find(({ id }) => id === key)
+ if (reward) {
+ return (
+
+ {reward.name} x{value}
+ {index < rewardEntries.length - 1 ? ', ' : ''}
+
+ )
+ }
+ })}
+
+
+
+ {t('This is my reference code:')}
+
+
+ {fundingTx.uuid}
+
+
+ {t('I’d like it to be shipped to the following address:')}
+
+
+ {'<'}
+ {t('ADD RECEIVING POSTAL ADDRESS')}
+ {'>'}
+
+
+
+ {t('Cheers,')}
+
+
+
+
+ )
+}
diff --git a/src/pages/projectView/projectActivityPanel/components/FundingFormUserInfoSection.tsx b/src/pages/projectView/projectActivityPanel/components/FundingFormUserInfoSection.tsx
new file mode 100644
index 000000000..328f3d87c
--- /dev/null
+++ b/src/pages/projectView/projectActivityPanel/components/FundingFormUserInfoSection.tsx
@@ -0,0 +1,67 @@
+import { ArrowBackIcon } from '@chakra-ui/icons'
+import { Button, HStack, Input, VStack } from '@chakra-ui/react'
+import { MouseEventHandler } from 'react'
+import { useTranslation } from 'react-i18next'
+
+import { SectionTitle } from '../../../../components/ui'
+import { useProjectContext } from '../../../../context'
+import { FieldContainer } from '../../../../forms/components/FieldContainer'
+import { ProjectFundingFormCommentField } from '../../projectMainBody/components'
+
+type Props = {
+ onBackClick: MouseEventHandler
+}
+
+export const FundingFormUserInfoSection = ({ onBackClick }: Props) => {
+ const { t } = useTranslation()
+ const {
+ fundForm: {
+ setState,
+ setTarget,
+ needsShipping,
+ state: { comment, email },
+ },
+ } = useProjectContext()
+ return (
+
+
+
+ {t('Final details')}
+
+
+
+
+
+
+ {needsShipping ? (
+ <>
+
+
+
+
+ >
+ ) : null}
+
+ )
+}
diff --git a/src/pages/projectView/projectActivityPanel/components/ProjectFundingSummaryCard.tsx b/src/pages/projectView/projectActivityPanel/components/ProjectFundingSummaryCard.tsx
new file mode 100644
index 000000000..7f0d1a60e
--- /dev/null
+++ b/src/pages/projectView/projectActivityPanel/components/ProjectFundingSummaryCard.tsx
@@ -0,0 +1,119 @@
+import { Button, HStack, Text, VStack } from '@chakra-ui/react'
+import { FormEventHandler, forwardRef } from 'react'
+
+import { BoltIcon } from '../../../../components/icons'
+import { SatoshiAmount, SectionTitle } from '../../../../components/ui'
+import { useProjectContext } from '../../../../context'
+import { useFundCalc } from '../../../../helpers'
+
+type Props = {
+ onSubmit: () => void
+}
+
+export const ProjectFundingSummaryCard = forwardRef(
+ ({ onSubmit }, ref) => {
+ const { fundForm, project } = useProjectContext()
+
+ const { state: formState, hasSelectedRewards } = fundForm
+
+ const { getTotalAmount } = useFundCalc(formState)
+
+ const name = project ? project.name : ''
+ const rewards = project ? project.rewards : []
+ const hasRewards = rewards.length > 0
+
+ const handleSubmit: FormEventHandler = (e) => {
+ e.preventDefault()
+ e.stopPropagation()
+ onSubmit()
+ }
+
+ return (
+
+ )
+ },
+)
diff --git a/src/pages/projectView/projectActivityPanel/components/SuccessImageComponent.tsx b/src/pages/projectView/projectActivityPanel/components/SuccessImageComponent.tsx
index d0eb68b2c..aac3721dc 100644
--- a/src/pages/projectView/projectActivityPanel/components/SuccessImageComponent.tsx
+++ b/src/pages/projectView/projectActivityPanel/components/SuccessImageComponent.tsx
@@ -10,7 +10,7 @@ import {
import * as htmlToImage from 'html-to-image'
import { useState } from 'react'
import { useTranslation } from 'react-i18next'
-import { BiCopy, BiDownload } from 'react-icons/bi'
+import { BiCopy } from 'react-icons/bi'
import { HiOutlineCheck } from 'react-icons/hi'
import { Body2, H3 } from '../../../../components/typography'
@@ -37,22 +37,6 @@ export const SuccessImageComponent = ({
return null
}
- const handleDownload = async () => {
- try {
- const dataUrl = await getDataUrl()
- const link = document.createElement('a')
- link.download = `share-contribution-to-${project.name}.png`
- link.href = dataUrl
- link.click()
- } catch (error) {
- toast({
- status: 'error',
- title: 'Failed to download image',
- description: 'Please try again',
- })
- }
- }
-
const handleCopy = async () => {
try {
const dataUrl = await getDataUrl()
@@ -156,9 +140,14 @@ export const SuccessImageComponent = ({
-
+
-
-
- }
- onClick={handleDownload}
- >
-
- {t('Download')}
+ {t('Copy success image')}
diff --git a/src/pages/projectView/projectActivityPanel/index.tsx b/src/pages/projectView/projectActivityPanel/index.tsx
index cea5b12e6..7dcd5292d 100644
--- a/src/pages/projectView/projectActivityPanel/index.tsx
+++ b/src/pages/projectView/projectActivityPanel/index.tsx
@@ -15,7 +15,6 @@ import {
RewardFundingInput,
} from '../../../types'
import { toInt, useMobileMode } from '../../../utils'
-import { truthyFilter } from '../../../utils/array'
import { InfoPageSkeleton, ProjectFundingInitialInfoScreen } from './screens'
import {
ProjectFundingQRScreen,
@@ -42,13 +41,11 @@ export const ProjectActivityPanel = ({ resourceType, resourceId }: Props) => {
const { mobileView, setMobileView, project, fundingFlow, fundForm } =
useProjectContext()
- // required for knowing the rewards and the funds
const {
state: formState,
- setTarget,
setState: setFormState,
- updateReward,
resetForm,
+ hasSelectedRewards,
} = fundForm
const {
@@ -133,11 +130,7 @@ export const ProjectActivityPanel = ({ resourceType, resourceId }: Props) => {
},
}
- if (
- state.rewardsByIDAndCount &&
- Object.entries(state.rewardsByIDAndCount).length > 0 &&
- rewardsByIDAndCount
- ) {
+ if (hasSelectedRewards && rewardsByIDAndCount) {
const rewardsArray = Object.keys(rewardsByIDAndCount).map((key) => ({
id: toInt(key),
quantity: rewardsByIDAndCount[key as keyof ProjectReward],
@@ -177,15 +170,9 @@ export const ProjectActivityPanel = ({ resourceType, resourceId }: Props) => {
case fundingStages.form:
return (
)
@@ -227,7 +214,7 @@ export const ProjectActivityPanel = ({ resourceType, resourceId }: Props) => {
marginTop={isMobile ? '0px' : '20px'}
height="calc(100% - 20px)"
borderTopLeftRadius={isMobile ? 'initial' : '8px'}
- overflow="hidden"
+ overflowX="hidden"
borderTop={isMobile ? 'none' : '2px solid'}
borderLeft="2px solid"
borderColor="neutral.200"
diff --git a/src/pages/projectView/projectActivityPanel/screens/ProjectFundingSelectionFormScreen.tsx b/src/pages/projectView/projectActivityPanel/screens/ProjectFundingSelectionFormScreen.tsx
index 2c2f862dc..9717f2b47 100644
--- a/src/pages/projectView/projectActivityPanel/screens/ProjectFundingSelectionFormScreen.tsx
+++ b/src/pages/projectView/projectActivityPanel/screens/ProjectFundingSelectionFormScreen.tsx
@@ -1,78 +1,74 @@
-import {
- Box,
- Button,
- CloseButton,
- Divider,
- HStack,
- Text,
- VStack,
-} from '@chakra-ui/react'
-import { useRef } from 'react'
-import { useTranslation } from 'react-i18next'
+import { Box, CloseButton, Divider, VStack } from '@chakra-ui/react'
+import { useRef, useState } from 'react'
-import { BoltIcon } from '../../../../components/icons'
-import {
- SatoshiAmount,
- SectionTitle,
- TextInputBox,
-} from '../../../../components/ui'
import { MAX_FUNDING_AMOUNT_USD } from '../../../../constants'
-import { useFundCalc } from '../../../../helpers'
-import { IFundForm } from '../../../../hooks'
-import { IProjectType } from '../../../../interfaces'
-import { ProjectRewardForCreateUpdateFragment } from '../../../../types'
-import { useNotification } from '../../../../utils'
-import { ProjectFundingFormCommentField } from '../../projectMainBody/components'
-import { FundingFormSection } from '../components'
+import { useProjectContext } from '../../../../context'
+import { useFundCalc } from '../../../../helpers/fundingCalculation'
+import { ProjectRewardForCreateUpdateFragment } from '../../../../types/generated/graphql'
+import { useMobileMode, useNotification } from '../../../../utils'
+import { FundingFormSection } from '../components/FundingFormSection'
+import { FundingFormUserInfoSection } from '../components/FundingFormUserInfoSection'
+import { ProjectFundingSummaryCard } from '../components/ProjectFundingSummaryCard'
type Props = {
- isMobile?: boolean
handleCloseButton: () => void
- formState: IFundForm
- setTarget: (_: any) => void
- updateReward: any
- setFormState: any
handleFund: () => void
- type: IProjectType
rewards?: ProjectRewardForCreateUpdateFragment[]
name: string
}
export const ProjectFundingSelectionFormScreen = ({
- isMobile,
handleCloseButton,
handleFund,
- formState,
- setTarget,
- setFormState,
- updateReward,
rewards,
name,
}: Props) => {
- const { t } = useTranslation()
- const { getTotalAmount } = useFundCalc(formState)
+ const isMobile = useMobileMode()
+ const summaryCardRef = useRef(null)
+
+ const [step, setStep] = useState<'contribution' | 'info'>('contribution')
+
+ const {
+ fundForm: { state: formState, needsShipping },
+ } = useProjectContext()
+ const { getTotalAmount } = useFundCalc(formState)
const { toast } = useNotification()
- const commentContainerRef = useRef(null)
const hasRewards = rewards && rewards.length > 0
- const hasSelectedRewards =
- formState.rewardsByIDAndCount &&
- Object.entries(formState.rewardsByIDAndCount).length > 0
- const submit = () => {
- const valid = validateFundingAmount()
- if (valid) {
- handleFund()
+ const handleSubmit = {
+ contribution() {
+ const valid = validateFundingAmount()
+ if (valid) {
+ setStep('info')
+ }
+ },
+ info() {
+ const valid = validateFundingUserInfo()
+ if (valid) {
+ handleFund()
+ }
+ },
+ }
+
+ const validateFundingUserInfo = () => {
+ if (needsShipping && !formState.email) {
+ toast({
+ title: 'Email is a required field when donating for a reward.',
+ description: 'Please enter an email.',
+ status: 'error',
+ })
+ return false
}
+
+ return true
}
const validateFundingAmount = () => {
if (getTotalAmount('dollar', name) >= MAX_FUNDING_AMOUNT_USD) {
toast({
- title: `${t('Payment above')} ${MAX_FUNDING_AMOUNT_USD} ${t(
- 'is not allowed at the moment.',
- )}`,
+ title: `Payment above ${MAX_FUNDING_AMOUNT_USD} is not allowed at the moment.`,
description:
'Please update the amount, or contact us for donating a higher amount.',
status: 'error',
@@ -89,15 +85,6 @@ export const ProjectFundingSelectionFormScreen = ({
return false
}
- if (formState.rewardsCost && !formState.email) {
- toast({
- title: 'Email is a required field when donating for a reward.',
- description: 'Please enter an email.',
- status: 'error',
- })
- return false
- }
-
return true
}
@@ -110,8 +97,8 @@ export const ProjectFundingSelectionFormScreen = ({
alignItems="flex-start"
backgroundColor="neutral.0"
marginBottom={
- isMobile && commentContainerRef.current
- ? `${commentContainerRef.current.offsetHeight}px`
+ isMobile && summaryCardRef.current
+ ? `${summaryCardRef.current.offsetHeight}px`
: undefined
}
>
@@ -127,7 +114,13 @@ export const ProjectFundingSelectionFormScreen = ({
)}
-
+ {step === 'contribution' ? (
+
+ ) : (
+ setStep('contribution')}
+ />
+ )}
)}
-
-
- {t('Comment')}
-
-
-
- {formState.rewardsCost && (
-
-
-
- )}
-
-
-
- {hasRewards && hasSelectedRewards ? (
-
-
- {t('Rewards')}
-
-
- {formState.rewardsByIDAndCount &&
- Object.entries(formState.rewardsByIDAndCount).map(
- ([key, value]) => {
- const reward = rewards.find(({ id }) => id === key)
- if (reward) {
- return (
-
- {value}x {reward.name}
-
- )
- }
- },
- )}
-
-
- ) : null}
-
-
- {t('Total')}
-
-
-
- {getTotalAmount('sats', name)}
-
-
-
- {`($${getTotalAmount('dollar', name)})`}
-
-
-
-
-
- }
- onClick={submit}
- >
- {t('Fund Project')}
-
-
+
)
diff --git a/src/pages/projectView/projectActivityPanel/screens/SuccessScreen.tsx b/src/pages/projectView/projectActivityPanel/screens/SuccessScreen.tsx
index bc431f547..9da51684e 100644
--- a/src/pages/projectView/projectActivityPanel/screens/SuccessScreen.tsx
+++ b/src/pages/projectView/projectActivityPanel/screens/SuccessScreen.tsx
@@ -3,8 +3,6 @@ import { Button, CloseButton, VStack } from '@chakra-ui/react'
import { useEffect, useState } from 'react'
import ReactConfetti from 'react-confetti'
import { useTranslation } from 'react-i18next'
-import { BiCopyAlt } from 'react-icons/bi'
-import { HiOutlineSpeakerphone } from 'react-icons/hi'
import { Link } from 'react-router-dom'
import { getPath } from '../../../../constants'
@@ -19,12 +17,12 @@ import {
ProjectFragment,
UserBadge,
} from '../../../../types'
-import { copyTextToClipboard } from '../../../../utils'
import {
ContributionInfoBox,
ContributionInfoBoxVersion,
} from '../../projectMainBody/components'
import { SuccessImageComponent } from '../components'
+import { ContributionShippingBox } from '../components/ContributionShippingBox'
type Props = {
fundingState: IFundForm
@@ -44,11 +42,6 @@ export const SuccessScreen = ({
const { getTotalAmount } = useFundCalc(fundingState)
- const shareProjectWithFriends = () => {
- copyTextToClipboard(window.location.href)
- setCopy(true)
- }
-
const { data } = useQuery<{ userBadges: UserBadge[] }>(QUERY_USER_BADGES, {
variables: { input: { where: { fundingTxId: fundingTx.id } } },
})
@@ -78,7 +71,6 @@ export const SuccessScreen = ({
width="100%"
height={{ base: 'calc(100vh - 115px)', lg: '100%' }}
overflowX="hidden"
- overflowY={{ base: 'auto', lg: 'hidden' }}
position="relative"
backgroundColor="primary.400"
alignItems="center"
@@ -100,33 +92,17 @@ export const SuccessScreen = ({
currentBadge={currentBadge}
fundingTx={fundingTx}
/>
-
- {fundingTx.funder.user?.id && currentBadge && (
-
- )}
+ {fundingTx.funder.user?.id && currentBadge && (
:
- }
+ to={getPath('userProfile', fundingTx.funder.user?.id)}
width="100%"
- onClick={shareProjectWithFriends}
>
- {hasCopiedProjectLink
- ? t('Project link copied!')
- : t('Copy project link')}
+ {t('See badge in Profile')}
-
+ )}
+
+
)
diff --git a/src/pages/projectView/projectMainBody/components/RewardAdditionModal.tsx b/src/pages/projectView/projectMainBody/components/RewardAdditionModal.tsx
index eb9fb8eb7..4778fd81d 100644
--- a/src/pages/projectView/projectMainBody/components/RewardAdditionModal.tsx
+++ b/src/pages/projectView/projectMainBody/components/RewardAdditionModal.tsx
@@ -1,5 +1,6 @@
import {
- HStack,
+ Button,
+ Checkbox,
Input,
InputGroup,
InputLeftAddon,
@@ -7,31 +8,28 @@ import {
VStack,
} from '@chakra-ui/react'
import { useEffect, useState } from 'react'
+import { useTranslation } from 'react-i18next'
import { BiDollar } from 'react-icons/bi'
import { SatoshiIconTilted } from '../../../../components/icons'
import { Modal } from '../../../../components/layouts/Modal'
import { FileUpload } from '../../../../components/molecules'
import { Body2 } from '../../../../components/typography'
-import {
- ButtonComponent,
- ImageWithReload,
- TextArea,
- TextInputBox,
- UploadBox,
-} from '../../../../components/ui'
+import { TextArea, TextInputBox, UploadBox } from '../../../../components/ui'
import { ProjectRewardValidations } from '../../../../constants/validations'
import { defaultProjectReward } from '../../../../defaults'
+import { FieldContainer } from '../../../../forms/components/FieldContainer'
import {
CreateProjectRewardInput,
ProjectFragment,
ProjectRewardForCreateUpdateFragment,
RewardCurrency,
UpdateProjectRewardInput,
- useCreateProjectRewardMutation,
- useUpdateProjectRewardMutation,
+ useProjectRewardCreateMutation,
+ useProjectRewardUpdateMutation,
} from '../../../../types/generated/graphql'
import { commaFormatted, toInt, useNotification } from '../../../../utils'
+import { CreatorEmailButton } from '../../projectActivityPanel/components/CreatorEmailButton'
type Props = {
isOpen: boolean
@@ -55,8 +53,11 @@ export const RewardAdditionModal = ({
project,
props,
}: Props) => {
+ const { t } = useTranslation()
const { toast } = useNotification()
+ const ownerEmail = project.owners[0]?.user.email || ''
+
const [formCostDollarValue, setFormCostDollarValue] = useState(
defaultProjectReward.cost / 100,
)
@@ -67,9 +68,9 @@ export const RewardAdditionModal = ({
const [formError, setFormError] = useState({})
const [createReward, { loading: createRewardLoading }] =
- useCreateProjectRewardMutation({
+ useProjectRewardCreateMutation({
onCompleted(data) {
- onSubmit(data.createProjectReward, false)
+ onSubmit(data.projectRewardCreate, false)
onClose()
},
onError(error) {
@@ -82,14 +83,14 @@ export const RewardAdditionModal = ({
})
const [updateReward, { loading: updateRewardLoading }] =
- useUpdateProjectRewardMutation({
- onCompleted({ updateProjectReward }) {
+ useProjectRewardUpdateMutation({
+ onCompleted(data) {
toast({
title: 'Successfully updated!',
- description: `Reward ${updateProjectReward.name} was successfully updated`,
+ description: `Reward ${data.projectRewardUpdate.name} was successfully updated`,
status: 'success',
})
- onSubmit(updateProjectReward, true)
+ onSubmit(data.projectRewardUpdate, true)
onClose()
},
onError(error) {
@@ -110,6 +111,7 @@ export const RewardAdditionModal = ({
image: reward.image || undefined,
name: reward.name,
stock: reward.stock || undefined,
+ hasShipping: reward.hasShipping,
}
}
@@ -122,6 +124,7 @@ export const RewardAdditionModal = ({
image: reward.image || undefined,
name: reward.name,
stock: reward.stock || undefined,
+ hasShipping: reward.hasShipping,
}
}
@@ -186,6 +189,14 @@ export const RewardAdditionModal = ({
setReward((current) => ({ ...current, image: url }))
}
+ const handleDeleteThumbnail = () => {
+ setReward((current) => ({ ...current, image: null }))
+ }
+
+ const handleShipping = (event: React.ChangeEvent) => {
+ setReward((current) => ({ ...current, hasShipping: event.target.checked }))
+ }
+
const validateReward = () => {
const errors: any = {}
let isValid = true
@@ -234,6 +245,9 @@ export const RewardAdditionModal = ({
return (
@@ -245,21 +259,9 @@ export const RewardAdditionModal = ({
>
}
- isOpen={isOpen}
- onClose={onClose}
>
-
-
- Name
+
+
-
+
-
- Description
+
-
+
-
+
}
+ onDeleteClick={handleDeleteThumbnail}
+ childrenOnLoading={}
>
- {reward.image ? (
-
-
-
- ) : (
-
- )}
+
-
-
-
- Cost of Reward
+
+
{isSatoshi ? : }
@@ -326,18 +319,49 @@ export const RewardAdditionModal = ({
{formError.cost}
) : null}
-
-
-
-
-
+
+
+
+
+ {t('Includes Shipping')}
+
+ {reward.hasShipping ? (
+
+
+ {t(
+ 'Funders will see the following message in the shipping section. Make sure your email is up to date.',
+ )}
+
+
+ {t(
+ "To receive the selected items, you will need to send your shipping details to the creator's email. Which will be revealed in the success screen.",
+ )}
+
+
+
+
+ ) : null}
+
+
+
+
+
)
diff --git a/src/pages/projectView/projectMainBody/components/index.ts b/src/pages/projectView/projectMainBody/components/index.ts
index e66910f80..bb00196dd 100644
--- a/src/pages/projectView/projectMainBody/components/index.ts
+++ b/src/pages/projectView/projectMainBody/components/index.ts
@@ -1,5 +1,5 @@
+export * from '../../projectActivityPanel/components/ContributionInfoBox'
export * from './AvatarElement'
-export * from './ContributionInfoBox'
export * from './FollowButton'
export * from './FundingFormRewardItem'
export * from './LightningAddress'
diff --git a/src/translations/English.json b/src/translations/English.json
index 8c9bb81e2..98c47aed9 100644
--- a/src/translations/English.json
+++ b/src/translations/English.json
@@ -6,7 +6,7 @@
"contributors": "contributors",
"Filter by project tags": "Filter by project tags",
"Search": "Search",
- "View more tags":"View more tags",
+ "View more tags": "View more tags",
"Everywhere": "Everywhere",
"Filter by location": "Filter by location",
"Find country or region": "Find country or region",
@@ -39,9 +39,9 @@
"Login now to see activity from projects you funded or follow": "Login now to see activity from projects you funded or follow",
"Login": "Login",
"Projects": "Projects",
- "Contributions":"Contributions",
+ "Contributions": "Contributions",
"Entry": "Entry",
- "Rewards":"Rewards",
+ "Rewards": "Rewards",
"All activity": "All activity",
"Connect": "Connect",
"Connect to launch": "Connect to launch your idea and to appear as a contributor when you fund an initiative.",
@@ -71,9 +71,9 @@
"Entries": "Entries",
"Milestones": "Milestones",
"UNSTABLE WALLET": "UNSTABLE WALLET",
- "INACTIVE WALLET":"INACTIVE WALLET",
+ "INACTIVE WALLET": "INACTIVE WALLET",
"RUNNING": "RUNNING",
- "DRAFT":"DRAFT",
+ "DRAFT": "DRAFT",
"INACTIVE": "INACTIVE",
"The last time someone tried to send funds to this wallet, there was a liquidity issue.": "The last time someone tried to send funds to this wallet, there was a liquidity issue.",
"The last time someone tried to make a transaction to this project, the invoice generation failed.": "The last time someone tried to make a transaction to this project, the invoice generation failed.",
@@ -98,7 +98,7 @@
"You cannot publish an entry in an inactive project. Finish the project configuration or re-activate the project to publish this entry.": "You cannot publish an entry in an inactive project. Finish the project configuration or re-activate the project to publish this entry.",
"Delete reward": "Delete reward",
"Are you sure you want to remove the entry": "Are you sure you want to remove the entry",
- "Cancel" :"Cancel",
+ "Cancel": "Cancel",
"Confirm": "Confirm",
"Successfully removed entry": "Successfully removed entry",
"Failed to remove entry": "Failed to remove entry",
@@ -545,5 +545,18 @@
"Project story should be shorter than": "Project story should be shorter than",
"Project story should be shorter than 4000 characters.":"Project story should be shorter than 4000 characters.",
"Geyser is sponsoring 10M Sats to support bitcoin films, but it’s the community who decides who wins the grant. Vote with your Sats! 1 Sat = 1 vote. Grant funds will be distributed proportionally to the number of votes received while the grant is active.":"Geyser is sponsoring 10M Sats to support bitcoin films, but it’s the community who decides who wins the grant. Vote with your Sats! 1 Sat = 1 vote. Grant funds will be distributed proportionally to the number of votes received while the grant is active.",
- "This grant support video-game developers that have integrated or want to integrate bitcoin and lightning in their platforms. The aim is to celebrate and showcase the power of lightning micropayments to the use case of gaming. Yes, Bitcoin makes gaming fun and rewarding! This is a community-voting grant where the community grant fund distribution by voting. Vote with your Sats! 1 Sat = 1 vote. Grant funds will be distributed proportionally to the number of votes received while the grant is active.":"This grant support video-game developers that have integrated or want to integrate bitcoin and lightning in their platforms. The aim is to celebrate and showcase the power of lightning micropayments to the use case of gaming. Yes, Bitcoin makes gaming fun and rewarding! This is a community-voting grant where the community grant fund distribution by voting. Vote with your Sats! 1 Sat = 1 vote. Grant funds will be distributed proportionally to the number of votes received while the grant is active."
+ "This grant support video-game developers that have integrated or want to integrate bitcoin and lightning in their platforms. The aim is to celebrate and showcase the power of lightning micropayments to the use case of gaming. Yes, Bitcoin makes gaming fun and rewarding! This is a community-voting grant where the community grant fund distribution by voting. Vote with your Sats! 1 Sat = 1 vote. Grant funds will be distributed proportionally to the number of votes received while the grant is active.":"This grant support video-game developers that have integrated or want to integrate bitcoin and lightning in their platforms. The aim is to celebrate and showcase the power of lightning micropayments to the use case of gaming. Yes, Bitcoin makes gaming fun and rewarding! This is a community-voting grant where the community grant fund distribution by voting. Vote with your Sats! 1 Sat = 1 vote. Grant funds will be distributed proportionally to the number of votes received while the grant is active.",
+ "Includes Shipping": "Includes Shipping",
+ "Shipping": "Shipping",
+ "Public comment": "Public comment",
+ "Final details": "Final details",
+ "Hi,\nI just purchased the following items on Geyser:": "Hi,\nI just purchased the following items on Geyser:",
+ "This is my reference code:": "This is my reference code:",
+ "I’d like it to be shipped to the following address:": "I’d like it to be shipped to the following address:",
+ "ADD RECEIVING POSTAL ADDRESS": "ADD RECEIVING POSTAL ADDRESS",
+ "Cheers,": "Cheers,",
+ "Copy success image": "Copy success image",
+ "To receive the selected items, you need to send your shipping details to the creator's email.": "To receive the selected items, you need to send your shipping details to the creator's email.",
+ "To receive the selected items, you will need to send your shipping details to the creator's email. Which will be revealed in the success screen.": "To receive the selected items, you will need to send your shipping details to the creator's email. Which will be revealed in the success screen.",
+ "Funders will see the following message in the shipping section. Make sure your email is up to date.": "Funders will see the following message in the shipping section. Make sure your email is up to date."
}
diff --git a/src/types/generated/graphql.ts b/src/types/generated/graphql.ts
index 53b1f6cc9..2fa1f93d8 100644
--- a/src/types/generated/graphql.ts
+++ b/src/types/generated/graphql.ts
@@ -37,6 +37,7 @@ export type Scalars = {
comment_String_maxLength_280: any
cost_Int_NotNull_min_0: any
cost_Int_NotNull_min_1_max_1000000: any
+ cost_Int_min_1_max_1000000: any
description_String_NotNull_maxLength_250: any
description_String_NotNull_maxLength_2200: any
description_String_NotNull_maxLength_4000: any
@@ -195,6 +196,7 @@ export type CreateProjectRewardInput = {
/** Currency used for the cost */
costCurrency: RewardCurrency
description: Scalars['description_String_NotNull_maxLength_250']
+ hasShipping: Scalars['Boolean']
image?: InputMaybe
name: Scalars['name_String_NotNull_maxLength_100']
projectId: Scalars['BigInt']
@@ -593,6 +595,7 @@ export type Grant = {
__typename?: 'Grant'
applicants: Array
balance: Scalars['Int']
+ boardMembers: Array
description?: Maybe
id: Scalars['BigInt']
image?: Maybe
@@ -638,6 +641,11 @@ export type GrantApplyInput = {
projectId: Scalars['BigInt']
}
+export type GrantBoardMember = {
+ __typename?: 'GrantBoardMember'
+ user: User
+}
+
export type GrantGetInput = {
where: GrantGetWhereInput
}
@@ -785,6 +793,7 @@ export type Location = {
}
export enum MfaAction {
+ Login = 'LOGIN',
ProjectWalletUpdate = 'PROJECT_WALLET_UPDATE',
UserEmailUpdate = 'USER_EMAIL_UPDATE',
UserEmailVerification = 'USER_EMAIL_VERIFICATION',
@@ -797,7 +806,6 @@ export type Mutation = {
createEntry: Entry
createProject: Project
createProjectMilestone: ProjectMilestone
- createProjectReward: ProjectReward
createWallet: Wallet
deleteEntry: Entry
deleteProjectMilestone: Scalars['Boolean']
@@ -812,6 +820,8 @@ export type Mutation = {
grantApply: GrantApplicant
projectDelete: ProjectDeleteResponse
projectFollow: Scalars['Boolean']
+ projectRewardCreate: ProjectReward
+ projectRewardUpdate: ProjectReward
projectStatusUpdate: Project
projectTagAdd: Array
projectTagRemove: Array
@@ -828,7 +838,6 @@ export type Mutation = {
updateEntry: Entry
updateProject: Project
updateProjectMilestone: ProjectMilestone
- updateProjectReward: ProjectReward
updateUser: User
/** This operation is currently not supported. */
updateWallet: Wallet
@@ -856,10 +865,6 @@ export type MutationCreateProjectMilestoneArgs = {
input?: InputMaybe
}
-export type MutationCreateProjectRewardArgs = {
- input: CreateProjectRewardInput
-}
-
export type MutationCreateWalletArgs = {
input: CreateWalletInput
}
@@ -916,6 +921,14 @@ export type MutationProjectFollowArgs = {
input: ProjectFollowMutationInput
}
+export type MutationProjectRewardCreateArgs = {
+ input: CreateProjectRewardInput
+}
+
+export type MutationProjectRewardUpdateArgs = {
+ input: UpdateProjectRewardInput
+}
+
export type MutationProjectStatusUpdateArgs = {
input: ProjectStatusUpdate
}
@@ -937,7 +950,7 @@ export type MutationPublishEntryArgs = {
}
export type MutationSendOtpByEmailArgs = {
- action: MfaAction
+ input: SendOtpByEmailInput
}
export type MutationTagCreateArgs = {
@@ -960,10 +973,6 @@ export type MutationUpdateProjectMilestoneArgs = {
input?: InputMaybe
}
-export type MutationUpdateProjectRewardArgs = {
- input: UpdateProjectRewardInput
-}
-
export type MutationUpdateUserArgs = {
input: UpdateUserInput
}
@@ -1002,6 +1011,11 @@ export type OtpInput = {
otpVerificationToken: Scalars['String']
}
+export type OtpLoginInput = {
+ otp: Scalars['Int']
+ otpVerificationToken: Scalars['String']
+}
+
export type OtpResponse = {
__typename?: 'OTPResponse'
/** Expiration time of the OTP. Can be used to display a countdown to the user. */
@@ -1151,13 +1165,17 @@ export type ProjectReward = {
__typename?: 'ProjectReward'
/** Cost of the reward, priced in USD cents. */
cost: Scalars['Int']
+ createdAt: Scalars['Date']
/**
* Whether the reward is deleted or not. Deleted rewards should not appear in the funding flow. Moreover, deleted
* rewards should only be visible by the project owner and the users that purchased it.
*/
deleted: Scalars['Boolean']
+ deletedAt?: Maybe
/** Short description of the reward. */
description?: Maybe
+ /** Boolean value to indicate whether this reward requires shipping */
+ hasShipping: Scalars['Boolean']
id: Scalars['BigInt']
/** Image of the reward. */
image?: Maybe
@@ -1166,6 +1184,7 @@ export type ProjectReward = {
project: Project
sold: Scalars['Int']
stock?: Maybe
+ updatedAt: Scalars['Date']
}
export type ProjectStatistics = {
@@ -1385,6 +1404,11 @@ export type RewardInput = {
quantity: Scalars['quantity_Int_NotNull_min_1']
}
+export type SendOtpByEmailInput = {
+ action: MfaAction
+ email?: InputMaybe
+}
+
export enum ShippingDestination {
International = 'international',
National = 'national',
@@ -1519,14 +1543,15 @@ export type UpdateProjectMilestoneInput = {
export type UpdateProjectRewardInput = {
/** Cost of the reward, priced in USD cents */
- cost: Scalars['cost_Int_NotNull_min_1_max_1000000']
+ cost?: InputMaybe
/** Currency used for the cost */
- costCurrency: RewardCurrency
+ costCurrency?: InputMaybe
/** Soft deletes the reward. */
deleted?: InputMaybe
description?: InputMaybe
+ hasShipping?: InputMaybe
image?: InputMaybe
- name: Scalars['name_String_NotNull_maxLength_100']
+ name?: InputMaybe
projectRewardId: Scalars['BigInt']
stock?: InputMaybe
}
@@ -1937,6 +1962,7 @@ export type ResolversTypes = {
GrantApplicantFunding: ResolverTypeWrapper
GrantApplicantStatus: GrantApplicantStatus
GrantApplyInput: GrantApplyInput
+ GrantBoardMember: ResolverTypeWrapper
GrantGetInput: GrantGetInput
GrantGetWhereInput: GrantGetWhereInput
GrantStatistics: ResolverTypeWrapper
@@ -1963,6 +1989,7 @@ export type ResolversTypes = {
| ResolversTypes['DeleteUserResponse']
| ResolversTypes['ProjectDeleteResponse']
OTPInput: OtpInput
+ OTPLoginInput: OtpLoginInput
OTPResponse: ResolverTypeWrapper
OffsetBasedPaginationInput: OffsetBasedPaginationInput
OrderByOptions: OrderByOptions
@@ -1995,6 +2022,7 @@ export type ResolversTypes = {
RewardCurrency: RewardCurrency
RewardFundingInput: RewardFundingInput
RewardInput: RewardInput
+ SendOtpByEmailInput: SendOtpByEmailInput
ShippingDestination: ShippingDestination
ShippingInput: ShippingInput
SignedUploadUrl: ResolverTypeWrapper
@@ -2047,6 +2075,9 @@ export type ResolversTypes = {
cost_Int_NotNull_min_1_max_1000000: ResolverTypeWrapper<
Scalars['cost_Int_NotNull_min_1_max_1000000']
>
+ cost_Int_min_1_max_1000000: ResolverTypeWrapper<
+ Scalars['cost_Int_min_1_max_1000000']
+ >
description_String_NotNull_maxLength_250: ResolverTypeWrapper<
Scalars['description_String_NotNull_maxLength_250']
>
@@ -2210,6 +2241,7 @@ export type ResolversParentTypes = {
GrantApplicant: GrantApplicant
GrantApplicantFunding: GrantApplicantFunding
GrantApplyInput: GrantApplyInput
+ GrantBoardMember: GrantBoardMember
GrantGetInput: GrantGetInput
GrantGetWhereInput: GrantGetWhereInput
GrantStatistics: GrantStatistics
@@ -2232,6 +2264,7 @@ export type ResolversParentTypes = {
| ResolversParentTypes['DeleteUserResponse']
| ResolversParentTypes['ProjectDeleteResponse']
OTPInput: OtpInput
+ OTPLoginInput: OtpLoginInput
OTPResponse: OtpResponse
OffsetBasedPaginationInput: OffsetBasedPaginationInput
Owner: Owner
@@ -2260,6 +2293,7 @@ export type ResolversParentTypes = {
ResourceInput: ResourceInput
RewardFundingInput: RewardFundingInput
RewardInput: RewardInput
+ SendOtpByEmailInput: SendOtpByEmailInput
ShippingInput: ShippingInput
SignedUploadUrl: SignedUploadUrl
SourceResource: ResolversUnionTypes['SourceResource']
@@ -2298,6 +2332,7 @@ export type ResolversParentTypes = {
comment_String_maxLength_280: Scalars['comment_String_maxLength_280']
cost_Int_NotNull_min_0: Scalars['cost_Int_NotNull_min_0']
cost_Int_NotNull_min_1_max_1000000: Scalars['cost_Int_NotNull_min_1_max_1000000']
+ cost_Int_min_1_max_1000000: Scalars['cost_Int_min_1_max_1000000']
description_String_NotNull_maxLength_250: Scalars['description_String_NotNull_maxLength_250']
description_String_NotNull_maxLength_2200: Scalars['description_String_NotNull_maxLength_2200']
description_String_NotNull_maxLength_4000: Scalars['description_String_NotNull_maxLength_4000']
@@ -2680,6 +2715,11 @@ export type GrantResolvers<
ContextType
>
balance?: Resolver
+ boardMembers?: Resolver<
+ Array,
+ ParentType,
+ ContextType
+ >
description?: Resolver<
Maybe,
ParentType,
@@ -2733,6 +2773,14 @@ export type GrantApplicantFundingResolvers<
__isTypeOf?: IsTypeOfResolverFn
}
+export type GrantBoardMemberResolvers<
+ ContextType = any,
+ ParentType extends ResolversParentTypes['GrantBoardMember'] = ResolversParentTypes['GrantBoardMember'],
+> = {
+ user?: Resolver
+ __isTypeOf?: IsTypeOfResolverFn
+}
+
export type GrantStatisticsResolvers<
ContextType = any,
ParentType extends ResolversParentTypes['GrantStatistics'] = ResolversParentTypes['GrantStatistics'],
@@ -2882,12 +2930,6 @@ export type MutationResolvers<
ContextType,
Partial
>
- createProjectReward?: Resolver<
- ResolversTypes['ProjectReward'],
- ParentType,
- ContextType,
- RequireFields
- >
createWallet?: Resolver<
ResolversTypes['Wallet'],
ParentType,
@@ -2972,6 +3014,18 @@ export type MutationResolvers<
ContextType,
RequireFields
>
+ projectRewardCreate?: Resolver<
+ ResolversTypes['ProjectReward'],
+ ParentType,
+ ContextType,
+ RequireFields
+ >
+ projectRewardUpdate?: Resolver<
+ ResolversTypes['ProjectReward'],
+ ParentType,
+ ContextType,
+ RequireFields
+ >
projectStatusUpdate?: Resolver<
ResolversTypes['Project'],
ParentType,
@@ -3006,7 +3060,7 @@ export type MutationResolvers<
ResolversTypes['OTPResponse'],
ParentType,
ContextType,
- RequireFields
+ RequireFields
>
tagCreate?: Resolver<
ResolversTypes['Tag'],
@@ -3038,12 +3092,6 @@ export type MutationResolvers<
ContextType,
Partial
>
- updateProjectReward?: Resolver<
- ResolversTypes['ProjectReward'],
- ParentType,
- ContextType,
- RequireFields
- >
updateUser?: Resolver<
ResolversTypes['User'],
ParentType,
@@ -3306,12 +3354,15 @@ export type ProjectRewardResolvers<
ParentType extends ResolversParentTypes['ProjectReward'] = ResolversParentTypes['ProjectReward'],
> = {
cost?: Resolver
+ createdAt?: Resolver
deleted?: Resolver
+ deletedAt?: Resolver, ParentType, ContextType>
description?: Resolver<
Maybe,
ParentType,
ContextType
>
+ hasShipping?: Resolver
id?: Resolver
image?: Resolver, ParentType, ContextType>
name?: Resolver<
@@ -3322,6 +3373,7 @@ export type ProjectRewardResolvers<
project?: Resolver
sold?: Resolver
stock?: Resolver, ParentType, ContextType>
+ updatedAt?: Resolver
__isTypeOf?: IsTypeOfResolverFn
}
@@ -3764,6 +3816,14 @@ export interface Cost_Int_NotNull_Min_1_Max_1000000ScalarConfig
name: 'cost_Int_NotNull_min_1_max_1000000'
}
+export interface Cost_Int_Min_1_Max_1000000ScalarConfig
+ extends GraphQLScalarTypeConfig<
+ ResolversTypes['cost_Int_min_1_max_1000000'],
+ any
+ > {
+ name: 'cost_Int_min_1_max_1000000'
+}
+
export interface Description_String_NotNull_MaxLength_250ScalarConfig
extends GraphQLScalarTypeConfig<
ResolversTypes['description_String_NotNull_maxLength_250'],
@@ -4015,6 +4075,7 @@ export type Resolvers = {
Grant?: GrantResolvers
GrantApplicant?: GrantApplicantResolvers
GrantApplicantFunding?: GrantApplicantFundingResolvers
+ GrantBoardMember?: GrantBoardMemberResolvers
GrantStatistics?: GrantStatisticsResolvers
GrantStatisticsApplicant?: GrantStatisticsApplicantResolvers
GrantStatisticsGrant?: GrantStatisticsGrantResolvers
@@ -4057,6 +4118,7 @@ export type Resolvers = {
comment_String_maxLength_280?: GraphQLScalarType
cost_Int_NotNull_min_0?: GraphQLScalarType
cost_Int_NotNull_min_1_max_1000000?: GraphQLScalarType
+ cost_Int_min_1_max_1000000?: GraphQLScalarType
description_String_NotNull_maxLength_250?: GraphQLScalarType
description_String_NotNull_maxLength_2200?: GraphQLScalarType
description_String_NotNull_maxLength_4000?: GraphQLScalarType
@@ -4303,6 +4365,7 @@ export type ProjectRewardForCreateUpdateFragment = {
deleted: boolean
stock?: number | null
sold: number
+ hasShipping: boolean
}
export type ProjectFragment = {
@@ -4660,24 +4723,24 @@ export type UpdateProjectMutation = {
}
}
-export type CreateProjectRewardMutationVariables = Exact<{
+export type ProjectRewardCreateMutationVariables = Exact<{
input: CreateProjectRewardInput
}>
-export type CreateProjectRewardMutation = {
+export type ProjectRewardCreateMutation = {
__typename?: 'Mutation'
- createProjectReward: {
+ projectRewardCreate: {
__typename?: 'ProjectReward'
} & ProjectRewardForCreateUpdateFragment
}
-export type UpdateProjectRewardMutationVariables = Exact<{
+export type ProjectRewardUpdateMutationVariables = Exact<{
input: UpdateProjectRewardInput
}>
-export type UpdateProjectRewardMutation = {
+export type ProjectRewardUpdateMutation = {
__typename?: 'Mutation'
- updateProjectReward: {
+ projectRewardUpdate: {
__typename?: 'ProjectReward'
} & ProjectRewardForCreateUpdateFragment
}
@@ -5758,6 +5821,7 @@ export const ProjectRewardForCreateUpdateFragmentDoc = gql`
deleted
stock
sold
+ hasShipping
}
`
export const EntryForProjectFragmentDoc = gql`
@@ -6765,107 +6829,107 @@ export type UpdateProjectMutationOptions = Apollo.BaseMutationOptions<
UpdateProjectMutation,
UpdateProjectMutationVariables
>
-export const CreateProjectRewardDocument = gql`
- mutation CreateProjectReward($input: CreateProjectRewardInput!) {
- createProjectReward(input: $input) {
+export const ProjectRewardCreateDocument = gql`
+ mutation ProjectRewardCreate($input: CreateProjectRewardInput!) {
+ projectRewardCreate(input: $input) {
...ProjectRewardForCreateUpdate
}
}
${ProjectRewardForCreateUpdateFragmentDoc}
`
-export type CreateProjectRewardMutationFn = Apollo.MutationFunction<
- CreateProjectRewardMutation,
- CreateProjectRewardMutationVariables
+export type ProjectRewardCreateMutationFn = Apollo.MutationFunction<
+ ProjectRewardCreateMutation,
+ ProjectRewardCreateMutationVariables
>
/**
- * __useCreateProjectRewardMutation__
+ * __useProjectRewardCreateMutation__
*
- * To run a mutation, you first call `useCreateProjectRewardMutation` within a React component and pass it any options that fit your needs.
- * When your component renders, `useCreateProjectRewardMutation` returns a tuple that includes:
+ * To run a mutation, you first call `useProjectRewardCreateMutation` within a React component and pass it any options that fit your needs.
+ * When your component renders, `useProjectRewardCreateMutation` returns a tuple that includes:
* - A mutate function that you can call at any time to execute the mutation
* - An object with fields that represent the current status of the mutation's execution
*
* @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2;
*
* @example
- * const [createProjectRewardMutation, { data, loading, error }] = useCreateProjectRewardMutation({
+ * const [projectRewardCreateMutation, { data, loading, error }] = useProjectRewardCreateMutation({
* variables: {
* input: // value for 'input'
* },
* });
*/
-export function useCreateProjectRewardMutation(
+export function useProjectRewardCreateMutation(
baseOptions?: Apollo.MutationHookOptions<
- CreateProjectRewardMutation,
- CreateProjectRewardMutationVariables
+ ProjectRewardCreateMutation,
+ ProjectRewardCreateMutationVariables
>,
) {
const options = { ...defaultOptions, ...baseOptions }
return Apollo.useMutation<
- CreateProjectRewardMutation,
- CreateProjectRewardMutationVariables
- >(CreateProjectRewardDocument, options)
-}
-export type CreateProjectRewardMutationHookResult = ReturnType<
- typeof useCreateProjectRewardMutation
->
-export type CreateProjectRewardMutationResult =
- Apollo.MutationResult
-export type CreateProjectRewardMutationOptions = Apollo.BaseMutationOptions<
- CreateProjectRewardMutation,
- CreateProjectRewardMutationVariables
->
-export const UpdateProjectRewardDocument = gql`
- mutation UpdateProjectReward($input: UpdateProjectRewardInput!) {
- updateProjectReward(input: $input) {
+ ProjectRewardCreateMutation,
+ ProjectRewardCreateMutationVariables
+ >(ProjectRewardCreateDocument, options)
+}
+export type ProjectRewardCreateMutationHookResult = ReturnType<
+ typeof useProjectRewardCreateMutation
+>
+export type ProjectRewardCreateMutationResult =
+ Apollo.MutationResult
+export type ProjectRewardCreateMutationOptions = Apollo.BaseMutationOptions<
+ ProjectRewardCreateMutation,
+ ProjectRewardCreateMutationVariables
+>
+export const ProjectRewardUpdateDocument = gql`
+ mutation ProjectRewardUpdate($input: UpdateProjectRewardInput!) {
+ projectRewardUpdate(input: $input) {
...ProjectRewardForCreateUpdate
}
}
${ProjectRewardForCreateUpdateFragmentDoc}
`
-export type UpdateProjectRewardMutationFn = Apollo.MutationFunction<
- UpdateProjectRewardMutation,
- UpdateProjectRewardMutationVariables
+export type ProjectRewardUpdateMutationFn = Apollo.MutationFunction<
+ ProjectRewardUpdateMutation,
+ ProjectRewardUpdateMutationVariables
>
/**
- * __useUpdateProjectRewardMutation__
+ * __useProjectRewardUpdateMutation__
*
- * To run a mutation, you first call `useUpdateProjectRewardMutation` within a React component and pass it any options that fit your needs.
- * When your component renders, `useUpdateProjectRewardMutation` returns a tuple that includes:
+ * To run a mutation, you first call `useProjectRewardUpdateMutation` within a React component and pass it any options that fit your needs.
+ * When your component renders, `useProjectRewardUpdateMutation` returns a tuple that includes:
* - A mutate function that you can call at any time to execute the mutation
* - An object with fields that represent the current status of the mutation's execution
*
* @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2;
*
* @example
- * const [updateProjectRewardMutation, { data, loading, error }] = useUpdateProjectRewardMutation({
+ * const [projectRewardUpdateMutation, { data, loading, error }] = useProjectRewardUpdateMutation({
* variables: {
* input: // value for 'input'
* },
* });
*/
-export function useUpdateProjectRewardMutation(
+export function useProjectRewardUpdateMutation(
baseOptions?: Apollo.MutationHookOptions<
- UpdateProjectRewardMutation,
- UpdateProjectRewardMutationVariables
+ ProjectRewardUpdateMutation,
+ ProjectRewardUpdateMutationVariables
>,
) {
const options = { ...defaultOptions, ...baseOptions }
return Apollo.useMutation<
- UpdateProjectRewardMutation,
- UpdateProjectRewardMutationVariables
- >(UpdateProjectRewardDocument, options)
-}
-export type UpdateProjectRewardMutationHookResult = ReturnType<
- typeof useUpdateProjectRewardMutation
->
-export type UpdateProjectRewardMutationResult =
- Apollo.MutationResult
-export type UpdateProjectRewardMutationOptions = Apollo.BaseMutationOptions<
- UpdateProjectRewardMutation,
- UpdateProjectRewardMutationVariables
+ ProjectRewardUpdateMutation,
+ ProjectRewardUpdateMutationVariables
+ >(ProjectRewardUpdateDocument, options)
+}
+export type ProjectRewardUpdateMutationHookResult = ReturnType<
+ typeof useProjectRewardUpdateMutation
+>
+export type ProjectRewardUpdateMutationResult =
+ Apollo.MutationResult
+export type ProjectRewardUpdateMutationOptions = Apollo.BaseMutationOptions<
+ ProjectRewardUpdateMutation,
+ ProjectRewardUpdateMutationVariables
>
export const CreateProjectMilestoneDocument = gql`
mutation CreateProjectMilestone($input: CreateProjectMilestoneInput) {