Spaces:
Sleeping

axeronis commited on
Commit
b92f979
·
1 Parent(s): 2bb1f0e

fix: Phase 11 - toggle aspect-ratio, day abbreviations, calendar/modal mobile UX

Browse files

- Toggle switch: add aspect-[11/6] for proper pill shape
- Day abbreviations: change EEE to EEEEEE for sr/cht format
- Calendar: add pb-24 for mobile bottom nav clearance
- Product modal: safe-area marginBottom positioning
- PaymentMethodsManager: flex-col layout, sticky footer, mobile positioning

frontend/app/appointments/page.tsx CHANGED
@@ -267,7 +267,7 @@ export default function AppointmentsPage() {
267
  }, [filteredAppointments])
268
 
269
  return (
270
- <div className="min-h-full p-3 md:p-6 lg:p-10 font-['Inter'] bg-transparent">
271
  <div className="max-w-[1800px] mx-auto min-h-[calc(100vh-24px)] flex flex-col">
272
 
273
  {/* Header */}
@@ -510,7 +510,7 @@ export default function AppointmentsPage() {
510
  "h-10 px-2 flex items-center justify-center text-sm font-medium border-b border-white/5",
511
  isToday ? "text-indigo-400 bg-indigo-500/10" : "text-slate-400"
512
  )}>
513
- <span>{format(day, viewMode === 'day' ? 'EEEE, d MMM' : 'EEE d', { locale: ru })}</span>
514
  </div>
515
  {/* Hour slots */}
516
  {hours.map(hour => {
 
267
  }, [filteredAppointments])
268
 
269
  return (
270
+ <div className="min-h-full p-3 md:p-6 lg:p-10 pb-24 md:pb-10 font-['Inter'] bg-transparent">
271
  <div className="max-w-[1800px] mx-auto min-h-[calc(100vh-24px)] flex flex-col">
272
 
273
  {/* Header */}
 
510
  "h-10 px-2 flex items-center justify-center text-sm font-medium border-b border-white/5",
511
  isToday ? "text-indigo-400 bg-indigo-500/10" : "text-slate-400"
512
  )}>
513
+ <span>{format(day, viewMode === 'day' ? 'EEEE, d MMM' : 'EEEEEE d', { locale: ru })}</span>
514
  </div>
515
  {/* Hour slots */}
516
  {hours.map(hour => {
frontend/components/knowledge/PaymentMethodsManager.tsx CHANGED
@@ -194,17 +194,18 @@ export function PaymentMethodsManager() {
194
  initial={{ opacity: 0 }}
195
  animate={{ opacity: 1 }}
196
  exit={{ opacity: 0 }}
197
- className="fixed inset-0 z-50 bg-black/60 backdrop-blur-sm flex items-center justify-center p-4"
198
  onClick={() => resetForm()}
199
  >
200
  <motion.div
201
- initial={{ scale: 0.95 }}
202
- animate={{ scale: 1 }}
203
- exit={{ scale: 0.95 }}
204
- className="bg-[#1E1F2E] rounded-2xl w-full max-w-md border border-white/10 max-h-[90vh] overflow-y-auto"
 
205
  onClick={e => e.stopPropagation()}
206
  >
207
- <div className="flex items-center justify-between p-4 border-b border-white/10">
208
  <h3 className="text-lg font-bold text-white">
209
  {editingMethod ? 'Редактировать' : 'Новый способ оплаты'}
210
  </h3>
@@ -213,7 +214,7 @@ export function PaymentMethodsManager() {
213
  </button>
214
  </div>
215
 
216
- <div className="p-4 space-y-4">
217
  <div>
218
  <label className="text-sm font-medium text-slate-400 mb-1 block">Название</label>
219
  <input
@@ -354,7 +355,10 @@ export function PaymentMethodsManager() {
354
  className="w-full px-3 py-2 bg-white/5 border border-white/10 rounded-lg text-white resize-none"
355
  />
356
  </div>
 
357
 
 
 
358
  <button
359
  onClick={handleSubmit}
360
  disabled={createMutation.isPending || updateMutation.isPending}
 
194
  initial={{ opacity: 0 }}
195
  animate={{ opacity: 1 }}
196
  exit={{ opacity: 0 }}
197
+ className="fixed inset-0 z-50 bg-black/60 backdrop-blur-sm flex items-end sm:items-center justify-center p-0 sm:p-4"
198
  onClick={() => resetForm()}
199
  >
200
  <motion.div
201
+ initial={{ scale: 0.95, y: 50 }}
202
+ animate={{ scale: 1, y: 0 }}
203
+ exit={{ scale: 0.95, y: 50 }}
204
+ className="bg-[#1E1F2E] rounded-t-2xl sm:rounded-2xl w-full sm:max-w-md border border-white/10 max-h-[85vh] flex flex-col"
205
+ style={{ marginBottom: 'max(70px, env(safe-area-inset-bottom, 70px))' }}
206
  onClick={e => e.stopPropagation()}
207
  >
208
+ <div className="flex-shrink-0 flex items-center justify-between p-4 border-b border-white/10">
209
  <h3 className="text-lg font-bold text-white">
210
  {editingMethod ? 'Редактировать' : 'Новый способ оплаты'}
211
  </h3>
 
214
  </button>
215
  </div>
216
 
217
+ <div className="flex-1 overflow-y-auto p-4 space-y-4">
218
  <div>
219
  <label className="text-sm font-medium text-slate-400 mb-1 block">Название</label>
220
  <input
 
355
  className="w-full px-3 py-2 bg-white/5 border border-white/10 rounded-lg text-white resize-none"
356
  />
357
  </div>
358
+ </div>
359
 
360
+ {/* Sticky Footer */}
361
+ <div className="flex-shrink-0 p-4 border-t border-white/10 bg-[#1E1F2E]">
362
  <button
363
  onClick={handleSubmit}
364
  disabled={createMutation.isPending || updateMutation.isPending}
frontend/components/settings/ProductSettings.tsx CHANGED
@@ -258,8 +258,8 @@ export default function ProductSettings() {
258
  initial={{ opacity: 0, y: 50 }}
259
  animate={{ opacity: 1, y: 0 }}
260
  exit={{ opacity: 0, y: 50 }}
261
- className="bg-[#12131F] rounded-t-2xl sm:rounded-xl border border-white/10 w-full sm:max-w-md max-h-[70vh] sm:max-h-[85vh] flex flex-col mb-20 sm:mb-0">
262
- <form onSubmit={handleSave} className="flex flex-col h-full max-h-[85vh] sm:max-h-[90vh]">
263
  {/* Fixed Header */}
264
  <div className="flex-shrink-0 p-4 border-b border-white/10 flex items-center justify-between">
265
  <h2 className="text-white font-medium">
 
258
  initial={{ opacity: 0, y: 50 }}
259
  animate={{ opacity: 1, y: 0 }}
260
  exit={{ opacity: 0, y: 50 }}
261
+ className="bg-[#12131F] rounded-t-2xl sm:rounded-xl border border-white/10 w-full sm:max-w-md max-h-[85vh] sm:max-h-[85vh] flex flex-col" style={{ marginBottom: 'max(70px, env(safe-area-inset-bottom, 70px))' }}>
262
+ <form onSubmit={handleSave} className="flex flex-col h-full">
263
  {/* Fixed Header */}
264
  <div className="flex-shrink-0 p-4 border-b border-white/10 flex items-center justify-between">
265
  <h2 className="text-white font-medium">
frontend/components/ui/switch.tsx CHANGED
@@ -11,7 +11,7 @@ const Switch = React.forwardRef<
11
  >(({ className, ...props }, ref) => (
12
  <SwitchPrimitive.Root
13
  className={cn(
14
- "peer inline-flex h-6 w-11 min-w-[44px] shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",
15
  className
16
  )}
17
  {...props}
 
11
  >(({ className, ...props }, ref) => (
12
  <SwitchPrimitive.Root
13
  className={cn(
14
+ "peer inline-flex h-6 w-11 min-w-[44px] aspect-[11/6] shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",
15
  className
16
  )}
17
  {...props}