mirror of
https://github.com/chillpadclub/bedolaga-cabinet.git
synced 2026-07-28 09:33:46 +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 i18n from '../i18n';
|
||||
import type {
|
||||
Balance,
|
||||
Transaction,
|
||||
@@ -54,6 +55,7 @@ export const balanceApi = {
|
||||
amount_kopeks: number;
|
||||
payment_method: string;
|
||||
payment_option?: string;
|
||||
language?: string;
|
||||
} = {
|
||||
amount_kopeks: amountKopeks,
|
||||
payment_method: paymentMethod,
|
||||
@@ -61,6 +63,7 @@ export const balanceApi = {
|
||||
if (paymentOption) {
|
||||
payload.payment_option = paymentOption;
|
||||
}
|
||||
payload.language = i18n.language || 'ru';
|
||||
const response = await apiClient.post('/cabinet/balance/topup', payload);
|
||||
return response.data;
|
||||
},
|
||||
|
||||
@@ -101,6 +101,7 @@ export interface PurchaseRequest {
|
||||
gift_recipient_type?: 'email' | 'telegram';
|
||||
gift_recipient_value?: string;
|
||||
gift_message?: string;
|
||||
language?: string;
|
||||
}
|
||||
|
||||
export interface PurchaseResponse {
|
||||
|
||||
@@ -408,7 +408,7 @@ export default function NewsArticlePage() {
|
||||
<img
|
||||
src={article.featured_image_url}
|
||||
alt={article.title}
|
||||
className="h-auto w-full rounded-xl object-cover"
|
||||
className="max-h-96 w-full rounded-xl object-cover"
|
||||
loading="eager"
|
||||
fetchPriority="high"
|
||||
/>
|
||||
|
||||
@@ -927,6 +927,7 @@ export default function QuickPurchase() {
|
||||
contact_type: detectContactType(contactValue),
|
||||
contact_value: contactValue.trim(),
|
||||
payment_method: paymentMethod,
|
||||
language: i18n.language,
|
||||
is_gift: isGift,
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user