|
|
@@ -144,11 +144,11 @@ export default function PlaceForm({ type, onSuccess, place }: PlaceFormProps) {
|
|
|
if (saved) {
|
|
|
return (
|
|
|
<div className="mx-auto max-w-2xl space-y-4 p-6 text-center">
|
|
|
- <p className="text-lg font-medium text-success-500">
|
|
|
+ <p className="text-lg font-medium text-green-400">
|
|
|
{saved === 'draft' ? 'Черновик сохранён' : 'Место отправлено на модерацию'}
|
|
|
</p>
|
|
|
<a href={type === 'studio' ? '/studios/add' : '/places/add'}
|
|
|
- className="inline-block rounded-lg bg-primary-600 px-6 py-2 text-white hover:bg-primary-500 transition-colors"
|
|
|
+ className="inline-block rounded-lg bg-green-600 px-6 py-2 text-white hover:bg-green-500 transition"
|
|
|
>Добавить ещё</a>
|
|
|
</div>
|
|
|
)
|
|
|
@@ -156,90 +156,86 @@ export default function PlaceForm({ type, onSuccess, place }: PlaceFormProps) {
|
|
|
|
|
|
return (
|
|
|
<form onSubmit={handleSubmit} className="mx-auto max-w-2xl space-y-6 p-6">
|
|
|
- <h1 className="text-2xl font-bold text-neutral-100">
|
|
|
+ <h1 className="text-2xl font-bold text-white">
|
|
|
{isEdit ? 'Редактировать' : type === 'studio' ? 'Добавить студию' : 'Добавить место'}
|
|
|
</h1>
|
|
|
|
|
|
- {error && (
|
|
|
- <div className="rounded-lg bg-error-500/10 p-3 text-sm text-error-500">
|
|
|
- {error}
|
|
|
- </div>
|
|
|
- )}
|
|
|
+ {error && <p className="rounded-lg bg-red-500/10 p-3 text-sm text-red-400">{error}</p>}
|
|
|
|
|
|
- <div className="space-y-2">
|
|
|
- <label className="text-sm font-medium text-neutral-300">Название *</label>
|
|
|
+ <div>
|
|
|
+ <label className="mb-1 block text-sm text-white/60">Название *</label>
|
|
|
<input
|
|
|
value={title}
|
|
|
onChange={(e) => setTitle(e.target.value)}
|
|
|
- className="w-full rounded-lg border border-neutral-700 bg-neutral-800 px-4 py-3 text-neutral-100 placeholder-neutral-500 outline-none focus:border-primary-500 focus:ring-2 focus:ring-primary-500/20 transition-colors"
|
|
|
+ className="w-full rounded-lg border border-white/10 bg-white/5 px-4 py-3 text-white outline-none focus:border-green-500"
|
|
|
required
|
|
|
/>
|
|
|
</div>
|
|
|
|
|
|
- <div className="space-y-2">
|
|
|
- <label className="text-sm font-medium text-neutral-300">Описание</label>
|
|
|
+ <div>
|
|
|
+ <label className="mb-1 block text-sm text-white/60">Описание</label>
|
|
|
<textarea
|
|
|
value={description}
|
|
|
onChange={(e) => setDescription(e.target.value)}
|
|
|
rows={4}
|
|
|
- className="w-full rounded-lg border border-neutral-700 bg-neutral-800 px-4 py-3 text-neutral-100 placeholder-neutral-500 outline-none focus:border-primary-500 focus:ring-2 focus:ring-primary-500/20 transition-colors"
|
|
|
+ className="w-full rounded-lg border border-white/10 bg-white/5 px-4 py-3 text-white outline-none focus:border-green-500"
|
|
|
/>
|
|
|
</div>
|
|
|
|
|
|
- <div className="space-y-2">
|
|
|
- <label className="text-sm font-medium text-neutral-300">Адрес</label>
|
|
|
+ <div>
|
|
|
+ <label className="mb-1 block text-sm text-white/60">Адрес</label>
|
|
|
<input
|
|
|
value={address}
|
|
|
onChange={(e) => setAddress(e.target.value)}
|
|
|
- className="w-full rounded-lg border border-neutral-700 bg-neutral-800 px-4 py-3 text-neutral-100 placeholder-neutral-500 outline-none focus:border-primary-500 focus:ring-2 focus:ring-primary-500/20 transition-colors"
|
|
|
+ className="w-full rounded-lg border border-white/10 bg-white/5 px-4 py-3 text-white outline-none focus:border-green-500"
|
|
|
/>
|
|
|
</div>
|
|
|
|
|
|
<div className="grid grid-cols-5 gap-4">
|
|
|
- <div className="col-span-2 space-y-2">
|
|
|
- <label className="text-sm font-medium text-neutral-300">Широта</label>
|
|
|
+ <div className="col-span-2">
|
|
|
+ <label className="mb-1 block text-sm text-white/60">Широта</label>
|
|
|
<input
|
|
|
type="number"
|
|
|
step="any"
|
|
|
value={lat}
|
|
|
onChange={(e) => setLat(e.target.value)}
|
|
|
- className="w-full rounded-lg border border-neutral-700 bg-neutral-800 px-3 py-3 text-neutral-100 placeholder-neutral-500 outline-none focus:border-primary-500 focus:ring-2 focus:ring-primary-500/20 transition-colors"
|
|
|
+ className="w-full rounded-lg border border-white/10 bg-white/5 px-3 py-3 text-white outline-none focus:border-green-500"
|
|
|
/>
|
|
|
</div>
|
|
|
- <div className="col-span-2 space-y-2">
|
|
|
- <label className="text-sm font-medium text-neutral-300">Долгота</label>
|
|
|
+ <div className="col-span-2">
|
|
|
+ <label className="mb-1 block text-sm text-white/60">Долгота</label>
|
|
|
<input
|
|
|
type="number"
|
|
|
step="any"
|
|
|
value={lng}
|
|
|
onChange={(e) => setLng(e.target.value)}
|
|
|
- className="w-full rounded-lg border border-neutral-700 bg-neutral-800 px-3 py-3 text-neutral-100 placeholder-neutral-500 outline-none focus:border-primary-500 focus:ring-2 focus:ring-primary-500/20 transition-colors"
|
|
|
+ className="w-full rounded-lg border border-white/10 bg-white/5 px-3 py-3 text-white outline-none focus:border-green-500"
|
|
|
/>
|
|
|
</div>
|
|
|
<div className="col-span-1 flex items-end">
|
|
|
<button
|
|
|
type="button"
|
|
|
onClick={() => setShowMapPicker(true)}
|
|
|
- className="h-[50px] w-auto rounded-lg border border-neutral-700 bg-neutral-800 px-3 py-1.5 text-sm text-neutral-300 hover:bg-neutral-700 hover:text-neutral-100 transition-colors text-center leading-tight"
|
|
|
+ className="h-[50px] w-auto rounded-lg border border-white/10 bg-white/5 px-3 py-1.5 text-sm text-white/80 hover:bg-white/10 transition text-center leading-tight"
|
|
|
>
|
|
|
Указать<br />на карте
|
|
|
</button>
|
|
|
</div>
|
|
|
</div>
|
|
|
|
|
|
- <div className="space-y-2">
|
|
|
- <label className="text-sm font-medium text-neutral-300">Информация о доступе</label>
|
|
|
+ <div>
|
|
|
+ <label className="mb-1 block text-sm text-white/60">Информация о доступе</label>
|
|
|
<textarea
|
|
|
value={accessInfo}
|
|
|
onChange={(e) => setAccessInfo(e.target.value)}
|
|
|
rows={2}
|
|
|
- className="w-full rounded-lg border border-neutral-700 bg-neutral-800 px-4 py-3 text-neutral-100 placeholder-neutral-500 outline-none focus:border-primary-500 focus:ring-2 focus:ring-primary-500/20 transition-colors"
|
|
|
+ className="w-full rounded-lg border border-white/10 bg-white/5 px-4 py-3 text-white outline-none focus:border-green-500"
|
|
|
placeholder="Как добраться, парковка..."
|
|
|
/>
|
|
|
</div>
|
|
|
|
|
|
- <div className="space-y-2">
|
|
|
- <label className="text-sm font-medium text-neutral-300">Обложка</label>
|
|
|
+ <div>
|
|
|
+ <label className="mb-1 block text-sm text-white/60">Обложка</label>
|
|
|
<input
|
|
|
type="file"
|
|
|
accept="image/*"
|
|
|
@@ -251,7 +247,7 @@ export default function PlaceForm({ type, onSuccess, place }: PlaceFormProps) {
|
|
|
setCoverPreview(URL.createObjectURL(file))
|
|
|
}
|
|
|
}}
|
|
|
- className="w-full text-sm text-neutral-400 file:mr-4 file:rounded-lg file:border-0 file:bg-primary-600 file:px-4 file:py-2 file:text-white file:hover:bg-primary-500 file:transition-colors"
|
|
|
+ className="w-full text-sm text-white/60 file:mr-4 file:rounded-lg file:border-0 file:bg-green-600 file:px-4 file:py-2 file:text-white file:hover:bg-green-500"
|
|
|
/>
|
|
|
{coverPreview && (
|
|
|
<img src={coverPreview} alt="preview" className="mt-2 h-32 rounded-lg object-cover" />
|
|
|
@@ -260,40 +256,40 @@ export default function PlaceForm({ type, onSuccess, place }: PlaceFormProps) {
|
|
|
|
|
|
{type === 'studio' && (
|
|
|
<div className="grid grid-cols-2 gap-4">
|
|
|
- <div className="space-y-2">
|
|
|
- <label className="text-sm font-medium text-neutral-300">Цена за час (₽)</label>
|
|
|
+ <div>
|
|
|
+ <label className="mb-1 block text-sm text-white/60">Цена за час (₽)</label>
|
|
|
<input
|
|
|
type="number"
|
|
|
value={hourlyRate}
|
|
|
onChange={(e) => setHourlyRate(e.target.value)}
|
|
|
- className="w-full rounded-lg border border-neutral-700 bg-neutral-800 px-4 py-3 text-neutral-100 placeholder-neutral-500 outline-none focus:border-primary-500 focus:ring-2 focus:ring-primary-500/20 transition-colors"
|
|
|
+ className="w-full rounded-lg border border-white/10 bg-white/5 px-4 py-3 text-white outline-none focus:border-green-500"
|
|
|
/>
|
|
|
</div>
|
|
|
- <div className="space-y-2">
|
|
|
- <label className="text-sm font-medium text-neutral-300">Мин. часов</label>
|
|
|
+ <div>
|
|
|
+ <label className="mb-1 block text-sm text-white/60">Мин. часов</label>
|
|
|
<input
|
|
|
type="number"
|
|
|
min="1"
|
|
|
value={minHours}
|
|
|
onChange={(e) => setMinHours(e.target.value)}
|
|
|
- className="w-full rounded-lg border border-neutral-700 bg-neutral-800 px-4 py-3 text-neutral-100 placeholder-neutral-500 outline-none focus:border-primary-500 focus:ring-2 focus:ring-primary-500/20 transition-colors"
|
|
|
+ className="w-full rounded-lg border border-white/10 bg-white/5 px-4 py-3 text-white outline-none focus:border-green-500"
|
|
|
/>
|
|
|
</div>
|
|
|
</div>
|
|
|
)}
|
|
|
|
|
|
- <div className="space-y-2">
|
|
|
- <label className="text-sm font-medium text-neutral-300">Теги (стили съёмки)</label>
|
|
|
+ <div>
|
|
|
+ <label className="mb-2 block text-sm text-white/60">Теги (стили съёмки)</label>
|
|
|
<div className="flex flex-wrap gap-2">
|
|
|
{tags.map((tag) => (
|
|
|
<button
|
|
|
key={tag.id}
|
|
|
type="button"
|
|
|
onClick={() => toggleTag(tag.id)}
|
|
|
- className={`rounded-full px-3 py-1.5 text-sm transition-colors ${
|
|
|
+ className={`rounded-full px-3 py-1.5 text-sm transition ${
|
|
|
selectedTags.includes(tag.id)
|
|
|
- ? 'bg-primary-600 text-white'
|
|
|
- : 'bg-neutral-800 text-neutral-400 hover:bg-neutral-700 hover:text-neutral-200'
|
|
|
+ ? 'bg-green-600 text-white'
|
|
|
+ : 'bg-white/10 text-white/60 hover:bg-white/20'
|
|
|
}`}
|
|
|
>
|
|
|
{tag.name}
|
|
|
@@ -302,18 +298,18 @@ export default function PlaceForm({ type, onSuccess, place }: PlaceFormProps) {
|
|
|
</div>
|
|
|
</div>
|
|
|
|
|
|
- <div className="space-y-2">
|
|
|
- <label className="text-sm font-medium text-neutral-300">Характеристики</label>
|
|
|
+ <div>
|
|
|
+ <label className="mb-2 block text-sm text-white/60">Характеристики</label>
|
|
|
<div className="flex flex-wrap gap-2">
|
|
|
{features.map((feat) => (
|
|
|
<button
|
|
|
key={feat.id}
|
|
|
type="button"
|
|
|
onClick={() => toggleFeature(feat.id)}
|
|
|
- className={`rounded-full px-3 py-1.5 text-sm transition-colors ${
|
|
|
+ className={`rounded-full px-3 py-1.5 text-sm transition ${
|
|
|
selectedFeatures.includes(feat.id)
|
|
|
- ? 'bg-primary-600 text-white'
|
|
|
- : 'bg-neutral-800 text-neutral-400 hover:bg-neutral-700 hover:text-neutral-200'
|
|
|
+ ? 'bg-green-600 text-white'
|
|
|
+ : 'bg-white/10 text-white/60 hover:bg-white/20'
|
|
|
}`}
|
|
|
>
|
|
|
{feat.name}
|
|
|
@@ -325,11 +321,11 @@ export default function PlaceForm({ type, onSuccess, place }: PlaceFormProps) {
|
|
|
<div className="flex gap-3">
|
|
|
{!isEdit && (
|
|
|
<button type="button" onClick={handleSaveDraft} disabled={loading}
|
|
|
- className="flex-1 rounded-lg border border-neutral-700 bg-neutral-800 px-4 py-3 font-medium text-neutral-300 hover:bg-neutral-700 hover:text-neutral-100 transition-colors disabled:opacity-50"
|
|
|
+ className="flex-1 rounded-lg border border-white/20 px-4 py-3 font-medium text-white/80 hover:bg-white/5 transition disabled:opacity-50"
|
|
|
>{loading ? 'Сохранение...' : 'Сохранить черновик'}</button>
|
|
|
)}
|
|
|
<button type="submit" disabled={loading}
|
|
|
- className={`rounded-lg bg-primary-600 px-4 py-3 font-medium text-white hover:bg-primary-500 transition-colors disabled:opacity-50 ${isEdit ? 'w-full' : 'flex-1'}`}
|
|
|
+ className={`rounded-lg bg-green-600 px-4 py-3 font-medium text-white hover:bg-green-500 transition disabled:opacity-50 ${isEdit ? 'w-full' : 'flex-1'}`}
|
|
|
>
|
|
|
{loading ? 'Сохранение...' : isEdit ? 'Сохранить' : `Опубликовать ${type === 'studio' ? 'студию' : 'место'}`}
|
|
|
</button>
|