Skip to content

Commit

Permalink
Merge branch 'main' into staging
Browse files Browse the repository at this point in the history
* main:
  fix: display fix
  fix: correct currncy assertion
  • Loading branch information
sajald77 committed Oct 10, 2024
2 parents 16d2da2 + 39024f8 commit e9fd5e3
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ export const useProjectGoalForm = ({ goal, projectId, onClose }: UseProjectGoalF
const navigate = useNavigate()
const toast = useNotification()

const isBTC = goal?.currency === ProjectGoalCurrency.Btcsat
let isBTC = goal?.currency === ProjectGoalCurrency.Btcsat
const amountContributed = isBTC ? goal?.amountContributed || 0 : (goal?.amountContributed || 0) / 100

const { control, handleSubmit, reset, watch, formState, setValue, trigger } = useForm<FormValues>({
Expand Down Expand Up @@ -109,6 +109,10 @@ export const useProjectGoalForm = ({ goal, projectId, onClose }: UseProjectGoalF

const onSubmit = (formData: FormValues) => {
try {
if (!goal) {
isBTC = formData.currency === ProjectGoalCurrency.Btcsat
}

const trimmedTitle = typeof formData.title === 'string' ? formData.title.trim() : ''
const targetAmount = isBTC ? formData.targetAmount : dollarsToCents(Number(formData.targetAmount))

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export const GoalTarget = ({ goal, of }: GoalTargetProps) => {
return (
<HStack spacing={1}>
<Body size="sm" muted>
{of ? ` ${t('of')}: ` : ''}
{of ? ` ${t('of')} ` : ''}
<Body as="span" size="sm" dark>
{formattedTargetAmount}{' '}
</Body>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -490,7 +490,7 @@ export const ProjectRewardForm = ({
</VStack>
{reward.preOrder ? (
<FieldContainer title={t('Expected Availability Date')} boldTitle={true} flex={1}>
<div style={{ position: 'relative', width: '100%' }}>
<div style={{ position: 'relative', width: '100%', zIndex: 1000 }}>
<CalendarButton
onChange={handleFormCalendarChange}
value={reward.estimatedAvailabilityDate}
Expand Down

0 comments on commit e9fd5e3

Please sign in to comment.