@@ -8,6 +8,7 @@ import type { UnsubscribeType } from '@/lib/api/contracts/user'
88import { AuthSubmitButton } from '@/app/(auth)/components'
99import { AUTH_BUTTON_CLASS } from '@/app/(auth)/components/constants'
1010import { InviteLayout } from '@/app/invite/components'
11+ import { InviteHeading } from '@/app/invite/components/invite-heading'
1112import { useUnsubscribe , useUnsubscribeMutation } from '@/hooks/queries/unsubscribe'
1213
1314function UnsubscribeContent ( ) {
@@ -39,10 +40,9 @@ function UnsubscribeContent() {
3940 if ( loading ) {
4041 return (
4142 < InviteLayout >
42- < div className = 'space-y-1 text-center' >
43- < h1 className = { 'text-[32px] text-[var(--text-primary)] tracking-tight' } > Loading</ h1 >
43+ < InviteHeading title = { 'Loading' } >
4444 < p className = { 'text-[var(--text-muted)] text-md' } > Validating your unsubscribe link…</ p >
45- </ div >
45+ </ InviteHeading >
4646 < div className = { 'mt-8 flex w-full items-center justify-center py-8' } >
4747 < Loader className = 'size-8 text-[var(--text-muted)]' animate />
4848 </ div >
@@ -53,12 +53,9 @@ function UnsubscribeContent() {
5353 if ( error ) {
5454 return (
5555 < InviteLayout >
56- < div className = 'space-y-1 text-center' >
57- < h1 className = { 'text-[32px] text-[var(--text-primary)] tracking-tight' } >
58- Invalid Unsubscribe Link
59- </ h1 >
56+ < InviteHeading title = { 'Invalid Unsubscribe Link' } >
6057 < p className = { 'text-[var(--text-muted)] text-md' } > { error } </ p >
61- </ div >
58+ </ InviteHeading >
6259
6360 < div className = { 'mt-8 w-full max-w-[410px] space-y-3' } >
6461 < AuthSubmitButton type = 'button' onClick = { ( ) => window . history . back ( ) } loadingLabel = '' >
@@ -72,15 +69,12 @@ function UnsubscribeContent() {
7269 if ( data ?. isTransactional ) {
7370 return (
7471 < InviteLayout >
75- < div className = 'space-y-1 text-center' >
76- < h1 className = { 'text-[32px] text-[var(--text-primary)] tracking-tight' } >
77- Important Account Emails
78- </ h1 >
72+ < InviteHeading title = { 'Important Account Emails' } >
7973 < p className = { 'text-[var(--text-muted)] text-md' } >
8074 Transactional emails like password resets, account confirmations, and security alerts
8175 cannot be unsubscribed from as they contain essential information for your account.
8276 </ p >
83- </ div >
77+ </ InviteHeading >
8478
8579 < div className = { 'mt-8 w-full max-w-[410px] space-y-3' } >
8680 < AuthSubmitButton type = 'button' onClick = { ( ) => window . close ( ) } loadingLabel = '' >
@@ -94,15 +88,12 @@ function UnsubscribeContent() {
9488 if ( unsubscribed ) {
9589 return (
9690 < InviteLayout >
97- < div className = 'space-y-1 text-center' >
98- < h1 className = { 'text-[32px] text-[var(--text-primary)] tracking-tight' } >
99- Successfully Unsubscribed
100- </ h1 >
91+ < InviteHeading title = { 'Successfully Unsubscribed' } >
10192 < p className = { 'text-[var(--text-muted)] text-md' } >
10293 You have been unsubscribed from our emails. You will stop receiving emails within 48
10394 hours.
10495 </ p >
105- </ div >
96+ </ InviteHeading >
10697
10798 < div className = { 'mt-8 w-full max-w-[410px] space-y-3' } >
10899 < AuthSubmitButton type = 'button' onClick = { ( ) => window . close ( ) } loadingLabel = '' >
@@ -117,15 +108,12 @@ function UnsubscribeContent() {
117108
118109 return (
119110 < InviteLayout >
120- < div className = 'space-y-1 text-center' >
121- < h1 className = { 'text-[32px] text-[var(--text-primary)] tracking-tight' } >
122- Email Preferences
123- </ h1 >
111+ < InviteHeading title = { 'Email Preferences' } >
124112 < p className = { 'text-[var(--text-muted)] text-md' } >
125113 Choose which emails you'd like to stop receiving.
126114 </ p >
127115 < p className = { 'text-[var(--text-muted)] text-sm' } > { data ?. email } </ p >
128- </ div >
116+ </ InviteHeading >
129117
130118 < div className = { 'mt-8 w-full max-w-[410px] space-y-3' } >
131119 < AuthSubmitButton
@@ -205,10 +193,9 @@ export default function Unsubscribe() {
205193 < Suspense
206194 fallback = {
207195 < InviteLayout >
208- < div className = 'space-y-1 text-center' >
209- < h1 className = { 'text-[32px] text-[var(--text-primary)] tracking-tight' } > Loading</ h1 >
196+ < InviteHeading title = { 'Loading' } >
210197 < p className = { 'text-[var(--text-muted)] text-md' } > Validating your unsubscribe link…</ p >
211- </ div >
198+ </ InviteHeading >
212199 < div className = { 'mt-8 flex w-full items-center justify-center py-8' } >
213200 < Loader className = 'size-8 text-[var(--text-muted)]' animate />
214201 </ div >
0 commit comments