mirror of
https://github.com/chillpadclub/bedolaga-cabinet.git
synced 2026-07-28 17:43:47 +00:00
feat: send language in payment requests for localized descriptions
- Add language field to balance topup and landing purchase requests - Cap news article featured image height with max-h-96 Cherry-picked from PR #362 (without favicon change — files don't exist)
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
import apiClient from './client';
|
import apiClient from './client';
|
||||||
|
import i18n from '../i18n';
|
||||||
import type {
|
import type {
|
||||||
Balance,
|
Balance,
|
||||||
Transaction,
|
Transaction,
|
||||||
@@ -54,6 +55,7 @@ export const balanceApi = {
|
|||||||
amount_kopeks: number;
|
amount_kopeks: number;
|
||||||
payment_method: string;
|
payment_method: string;
|
||||||
payment_option?: string;
|
payment_option?: string;
|
||||||
|
language?: string;
|
||||||
} = {
|
} = {
|
||||||
amount_kopeks: amountKopeks,
|
amount_kopeks: amountKopeks,
|
||||||
payment_method: paymentMethod,
|
payment_method: paymentMethod,
|
||||||
@@ -61,6 +63,7 @@ export const balanceApi = {
|
|||||||
if (paymentOption) {
|
if (paymentOption) {
|
||||||
payload.payment_option = paymentOption;
|
payload.payment_option = paymentOption;
|
||||||
}
|
}
|
||||||
|
payload.language = i18n.language || 'ru';
|
||||||
const response = await apiClient.post('/cabinet/balance/topup', payload);
|
const response = await apiClient.post('/cabinet/balance/topup', payload);
|
||||||
return response.data;
|
return response.data;
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -101,6 +101,7 @@ export interface PurchaseRequest {
|
|||||||
gift_recipient_type?: 'email' | 'telegram';
|
gift_recipient_type?: 'email' | 'telegram';
|
||||||
gift_recipient_value?: string;
|
gift_recipient_value?: string;
|
||||||
gift_message?: string;
|
gift_message?: string;
|
||||||
|
language?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface PurchaseResponse {
|
export interface PurchaseResponse {
|
||||||
|
|||||||
@@ -408,7 +408,7 @@ export default function NewsArticlePage() {
|
|||||||
<img
|
<img
|
||||||
src={article.featured_image_url}
|
src={article.featured_image_url}
|
||||||
alt={article.title}
|
alt={article.title}
|
||||||
className="h-auto w-full rounded-xl object-cover"
|
className="max-h-96 w-full rounded-xl object-cover"
|
||||||
loading="eager"
|
loading="eager"
|
||||||
fetchPriority="high"
|
fetchPriority="high"
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -927,6 +927,7 @@ export default function QuickPurchase() {
|
|||||||
contact_type: detectContactType(contactValue),
|
contact_type: detectContactType(contactValue),
|
||||||
contact_value: contactValue.trim(),
|
contact_value: contactValue.trim(),
|
||||||
payment_method: paymentMethod,
|
payment_method: paymentMethod,
|
||||||
|
language: i18n.language,
|
||||||
is_gift: isGift,
|
is_gift: isGift,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user