Skip to content

Commit 6f889d4

Browse files
committed
feat: responsive payment
1 parent f98ae08 commit 6f889d4

22 files changed

+139
-98
lines changed

apps/frontend/src/components/billing/embedded.billing.tsx

Lines changed: 43 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ export const EmbeddedBilling: FC<{
5353
}
5454

5555
return (
56-
<div className="flex flex-col w-full pt-[24px] billing-form flex-1">
56+
<div className="flex flex-col w-full pt-[48px] billing-form flex-1 tablet:pt-0">
5757
<CheckoutProvider
5858
stripe={stripe}
5959
options={{
@@ -124,20 +124,41 @@ const StripeInputs = () => {
124124
return (
125125
<>
126126
<div>
127-
<h4 className="mb-[8px] text-[24px]">
128-
{checkout.type === 'loading' ? '' : t('billing_billing_address', 'Billing Address')}
127+
<h4 className="mb-[32px] text-[24px] font-[700]">
128+
{checkout.type === 'loading'
129+
? ''
130+
: t('billing_billing_address', 'Billing Address')}
129131
</h4>
130132
<BillingAddressElement />
131133
</div>
132134
<div>
133-
<h4 className="mt-[20px] mb-[8px] text-[24px]">
135+
<h4 className="mt-[40px] mb-[32px] text-[24px] font-[700]">
134136
{checkout.type === 'loading' ? '' : t('billing_payment', 'Payment')}
135137
</h4>
136138
<PaymentElement id="payment-element" options={{ layout: 'tabs' }} />
137139
{checkout.type === 'loading' ? null : (
138-
<div className="mt-[24px] flex gap-[10px]">
139-
<div>{t('billing_powered_by_stripe', 'Secure payments processed by Stripe')}</div>
140-
<Image src="/stripe.svg" alt="Stripe" width={20} height={20} />
140+
<div className="mt-[24px] text-[16px] font-[600] flex gap-[4px] items-center">
141+
<div>
142+
{t(
143+
'billing_powered_by_stripe',
144+
'Secure payments processed by'
145+
)}
146+
</div>
147+
<svg
148+
className="mt-[4px]"
149+
xmlns="http://www.w3.org/2000/svg"
150+
width="47"
151+
height="20"
152+
viewBox="0 0 47 20"
153+
fill="none"
154+
>
155+
<path
156+
fill-rule="evenodd"
157+
clip-rule="evenodd"
158+
d="M45.9725 11.0075H39.7596C39.906 12.4952 40.9929 12.9731 42.2262 12.9731C43.4904 12.9731 44.5079 12.6879 45.3481 12.2408V14.8C44.2819 15.4135 43.0618 15.7078 41.8331 15.6479C38.7421 15.6479 36.5683 13.7208 36.5683 9.88208C36.5683 6.65229 38.4106 4.08542 41.4246 4.08542C44.4463 4.08542 46.0187 6.61375 46.0187 9.86667C46.0187 10.175 45.9879 10.8379 45.9725 11.0075ZM41.4092 6.67542C40.6152 6.67542 39.7365 7.23812 39.7365 8.66417H43.0125C43.0125 7.23812 42.1877 6.67542 41.4092 6.67542ZM31.5656 15.6479C30.4556 15.6479 29.7773 15.1854 29.3302 14.8462L29.3148 18.4152L26.139 19.0858V4.29354H29.0373L29.099 5.07979C29.7712 4.44215 30.6622 4.0863 31.5887 4.08542C33.8242 4.08542 35.9208 6.08958 35.9208 9.78958C35.9208 13.821 33.8396 15.6479 31.5656 15.6479ZM30.8333 6.89896C30.101 6.89896 29.6462 7.16104 29.3148 7.52333L29.3302 12.2408C29.6385 12.58 30.0856 12.8421 30.8333 12.8421C32.005 12.8421 32.7912 11.5702 32.7912 9.85896C32.7912 8.20167 31.9896 6.89896 30.8333 6.89896ZM21.7683 4.29354H24.9519V15.4244H21.7683V4.29354ZM21.7683 0.670625L24.9519 0V2.59L21.7683 3.26833V0.678333V0.670625ZM18.4383 7.87792V15.4244H15.2625V4.29354H18.1146L18.2071 5.23396C18.9779 3.86958 20.5735 4.14708 20.9975 4.29354V7.215C20.5967 7.08396 19.2323 6.88354 18.4383 7.87792ZM11.8477 11.5162C11.8477 13.3894 13.8519 12.8112 14.2527 12.6417V15.2317C13.8287 15.4629 13.0656 15.6479 12.025 15.6479C11.5913 15.6606 11.1595 15.5849 10.756 15.4254C10.3525 15.2659 9.98559 15.026 9.6777 14.7203C9.36981 14.4146 9.12733 14.0494 8.96502 13.647C8.8027 13.2446 8.72395 12.8134 8.73354 12.3796L8.74125 2.22771L11.84 1.56479V4.29354H14.2604V7.01458H11.8477V11.524V11.5162ZM8.06292 12.0558C8.06292 14.3452 6.28229 15.6479 3.64604 15.6479C2.46306 15.647 1.29288 15.403 0.208125 14.931V11.9017C1.27188 12.4798 2.59771 12.9115 3.64604 12.9115C4.35521 12.9115 4.82542 12.7265 4.82542 12.1406C4.82542 10.6144 0 11.1848 0 7.66979C0 5.42667 1.7575 4.08542 4.33208 4.08542C5.38042 4.08542 6.42875 4.23958 7.48479 4.66354V7.65438C6.50888 7.14076 5.42694 6.86103 4.32438 6.83729C3.66146 6.83729 3.21438 7.03 3.21438 7.53104C3.21438 8.95708 8.06292 8.27875 8.06292 12.0635V12.0558Z"
159+
fill="#635BFF"
160+
/>
161+
</svg>
141162
</div>
142163
)}
143164
</div>
@@ -153,29 +174,38 @@ const SubmitBar: FC<{ loading: boolean }> = ({ loading }) => {
153174
}
154175

155176
return (
156-
<div className="animate-fadeIn h-[92px] fixed bottom-0 w-full px-[12px] pb-[12px] left-0 bg-newBgColor z-[100]">
157-
<div className="w-full h-full border-t border-newColColor bg-newBgColorInner px-[80px] flex gap-[32px] justify-end items-center font-[400] text-[14px] text-[#A3A3A3]">
177+
<div className="animate-fadeIn h-[92px] mobile:h-auto fixed bottom-0 w-full px-[12px] pb-[12px] left-0 bg-newBgColor z-[100]">
178+
<div className="w-full h-full border-t border-newColColor bg-newBgColorInner px-[80px] tablet:px-[33px] mobile:!px-[16px] flex mobile:flex-col gap-[32px] mobile:gap-[16px] justify-end items-center font-[400] text-[14px] text-[#A3A3A3] mobile:py-[16px]">
158179
{checkout.checkout.recurring?.trial?.trialEnd ? (
159180
<div>
160181
{t('billing_your_7_day_trial_is', 'Your 7-day trial is')}{' '}
161-
<span className="text-textColor font-[600]">{t('billing_100_percent_free', '100% free')}</span> {t('billing_ending', 'ending')}{' '}
182+
<span className="text-textColor font-[600]">
183+
{t('billing_100_percent_free', '100% free')}
184+
</span>{' '}
185+
{t('billing_ending', 'ending')}{' '}
186+
<br className="hidden mobile:block" />
162187
<span className="text-textColor font-[600]">
163188
{dayjs(
164189
checkout.checkout.recurring?.trial?.trialEnd * 1000
165190
).format('MMMM D, YYYY')}{' '}
166191
{' '}
167192
</span>
168-
<span className="text-textColor font-[600]">{t('billing_cancel_anytime_short', 'Cancel anytime.')}</span>
193+
<span className="text-textColor font-[600]">
194+
{t('billing_cancel_anytime_short', 'Cancel anytime.')}
195+
</span>
169196
</div>
170197
) : null}
171198
<div>
172199
<Button
173-
className="h-[42px] rounded-[10px]"
200+
className="h-[42px] rounded-[10px] mobile:w-full"
174201
type="submit"
175202
loading={loading}
176203
>
177204
{checkout.checkout.recurring?.trial?.trialEnd
178-
? t('billing_pay_0_start_trial', 'Pay $0 Today - Start your free trial!')
205+
? t(
206+
'billing_pay_0_start_trial',
207+
'Pay $0 Today - Start your free trial!'
208+
)
179209
: t('billing_pay_now', 'Pay Now')}
180210
</Button>
181211
</div>

apps/frontend/src/components/billing/faq.component.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ export const FAQComponent: FC = () => {
134134
const list = useFaqList();
135135
return (
136136
<div>
137-
<h3 className="text-[24px] mt-[81px] mb-[40px]">
137+
<h3 className="text-[24px] mt-[48px] mb-[40px] tablet:mt-[80px]">
138138
{t('frequently_asked_questions', 'Frequently Asked Questions')}
139139
</h3>
140140
<div className="gap-[24px] flex-col flex select-none">

apps/frontend/src/components/billing/first.billing.component.tsx

Lines changed: 70 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -86,9 +86,57 @@ export const FirstBillingComponent = () => {
8686
[]
8787
);
8888

89+
const JoinOver = () => {
90+
return (
91+
<>
92+
<div className="text-[46px] font-[600] leading-[110%] tablet:text-[36px] mobile:!text-[30px] whitespace-pre-line text-balance">
93+
{t('billing_join_over', 'Join Over')}{' '}
94+
<span className="text-[#FC69FF]">
95+
{t('billing_entrepreneurs_count', '18,000+ Entrepreneurs')}
96+
</span>{' '}
97+
{t('billing_who_use', 'who use')}{' '}
98+
{t(
99+
'billing_postiz_grow_social',
100+
'Postiz To Grow Their Social Presence'
101+
)}
102+
</div>
103+
104+
{!!user?.allowTrial && (
105+
<div className="flex mt-[32px] mb-[10px] gap-[15px] tablet:mt-[32px] tablet:mb-[32px] text-[16px] font-[500] mobile:flex-col">
106+
<div className="flex gap-[8px]">
107+
<div>
108+
<CheckIconComponent />
109+
</div>
110+
<div>{t('billing_no_risk_trial', '100% No-Risk Free Trial')}</div>
111+
</div>
112+
<div className="flex-1 flex gap-[8px] justify-center mobile:justify-start">
113+
<div>
114+
<CheckIconComponent />
115+
</div>
116+
<div>
117+
{t(
118+
'billing_pay_nothing_7_days',
119+
'Pay NOTHING for the first 7-days'
120+
)}
121+
</div>
122+
</div>
123+
<div className="flex gap-[8px]">
124+
<div>
125+
<CheckIconComponent />
126+
</div>
127+
<div>
128+
{t('billing_cancel_anytime', 'Cancel anytime, hassle-free')}
129+
</div>
130+
</div>
131+
</div>
132+
)}
133+
</>
134+
);
135+
};
136+
89137
return (
90-
<div className="blurMe flex flex-1 flex-col bg-newBgColorInner pb-[60px]">
91-
<div className="h-[92px] px-[80px] py-[20px] flex border-b border-newColColor">
138+
<div className="blurMe flex flex-1 flex-col bg-newBgColorInner pb-[60px] mobile:pb-[100px]">
139+
<div className="h-[92px] px-[80px] tablet:px-[32px] mobile:!px-[16px] py-[20px] flex border-b border-newColColor">
92140
<div className="flex-1 flex items-center text-textColor">
93141
<LogoTextComponent />
94142
</div>
@@ -106,53 +154,9 @@ export const FirstBillingComponent = () => {
106154
</div>
107155
</div>
108156
</div>
109-
<div className="flex px-[80px] flex-1">
110-
<div className="flex-1 py-[40px] flex flex-col pe-[40px]">
111-
<div className="text-[36px] font-[600] leading-[110%] whitespace-pre-line">
112-
{t('billing_join_over', 'Join Over')}{' '}
113-
<span className="text-[#FC69FF]">
114-
{t('billing_entrepreneurs_count', '18,000+ Entrepreneurs')}
115-
</span>{' '}
116-
{t('billing_who_use', 'who use')}
117-
{'\n'}
118-
{t(
119-
'billing_postiz_grow_social',
120-
'Postiz To Grow Their Social Presence'
121-
)}
122-
</div>
123-
124-
{!!user?.allowTrial && (
125-
<div className="flex mt-[34px] mb-[10px]">
126-
<div className="flex gap-[8px]">
127-
<div>
128-
<CheckIconComponent />
129-
</div>
130-
<div>
131-
{t('billing_no_risk_trial', '100% No-Risk Free Trial')}
132-
</div>
133-
</div>
134-
<div className="flex-1 flex gap-[8px] justify-center">
135-
<div>
136-
<CheckIconComponent />
137-
</div>
138-
<div>
139-
{t(
140-
'billing_pay_nothing_7_days',
141-
'Pay NOTHING for the first 7-days'
142-
)}
143-
</div>
144-
</div>
145-
<div className="flex gap-[8px]">
146-
<div>
147-
<CheckIconComponent />
148-
</div>
149-
<div>
150-
{t('billing_cancel_anytime', 'Cancel anytime, hassle-free')}
151-
</div>
152-
</div>
153-
</div>
154-
)}
155-
157+
<div className="flex px-[80px] tablet:px-[32px] mobile:!px-[16px] flex-1 flex-row tablet:flex-none tablet:flex-col-reverse">
158+
<div className="flex-1 py-[40px] tablet:pt-[80px] flex flex-col pe-[40px] tablet:pe-0">
159+
<div className="block tablet:hidden"><JoinOver /></div>
156160
{!isLoading && data && stripe ? (
157161
<>
158162
<EmbeddedBilling stripe={stripe} secret={data.client_secret} />
@@ -162,16 +166,17 @@ export const FirstBillingComponent = () => {
162166
<LoadingComponent />
163167
)}
164168
</div>
165-
<div className="flex flex-col ps-[40px] border-l border-newColColor py-[40px]">
169+
<div className="flex flex-col ps-[40px] tablet:!ps-[0] border-l border-newColColor py-[40px] mobile:!pt-[24px] tablet:border-none tablet:pb-0">
166170
<div className="top-[20px] sticky">
167-
<div className="flex mb-[24px]">
171+
<div className="hidden tablet:block"><JoinOver /></div>
172+
<div className="flex mb-[24px] mobile:flex-col">
168173
<div className="flex-1 text-[24px] font-[700]">
169174
{t('billing_choose_plan', 'Choose a Plan')}
170175
</div>
171-
<div className="h-[44px] px-[6px] flex items-center justify-center gap-[12px] border border-newColColor rounded-[12px] select-none">
176+
<div className="h-[44px] px-[6px] mobile:px-0 flex items-center justify-center mobile:justify-start gap-[12px] border border-newColColor rounded-[12px] select-none">
172177
<div
173178
className={clsx(
174-
'h-[32px] rounded-[6px] text-[16px] px-[12px] flex justify-center items-center',
179+
'h-[32px] mobile:flex-1 rounded-[6px] text-[16px] px-[12px] flex justify-center items-center',
175180
period === 'MONTHLY'
176181
? 'bg-boxFocused text-textItemFocused'
177182
: 'cursor-pointer'
@@ -182,38 +187,38 @@ export const FirstBillingComponent = () => {
182187
</div>
183188
<div
184189
className={clsx(
185-
'gap-[10px] h-[32px] rounded-[6px] text-[16px] px-[12px] flex justify-center items-center',
190+
'gap-[10px] h-[32px] mobile:flex-1 rounded-[6px] text-[16px] px-[12px] flex justify-center items-center',
186191
period === 'YEARLY'
187192
? 'bg-boxFocused text-textItemFocused'
188193
: 'cursor-pointer'
189194
)}
190195
onClick={() => setPeriod('YEARLY')}
191196
>
192197
<div>{t('billing_yearly', 'Yearly')}</div>
193-
<div className="bg-[#AA0FA4] text-[white] px-[8px] rounded-[4px]">
198+
<div className="bg-[#AA0FA4] text-[white] px-[8px] rounded-[4px] mobile:hidden">
194199
{t('billing_20_percent_off', '20% Off')}
195200
</div>
196201
</div>
197202
</div>
198203
</div>
199-
<div className="grid grid-cols-2 gap-[8px]">
204+
<div className="grid grid-cols-2 gap-[8px] mobile:!grid-cols-2 tablet:grid-cols-4">
200205
{price.map(
201206
([key, value]) => (
202207
<div
203208
onClick={() => setTier(key)}
204209
key={key}
205210
className={clsx(
206-
'cursor-pointer select-none w-[266px] h-[138px] p-[24px] rounded-[20px] flex flex-col',
211+
'cursor-pointer select-none w-[266px] h-[138px] tablet:w-full tablet:h-[124px] p-[24px] tablet:p-[15px] rounded-[20px] flex flex-col',
207212
key === tier
208-
? 'bg-[linear-gradient(138deg,#4C27E1_9.56%,#2F007B_76.16%)] text-white'
209-
: 'border border-newColColor'
213+
? 'border-[1.5px] border-[#618DFF]'
214+
: 'border-[1.5px] border-newColColor'
210215
)}
211216
>
212-
<div className="text-[20px] font-[500]">
217+
<div className="text-[20px] mobile:text-[18px] font-[500]">
213218
{capitalize(key)}
214219
</div>
215-
<div className="text-[24px] font-[400]">
216-
<span className="text-[44px] font-[600]">
220+
<div className="text-[24px] mobile:text-[18px] font-[400]">
221+
<span className="text-[44px] mobile:text-[30px] font-[600]">
217222
$
218223
{
219224
value[
@@ -230,7 +235,7 @@ export const FirstBillingComponent = () => {
230235
[]
231236
)}
232237
</div>
233-
<div className="flex flex-col mt-[54px] gap-[24px]">
238+
<div className="flex flex-col mt-[54px] gap-[24px] tablet:mt-[40px]">
234239
<div className="text-[24px] font-[700]">
235240
{t('billing_features', 'Features')}
236241
</div>
@@ -321,7 +326,7 @@ export const BillingFeatures: FC<{ tier: string }> = ({ tier }) => {
321326
};
322327

323328
return (
324-
<div className="grid grid-cols-2 gap-y-[8px] gap-x-[32px]">
329+
<div className="grid grid-cols-2 mobile:grid-cols-1 gap-y-[8px] gap-x-[32px]">
325330
{features.map((feature) => (
326331
<div key={feature.key} className="flex items-center gap-[8px]">
327332
<div>
@@ -334,7 +339,7 @@ export const BillingFeatures: FC<{ tier: string }> = ({ tier }) => {
334339
>
335340
<path
336341
d="M11.825 0H4.84167C1.80833 0 0 1.80833 0 4.84167V11.8167C0 14.8583 1.80833 16.6667 4.84167 16.6667H11.8167C14.85 16.6667 16.6583 14.8583 16.6583 11.825V4.84167C16.6667 1.80833 14.8583 0 11.825 0ZM12.3167 6.41667L7.59167 11.1417C7.475 11.2583 7.31667 11.325 7.15 11.325C6.98333 11.325 6.825 11.2583 6.70833 11.1417L4.35 8.78333C4.10833 8.54167 4.10833 8.14167 4.35 7.9C4.59167 7.65833 4.99167 7.65833 5.23333 7.9L7.15 9.81667L11.4333 5.53333C11.675 5.29167 12.075 5.29167 12.3167 5.53333C12.5583 5.775 12.5583 6.16667 12.3167 6.41667Z"
337-
fill="white"
342+
fill="currentColor"
338343
/>
339344
</svg>
340345
</div>

apps/frontend/src/components/new-layout/layout.component.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ import { AttachToFeedbackIcon } from '@gitroom/frontend/components/new-layout/se
4141
import { FirstBillingComponent } from '@gitroom/frontend/components/billing/first.billing.component';
4242

4343
const jakartaSans = Plus_Jakarta_Sans({
44-
weight: ['600', '500'],
44+
weight: ['600', '500', '700'],
4545
style: ['normal', 'italic'],
4646
subsets: ['latin'],
4747
});

apps/frontend/src/components/ui/check.icon.component.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,15 @@ export const CheckIconComponent = () => {
99
>
1010
<path
1111
d="M13.2742 1.76687C5.72114 -3.89752 -3.90021 12.5553 2.93125 18.9592C4.68315 20.6017 6.79417 20.7975 9.0813 21.1959C10.475 21.4379 12.6902 21.8312 14.113 21.4755C25.5332 18.6198 20.3442 1.20854 10.339 1.20854"
12-
stroke="#28ff12"
12+
stroke="#00FF00"
1313
strokeWidth="1.2"
1414
strokeMiterlimit="10"
1515
strokeLinecap="round"
1616
strokeLinejoin="round"
1717
/>
1818
<path
1919
d="M6.00586 11.2722C7.2516 12.5171 8.10319 14.104 9.22067 15.4652C9.75676 16.1175 10.0671 15.3361 10.1988 15.0462C11.4308 12.3359 14.0548 11.1902 16.0692 9.17578"
20-
stroke="#28ff12"
20+
stroke="#00FF00"
2121
strokeWidth="1.2"
2222
strokeMiterlimit="10"
2323
strokeLinecap="round"

apps/frontend/tailwind.config.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,12 @@ module.exports = {
228228
},
229229
}),
230230
screens: {
231+
mobile: {
232+
raw: '(max-width: 1025px)',
233+
},
234+
tablet: {
235+
raw: '(max-width: 1300px)',
236+
},
231237
iconBreak: {
232238
raw: '(max-width: 1560px)',
233239
},

i18n.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -532,7 +532,7 @@ checksums:
532532
billing_ai_videos_per_month: c786199d8dc9bded54fab8f92c350b19
533533
billing_billing_address: 48980a775bfc7292b0c4f9b74b4d352e
534534
billing_payment: 95142d3fd8b6a6f551aba771842e9c11
535-
billing_powered_by_stripe: c7c2723003ae04f17ae0c5bee195aeb6
535+
billing_powered_by_stripe: f2767a22c2cd93d4e8fe5c5d6ee05ad1
536536
billing_your_7_day_trial_is: 4b59fb559f5fd520668974e909e3479c
537537
billing_100_percent_free: 6616fd6ee152264c06dd2537f6347e66
538538
billing_ending: f66133a14aa7d86ea2453df97de12cd5

libraries/react-shared-libraries/src/translation/locales/ar/translation.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -528,7 +528,7 @@
528528
"billing_ai_videos_per_month": "فيديوهات بالذكاء الاصطناعي شهريًا",
529529
"billing_billing_address": "عنوان الفاتورة",
530530
"billing_payment": "الدفع",
531-
"billing_powered_by_stripe": "مدفوعات آمنة تتم معالجتها عبر سترايب",
531+
"billing_powered_by_stripe": "مدفوعات آمنة تتم معالجتها بواسطة",
532532
"billing_your_7_day_trial_is": "فترة التجربة المجانية لمدة 7 أيام الخاصة بك هي",
533533
"billing_100_percent_free": "مجانية 100%",
534534
"billing_ending": "تنتهي",

0 commit comments

Comments
 (0)