mirror of
https://github.com/chillpadclub/bedolaga-cabinet.git
synced 2026-07-28 09:33:46 +00:00
feat: add 'no color' option for button style customization
Adds a 'default' style option that removes color from buttons, showing Telegram's native default style. Updates type, UI chip, preview, and translations for all 4 locales.
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import apiClient from './client';
|
||||
|
||||
export interface ButtonSectionConfig {
|
||||
style: 'primary' | 'success' | 'danger';
|
||||
style: 'primary' | 'success' | 'danger' | 'default';
|
||||
icon_custom_emoji_id: string;
|
||||
}
|
||||
|
||||
|
||||
@@ -9,9 +9,10 @@ import {
|
||||
ButtonSection,
|
||||
} from '../../api/buttonStyles';
|
||||
|
||||
type StyleValue = 'primary' | 'success' | 'danger';
|
||||
type StyleValue = 'primary' | 'success' | 'danger' | 'default';
|
||||
|
||||
const STYLE_OPTIONS: { value: StyleValue; colorClass: string }[] = [
|
||||
{ value: 'default', colorClass: 'bg-dark-500' },
|
||||
{ value: 'primary', colorClass: 'bg-blue-500' },
|
||||
{ value: 'success', colorClass: 'bg-green-500' },
|
||||
{ value: 'danger', colorClass: 'bg-red-500' },
|
||||
@@ -134,12 +135,14 @@ export function ButtonsTab() {
|
||||
</div>
|
||||
{/* Live preview chip */}
|
||||
<div
|
||||
className={`rounded-lg px-3 py-1.5 text-xs font-medium text-white ${
|
||||
cfg.style === 'success'
|
||||
? 'bg-green-500'
|
||||
: cfg.style === 'danger'
|
||||
? 'bg-red-500'
|
||||
: 'bg-blue-500'
|
||||
className={`rounded-lg px-3 py-1.5 text-xs font-medium ${
|
||||
cfg.style === 'default'
|
||||
? 'bg-dark-600 text-dark-300'
|
||||
: cfg.style === 'success'
|
||||
? 'bg-green-500 text-white'
|
||||
: cfg.style === 'danger'
|
||||
? 'bg-red-500 text-white'
|
||||
: 'bg-blue-500 text-white'
|
||||
}`}
|
||||
>
|
||||
{t(`admin.buttons.styles.${cfg.style}`)}
|
||||
|
||||
@@ -1311,6 +1311,7 @@
|
||||
"admin": "Web admin panel"
|
||||
},
|
||||
"styles": {
|
||||
"default": "No color",
|
||||
"primary": "Blue",
|
||||
"success": "Green",
|
||||
"danger": "Red"
|
||||
|
||||
@@ -1020,6 +1020,7 @@
|
||||
"admin": "پنل مدیریت وب"
|
||||
},
|
||||
"styles": {
|
||||
"default": "بدون رنگ",
|
||||
"primary": "آبی",
|
||||
"success": "سبز",
|
||||
"danger": "قرمز"
|
||||
|
||||
@@ -1826,6 +1826,7 @@
|
||||
"admin": "Веб-админка"
|
||||
},
|
||||
"styles": {
|
||||
"default": "Без цвета",
|
||||
"primary": "Синий",
|
||||
"success": "Зелёный",
|
||||
"danger": "Красный"
|
||||
|
||||
@@ -1058,6 +1058,7 @@
|
||||
"admin": "网页管理面板"
|
||||
},
|
||||
"styles": {
|
||||
"default": "无颜色",
|
||||
"primary": "蓝色",
|
||||
"success": "绿色",
|
||||
"danger": "红色"
|
||||
|
||||
Reference in New Issue
Block a user