Polish business FA layout and wire special-group keys plus SSL sync.
RTL carousels/FABs, special key+title fields, slider gallery fixes, and dashboard SSL sync agent for super-admin. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
co-authored by
Cursor
parent
66004a0fba
commit
672091d1f5
@@ -2,6 +2,7 @@ import { useEffect, useRef, useState } from 'react'
|
||||
import { createPortal } from 'react-dom'
|
||||
import { X } from 'lucide-react'
|
||||
import { ImageCropper } from './ImageCropper'
|
||||
import { useT } from '../i18n/useT'
|
||||
import modalStyles from './CategoryModal.module.css'
|
||||
import styles from './AddWebsiteSliderSlideModal.module.css'
|
||||
|
||||
@@ -26,6 +27,7 @@ export function AddWebsiteSliderSlideModal({
|
||||
onSubmit,
|
||||
isSubmitting = false,
|
||||
}: AddWebsiteSliderSlideModalProps) {
|
||||
const t = useT()
|
||||
const formRef = useRef<HTMLFormElement>(null)
|
||||
const [mounted, setMounted] = useState(open)
|
||||
const [closing, setClosing] = useState(false)
|
||||
@@ -85,32 +87,37 @@ export function AddWebsiteSliderSlideModal({
|
||||
>
|
||||
<div className={modalStyles.header}>
|
||||
<h3 id="add-slide-title" className={modalStyles.title}>
|
||||
Add slide
|
||||
{t('website.sliders.modal.title')}
|
||||
</h3>
|
||||
<button type="button" className={modalStyles.closeBtn} onClick={onClose} aria-label="Close">
|
||||
<button
|
||||
type="button"
|
||||
className={modalStyles.closeBtn}
|
||||
onClick={onClose}
|
||||
aria-label={t('common.close')}
|
||||
>
|
||||
<X size={20} />
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<form ref={formRef} className={modalStyles.form} onSubmit={handleSubmit}>
|
||||
<div className={modalStyles.field}>
|
||||
<label>Slide image</label>
|
||||
<label>{t('website.sliders.modal.image')}</label>
|
||||
<ImageCropper
|
||||
value={image}
|
||||
onChange={setImage}
|
||||
aspect={9 / 4}
|
||||
uploadLabel="Upload slide image"
|
||||
hint="9:4 banner ratio recommended"
|
||||
changeLabel="Change image"
|
||||
uploadLabel={t('website.sliders.modal.upload')}
|
||||
hint={t('website.sliders.modal.hint')}
|
||||
changeLabel={t('website.sliders.modal.changeImage')}
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div className={modalStyles.field}>
|
||||
<label htmlFor="slide-title">Title (optional)</label>
|
||||
<label htmlFor="slide-title">{t('website.sliders.modal.titleOptional')}</label>
|
||||
<input
|
||||
id="slide-title"
|
||||
type="text"
|
||||
placeholder="e.g. Summer sale"
|
||||
placeholder={t('website.sliders.modal.titlePlaceholder')}
|
||||
value={title}
|
||||
onChange={(e) => setTitle(e.target.value)}
|
||||
disabled={isSubmitting}
|
||||
@@ -118,7 +125,7 @@ export function AddWebsiteSliderSlideModal({
|
||||
</div>
|
||||
|
||||
<div className={modalStyles.field}>
|
||||
<label htmlFor="slide-link">Link URL (optional)</label>
|
||||
<label htmlFor="slide-link">{t('website.sliders.modal.linkOptional')}</label>
|
||||
<input
|
||||
id="slide-link"
|
||||
type="url"
|
||||
@@ -137,14 +144,14 @@ export function AddWebsiteSliderSlideModal({
|
||||
onClick={onClose}
|
||||
disabled={isSubmitting}
|
||||
>
|
||||
Cancel
|
||||
{t('products.form.cancel')}
|
||||
</button>
|
||||
<button
|
||||
type="submit"
|
||||
className={modalStyles.submitBtn}
|
||||
disabled={isSubmitting || !image}
|
||||
>
|
||||
{isSubmitting ? 'Adding...' : 'Add slide'}
|
||||
{isSubmitting ? t('website.adding') : t('website.sliders.modal.addSlide')}
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
Reference in New Issue
Block a user