diff --git a/src/modules/project/funding/state/fundingFormAtom.ts b/src/modules/project/funding/state/fundingFormAtom.ts
index b002f51da..719eddcee 100644
--- a/src/modules/project/funding/state/fundingFormAtom.ts
+++ b/src/modules/project/funding/state/fundingFormAtom.ts
@@ -37,6 +37,7 @@ export type FundFormType = {
email: string
media: string
comment: string
+ privateComment: string
rewardsByIDAndCount?: { [key: string]: number } | undefined
rewardCurrency: RewardCurrency
needsShipping: boolean
@@ -51,6 +52,7 @@ const initialState: FundFormType = {
shippingCost: 0,
totalAmount: 0,
comment: '',
+ privateComment: '',
email: '',
media: '',
rewardsByIDAndCount: undefined,
@@ -254,7 +256,6 @@ export const isFundingInputAmountValidAtom = atom((get) => {
}
}
- console.log('checking totalAmount', totalAmount)
if (!isException && walletLimits?.max && totalAmount >= walletLimits.max) {
return {
title: `Amount above the project wallet limit: ${commaFormatted(walletLimits.max)} sats.`,
diff --git a/src/modules/project/pages1/projectFunding/views/fundingDetails/FundingDetails.tsx b/src/modules/project/pages1/projectFunding/views/fundingDetails/FundingDetails.tsx
index c11c140b0..e0bac00a9 100644
--- a/src/modules/project/pages1/projectFunding/views/fundingDetails/FundingDetails.tsx
+++ b/src/modules/project/pages1/projectFunding/views/fundingDetails/FundingDetails.tsx
@@ -5,6 +5,7 @@ import { useFundingFormAtom } from '@/modules/project/funding/hooks/useFundingFo
import { getPath } from '@/shared/constants'
import { FundingLayout } from '../../layouts/FundingLayout'
+import { FundingDetailsPrivateCommentPrompt } from './sections/FundingDetailsPrivateCommentPrompt'
import { FundingDetailsBottomContent, FundingDetailsSideContent } from './sections/FundingDetailsSideContent'
import { FundingDetailsUserComment } from './sections/FundingDetailsUserComment'
import { FundingDetailsUserEmail } from './sections/FundingDetailsUserEmail'
@@ -27,6 +28,7 @@ export const FundingDetails = () => {
containerProps={{ spacing: 6 }}
>
+
)
diff --git a/src/modules/project/pages1/projectFunding/views/fundingDetails/sections/FundingDetailsPrivateCommentPrompt.tsx b/src/modules/project/pages1/projectFunding/views/fundingDetails/sections/FundingDetailsPrivateCommentPrompt.tsx
new file mode 100644
index 000000000..01390cfc9
--- /dev/null
+++ b/src/modules/project/pages1/projectFunding/views/fundingDetails/sections/FundingDetailsPrivateCommentPrompt.tsx
@@ -0,0 +1,69 @@
+import { ListItem, UnorderedList } from '@chakra-ui/react'
+import { t } from 'i18next'
+
+import { TextArea } from '@/components/ui'
+import { useFundingFormAtom } from '@/modules/project/funding/hooks/useFundingFormAtom'
+import { useRewardsAtom } from '@/modules/project/hooks/useProjectAtom'
+import { CardLayout } from '@/shared/components/layouts'
+import { Body, H1 } from '@/shared/components/typography'
+import { PrivateCommentPrompt } from '@/types'
+
+const privateCommentPromptMap: Record = {
+ [PrivateCommentPrompt.NostrNpub]: t('Provide your Nostr public address (npub)'),
+ [PrivateCommentPrompt.ProjectRewardSpecs]: t(
+ 'Specify your desired options for each reward, as mentioned on the rewards page.',
+ ),
+}
+
+export const FundingDetailsPrivateCommentPrompt = () => {
+ const { rewards } = useRewardsAtom()
+
+ const {
+ formState: { privateComment, rewardsByIDAndCount },
+ setTarget,
+ } = useFundingFormAtom()
+
+ const selectedRewards = rewards.filter((reward) => rewardsByIDAndCount && rewardsByIDAndCount[reward.id])
+
+ const mergedPrivateCommentPrompts = Array.from(
+ new Set(selectedRewards.flatMap((reward) => reward.privateCommentPrompts || [])),
+ )
+
+ return (
+
+
+ {t('Private message')}
+
+
+ {t(
+ 'Send a private message to the creator with a thank you note, feedback, or special requests. Sometimes, if you don’t provide these creator won’t be able to send you your reward.',
+ )}
+
+ {mergedPrivateCommentPrompts.length > 0 && (
+ <>
+
+ {t('The creator has requested the following information from you. Make sure you add in the message box:')}
+
+
+
+ {mergedPrivateCommentPrompts.map((prompt) => (
+ {privateCommentPromptMap[prompt]}
+ ))}
+
+ >
+ )}
+
+
+ )
+}
diff --git a/src/modules/project/pages1/projectView/views/rewards/hooks/useProjectRewardForm.ts b/src/modules/project/pages1/projectView/views/rewards/hooks/useProjectRewardForm.ts
index da94e64bc..c1bea4fdf 100644
--- a/src/modules/project/pages1/projectView/views/rewards/hooks/useProjectRewardForm.ts
+++ b/src/modules/project/pages1/projectView/views/rewards/hooks/useProjectRewardForm.ts
@@ -46,15 +46,7 @@ const rewardFormSchema = (soldAmount: number) =>
.typeError('Price is required')
.required('Price is required')
.min(0.01, 'Price must be greater than 0'),
- maxClaimable: yup
- .number()
- .nullable()
- .transform((value) => (isNaN(value) ? null : value))
- .min(0, 'Limited Edition must be greater than or equal to 0')
- .test('min-sold-amount', 'Limited edition must be at minimum the amount sold', function (value) {
- return value !== null && value !== undefined && value >= soldAmount
- })
- .transform((value) => (value === null ? null : Math.round(value))),
+ maxClaimable: yup.number().nullable(),
images: yup.array().of(yup.string()).max(MAX_REWARD_IMAGES, `Maximum ${MAX_REWARD_IMAGES} images allowed`),
hasShipping: yup.boolean(),
isAddon: yup.boolean(),