feat(cabinet): legal footer on login + admin toggle

Adds a legal footer (Public Offer / Privacy / Recurring Payments) under the
login card, gated by CABINET_FOOTER_ENABLED (backend endpoint added in bot
PR #3011), plus an admin toggle in BrandingTab and ru/en/fa/zh i18n.

Footer-only subset of PR #464 — excludes the unrelated storePartnerClickId
helper and the version/CHANGELOG churn.

Co-authored-by: smediainfo <dev@matrixvpn.top>
This commit is contained in:
Fringg
2026-06-30 07:30:59 +03:00
parent fd5500c85b
commit 984d1b0776
8 changed files with 136 additions and 4 deletions

View File

@@ -40,6 +40,11 @@ export function BrandingTab({ accentColor = '#3b82f6' }: BrandingTabProps) {
queryFn: brandingApi.getGiftEnabled,
});
const { data: footerEnabled } = useQuery({
queryKey: ['footer-enabled'],
queryFn: brandingApi.getFooterEnabled,
});
// Mutations
const updateBrandingMutation = useMutation({
mutationFn: brandingApi.updateName,
@@ -88,6 +93,13 @@ export function BrandingTab({ accentColor = '#3b82f6' }: BrandingTabProps) {
},
});
const updateFooterMutation = useMutation({
mutationFn: (enabled: boolean) => brandingApi.updateFooterEnabled(enabled),
onSuccess: () => {
queryClient.invalidateQueries({ queryKey: ['footer-enabled'] });
},
});
const handleLogoUpload = (e: React.ChangeEvent<HTMLInputElement>) => {
const file = e.target.files?.[0];
if (file) {
@@ -250,6 +262,25 @@ export function BrandingTab({ accentColor = '#3b82f6' }: BrandingTabProps) {
disabled={updateGiftMutation.isPending}
/>
</div>
<div className="flex items-center justify-between rounded-xl bg-dark-700/30 p-4">
<div>
<span className="font-medium text-dark-100">
{t('admin.settings.legalFooter', 'Юридический футер')}
</span>
<p className="text-sm text-dark-400">
{t(
'admin.settings.legalFooterDesc',
'Ссылки на оферту/политику/рекурренты внизу страницы входа',
)}
</p>
</div>
<Toggle
checked={footerEnabled ?? true}
onChange={() => updateFooterMutation.mutate(!(footerEnabled ?? true))}
disabled={updateFooterMutation.isPending}
/>
</div>
</div>
</div>
</div>