Skip to content

Commit 7d91be4

Browse files
Merge pull request #27 from reserve-protocol/chore/success-msg
Chore: improve user contact info ui/ux
2 parents b7e2bd8 + 3715c36 commit 7d91be4

8 files changed

Lines changed: 39 additions & 25 deletions

File tree

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
## [2.2.1] - 2026-06-09
2+
3+
### Changed
4+
5+
- The zapper modal now fades in/out on open and dismiss (the previous animation classes were no-ops). The success view stays rendered through the fade-out: the success snapshot is now cleared when the modal opens instead of on close, so dismissing no longer flashes the empty Buy/Sell form mid-animation.
6+
- The success view's contact CTA is now inset inside the input and renamed from "Get updates" to "Subscribe", giving the input full width.
7+
18
## [2.2.0] - 2026-06-09
29

310
### Changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@reserve-protocol/react-zapper",
3-
"version": "2.2.0",
3+
"version": "2.2.1",
44
"type": "module",
55
"packageManager": "pnpm@11.1.1",
66
"description": "React component for DTF minting with zap functionality",

src/components/ui/dialog.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ const DialogOverlay = React.forwardRef<
1919
<DialogPrimitive.Overlay
2020
ref={ref}
2121
className={cn(
22-
'fixed inset-0 z-50 bg-black/50 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0',
22+
'fixed inset-0 z-50 bg-black/50 data-[state=open]:animate-dialog-in data-[state=closed]:animate-dialog-out',
2323
className
2424
)}
2525
{...props}
@@ -38,7 +38,7 @@ const DialogContent = React.forwardRef<
3838
<DialogPrimitive.Content
3939
ref={ref}
4040
className={cn(
41-
'fixed top-[100%] translate-y-[-100%] sm:top-[50%] sm:translate-y-[-50%] left-[50%] z-50 grid w-full sm:max-w-md translate-x-[-50%] gap-2 border-2 border-secondary bg-background px-5 py-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg',
41+
'fixed top-[100%] translate-y-[-100%] sm:top-[50%] sm:translate-y-[-50%] left-[50%] z-50 grid w-full sm:max-w-md translate-x-[-50%] gap-2 border-2 border-secondary bg-background px-5 py-6 shadow-lg data-[state=open]:animate-dialog-in data-[state=closed]:animate-dialog-out sm:rounded-lg',
4242
className
4343
)}
4444
{...props}

src/components/zap-mint/atom.ts

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { balancesAtom, chainIdAtom, indexDTFAtom } from '../../state/atoms'
55
import { Token, TokenBalance } from '../../types'
66
import { reducedZappableTokens } from '../../utils/constants'
77

8-
export const openZapMintModalAtom = atom(false)
8+
const openZapMintModalBaseAtom = atom(false)
99
export const zapperCurrentTabAtom = atom<'buy' | 'sell'>('buy')
1010
export const showZapSettingsAtom = atom<boolean>(false)
1111
export const zapMintInputAtom = atomWithReset<string>('')
@@ -32,6 +32,18 @@ export type ZapSuccessData = {
3232
}
3333
export const zapSuccessAtom = atom<ZapSuccessData | undefined>(undefined)
3434

35+
// The success snapshot is cleared when the modal opens rather than on close,
36+
// so the success view stays rendered through the dialog's fade-out animation.
37+
export const openZapMintModalAtom = atom(
38+
(get) => get(openZapMintModalBaseAtom),
39+
(get, set, update: boolean | ((prev: boolean) => boolean)) => {
40+
const prev = get(openZapMintModalBaseAtom)
41+
const next = typeof update === 'function' ? update(prev) : update
42+
if (next && !prev) set(zapSuccessAtom, undefined)
43+
set(openZapMintModalBaseAtom, next)
44+
}
45+
)
46+
3547
export const selectedTokenAtom = atom<Token | undefined>(undefined)
3648
export const defaultSelectedTokenAtom = atom<Token>((get) => {
3749
const chainId = get(chainIdAtom)

src/components/zap-mint/subscribe-updates.tsx

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ const Dropdown = ({
6565
{SOCIAL_MEDIA_OPTIONS.map((option) => (
6666
<DropdownMenuItem
6767
key={option.key}
68-
className="flex items-center gap-2 text-xs font-medium cursor-pointer"
68+
className="flex items-center gap-2 text-sm font-light cursor-pointer"
6969
onSelect={() => onSelectOption(option)}
7070
>
7171
{option.icon}
@@ -126,8 +126,8 @@ const SubscribeUpdates = ({
126126
)
127127

128128
return (
129-
<div className={cn('flex items-center gap-2', className)}>
130-
<div className="relative flex-1">
129+
<div className={cn(className)}>
130+
<div className="relative">
131131
<Dropdown
132132
selected={selected}
133133
onSelectOption={(option) => {
@@ -136,7 +136,7 @@ const SubscribeUpdates = ({
136136
}}
137137
/>
138138
<Input
139-
className="h-[49px] w-full rounded-xl bg-card/80 pl-14 text-sm"
139+
className="h-[49px] py-0 w-full rounded-xl bg-card/80 pl-14 pr-28 font-light"
140140
placeholder={selected.placeholder}
141141
value={value}
142142
onChange={(e) => !submitted && setValue(e.target.value)}
@@ -145,14 +145,14 @@ const SubscribeUpdates = ({
145145
if (e.key === 'Enter') handleSubmit(selected.key)
146146
}}
147147
/>
148+
<Button
149+
className="absolute right-1.5 top-1/2 h-9 -translate-y-1/2 rounded-lg"
150+
disabled={!value || submitted}
151+
onClick={() => handleSubmit(selected.key)}
152+
>
153+
Subscribe
154+
</Button>
148155
</div>
149-
<Button
150-
className="h-[49px] rounded-xl"
151-
disabled={!value || submitted}
152-
onClick={() => handleSubmit(selected.key)}
153-
>
154-
Get updates
155-
</Button>
156156
</div>
157157
)
158158
}

src/components/zap-mint/zap-success-view.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -139,9 +139,7 @@ const ZapSuccessView = ({ onClose }: { onClose: () => void }) => {
139139
</div>
140140

141141
{showContactInfo && (
142-
<div
143-
className="flex flex-col gap-4 rounded-2xl border border-[#e0d5c7] bg-[#fefbf8] p-4 opacity-0 animate-fade-in [animation-delay:300ms]"
144-
>
142+
<div className="flex flex-col gap-4 rounded-2xl border border-[#e0d5c7] bg-[#fefbf8] p-4 opacity-0 animate-fade-in [animation-delay:300ms]">
145143
<div className="flex flex-col gap-1">
146144
<p className="text-xl font-medium leading-7 text-primary">
147145
Stay informed about this DTF

src/components/zapper.tsx

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -58,13 +58,8 @@ const ZapperContent: React.FC<ZapperContentProps> = ({
5858

5959
const { trackClick } = useTrackIndexDTFZapClick('overview')
6060

61-
const handleOpenChange = (newOpen: boolean) => {
62-
setOpen(newOpen)
63-
if (!newOpen) setZapSuccess(undefined)
64-
}
65-
6661
const handleClose = () => {
67-
handleOpenChange(false)
62+
setOpen(false)
6863
}
6964

7065
useEffect(() => {
@@ -228,7 +223,7 @@ const ZapperContent: React.FC<ZapperContentProps> = ({
228223
)
229224

230225
const dialog = (
231-
<Dialog open={open} onOpenChange={handleOpenChange}>
226+
<Dialog open={open} onOpenChange={setOpen}>
232227
<DialogContent
233228
showClose={false}
234229
className="max-h-[90dvh] overflow-y-auto p-2 rounded-t-2xl sm:rounded-[20px] border-none"

tailwind.config.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,8 @@ export default {
115115
'accordion-up': 'accordion-up 0.2s ease-out',
116116
'fade-in': 'fade-in 0.5s ease-in-out 0s 1 forwards',
117117
'fade-out': 'fade-out 0.5s ease-in-out 0s 1 forwards',
118+
'dialog-in': 'fade-in 0.2s ease-out',
119+
'dialog-out': 'fade-out 0.2s ease-in forwards',
118120
'width-expand':
119121
'width-expand 0.4s cubic-bezier(0.25, 0.8, 0.25, 1) forwards',
120122
'spin-slow': 'spin-slow 4s linear infinite',

0 commit comments

Comments
 (0)