fix: TypeScript errors — cast style props, replace C.white with literal

This commit is contained in:
2026-06-28 13:25:54 -05:00
parent bd3f3e2d3b
commit 80c562b439
+11 -11
View File
@@ -39,8 +39,8 @@ function I({ label, value, onChange, type = 'text', placeholder, style }: any) {
{label && <label style={{ fontSize: '13px', fontWeight: 600, color: C.text }}>{label}</label>}
<input type={type} value={value ?? ''} onChange={e => onChange(e.target.value)} placeholder={placeholder}
style={{ padding: '8px 12px', borderRadius: 8, border: `1px solid ${C.border}`, fontSize: '14px', outline: 'none', background: '#FAFAFA', ...style }}
onFocus={e => { e.target.style.borderColor = C.gold; e.target.style.background = C.white; }}
onBlur={e => { e.target.style.borderColor = C.border; e.target.style.background = '#FAFAFA'; }} />
onFocus={e => { (e.target.style as any).borderColor = C.gold; (e.target.style as any).background = '#FFFFFF'; }}
onBlur={e => { (e.target.style as any).borderColor = C.border; (e.target.style as any).background = '#FAFAFA'; }} />
</div>
);
}
@@ -51,8 +51,8 @@ function TA({ label, value, onChange, rows = 3 }: any) {
{label && <label style={{ fontSize: '13px', fontWeight: 600, color: C.text }}>{label}</label>}
<textarea value={value ?? ''} onChange={e => onChange(e.target.value)} rows={rows}
style={{ padding: '8px 12px', borderRadius: 8, border: `1px solid ${C.border}`, fontSize: '14px', outline: 'none', background: '#FAFAFA', resize: 'vertical', fontFamily: 'inherit' }}
onFocus={e => { e.target.style.borderColor = C.gold; e.target.style.background = C.white; }}
onBlur={e => { e.target.style.borderColor = C.border; e.target.style.background = '#FAFAFA'; }} />
onFocus={e => { (e.target.style as any).borderColor = C.gold; (e.target.style as any).background = '#FFFFFF'; }}
onBlur={e => { (e.target.style as any).borderColor = C.border; (e.target.style as any).background = '#FAFAFA'; }} />
</div>
);
}
@@ -254,7 +254,7 @@ function EntityCard({ title, desc, meta, thumb, actions, photoUrls }: any) {
function Confirm({ message, onConfirm, onCancel }: any) {
return (
<div style={{ position: 'fixed', top: 0, left: 0, right: 0, bottom: 0, background: 'rgba(0,0,0,0.4)', display: 'flex', alignItems: 'center', justifyContent: 'center', zIndex: 9998 }}>
<div style={{ background: C.white, borderRadius: 16, padding: '24px 28px', maxWidth: 360, width: '90%', boxShadow: '0 20px 60px rgba(0,0,0,0.2)' }}>
<div style={{ background: '#FFFFFF', borderRadius: 16, padding: '24px 28px', maxWidth: 360, width: '90%', boxShadow: '0 20px 60px rgba(0,0,0,0.2)' }}>
<p style={{ margin: '0 0 20px', fontSize: '15px', color: C.text }}>{message}</p>
<div style={{ display: 'flex', gap: '10px', justifyContent: 'flex-end' }}>
<Btn onClick={onCancel} variant="secondary">Cancel</Btn>
@@ -321,7 +321,7 @@ function SlideEditor({ slide, setSlide, images, onSave, onCancel }: any) {
const s = { ...slide };
return (
<div style={{ position: 'fixed', top: 0, left: 0, right: 0, bottom: 0, background: 'rgba(0,0,0,0.4)', display: 'flex', alignItems: 'center', justifyContent: 'center', zIndex: 9998 }}>
<div style={{ background: C.white, borderRadius: 16, padding: '24px 28px', maxWidth: 500, width: '90%', maxHeight: '90vh', overflowY: 'auto' }}>
<div style={{ background: '#FFFFFF', borderRadius: 16, padding: '24px 28px', maxWidth: 500, width: '90%', maxHeight: '90vh', overflowY: 'auto' }}>
<h3 style={{ margin: '0 0 20px', fontSize: '18px', fontWeight: 700, color: C.navy }}>{s.id ? 'Edit Slide' : 'New Slide'}</h3>
<div style={{ display: 'grid', gap: '14px' }}>
<I label="Title" value={s.title} onChange={(v: string) => setSlide({ ...s, title: v })} />
@@ -408,7 +408,7 @@ function CalendarEditor({ event, setEvent, onSave, onCancel }: any) {
const e = { ...event };
return (
<div style={{ position: 'fixed', top: 0, left: 0, right: 0, bottom: 0, background: 'rgba(0,0,0,0.4)', display: 'flex', alignItems: 'center', justifyContent: 'center', zIndex: 9998 }}>
<div style={{ background: C.white, borderRadius: 16, padding: '24px 28px', maxWidth: 460, width: '90%' }}>
<div style={{ background: '#FFFFFF', borderRadius: 16, padding: '24px 28px', maxWidth: 460, width: '90%' }}>
<h3 style={{ margin: '0 0 20px', fontSize: '18px', fontWeight: 700, color: C.navy }}>{e.id ? 'Edit Event' : 'New Event'}</h3>
<div style={{ display: 'grid', gap: '14px' }}>
<I label="Title" value={e.title} onChange={(v: string) => setEvent({ ...e, title: v })} />
@@ -498,7 +498,7 @@ function SocialEditor({ event, setEvent, images, onSave, onCancel }: any) {
return (
<div style={{ position: 'fixed', top: 0, left: 0, right: 0, bottom: 0, background: 'rgba(0,0,0,0.4)', display: 'flex', alignItems: 'center', justifyContent: 'center', zIndex: 9998 }}>
<div style={{ background: C.white, borderRadius: 16, padding: '24px 28px', maxWidth: 500, width: '90%', maxHeight: '90vh', overflowY: 'auto' }}>
<div style={{ background: '#FFFFFF', borderRadius: 16, padding: '24px 28px', maxWidth: 500, width: '90%', maxHeight: '90vh', overflowY: 'auto' }}>
<h3 style={{ margin: '0 0 20px', fontSize: '18px', fontWeight: 700, color: C.navy }}>{ev.id ? 'Edit Event' : 'New Event'}</h3>
<div style={{ display: 'grid', gap: '14px' }}>
<I label="Name" value={ev.name} onChange={(v: string) => setEvent({ ...ev, name: v })} />
@@ -604,7 +604,7 @@ function RoomEditor({ room, setRoom, images, onSave, onCancel }: any) {
return (
<div style={{ position: 'fixed', top: 0, left: 0, right: 0, bottom: 0, background: 'rgba(0,0,0,0.4)', display: 'flex', alignItems: 'center', justifyContent: 'center', zIndex: 9998 }}>
<div style={{ background: C.white, borderRadius: 16, padding: '24px 28px', maxWidth: 500, width: '90%', maxHeight: '90vh', overflowY: 'auto' }}>
<div style={{ background: '#FFFFFF', borderRadius: 16, padding: '24px 28px', maxWidth: 500, width: '90%', maxHeight: '90vh', overflowY: 'auto' }}>
<h3 style={{ margin: '0 0 20px', fontSize: '18px', fontWeight: 700, color: C.navy }}>{r.id ? 'Edit Room' : 'New Room'}</h3>
<div style={{ display: 'grid', gap: '14px' }}>
<I label="Name" value={r.name} onChange={(v: string) => setRoom({ ...r, name: v })} />
@@ -688,7 +688,7 @@ function MenuEditor({ item, setItem, onSave, onCancel }: any) {
const i = { ...item };
return (
<div style={{ position: 'fixed', top: 0, left: 0, right: 0, bottom: 0, background: 'rgba(0,0,0,0.4)', display: 'flex', alignItems: 'center', justifyContent: 'center', zIndex: 9998 }}>
<div style={{ background: C.white, borderRadius: 16, padding: '24px 28px', maxWidth: 460, width: '90%' }}>
<div style={{ background: '#FFFFFF', borderRadius: 16, padding: '24px 28px', maxWidth: 460, width: '90%' }}>
<h3 style={{ margin: '0 0 20px', fontSize: '18px', fontWeight: 700, color: C.navy }}>{i.id ? 'Edit Item' : 'New Item'}</h3>
<div style={{ display: 'grid', gap: '14px' }}>
<I label="Category" value={i.category} onChange={(v: string) => setItem({ ...i, category: v })} />
@@ -776,7 +776,7 @@ function PlaceEditor({ place, setPlace, images, onSave, onCancel }: any) {
return (
<div style={{ position: 'fixed', top: 0, left: 0, right: 0, bottom: 0, background: 'rgba(0,0,0,0.4)', display: 'flex', alignItems: 'center', justifyContent: 'center', zIndex: 9998 }}>
<div style={{ background: C.white, borderRadius: 16, padding: '24px 28px', maxWidth: 500, width: '90%', maxHeight: '90vh', overflowY: 'auto' }}>
<div style={{ background: '#FFFFFF', borderRadius: 16, padding: '24px 28px', maxWidth: 500, width: '90%', maxHeight: '90vh', overflowY: 'auto' }}>
<h3 style={{ margin: '0 0 20px', fontSize: '18px', fontWeight: 700, color: C.navy }}>{p.id ? 'Edit Place' : 'New Place'}</h3>
<div style={{ display: 'grid', gap: '14px' }}>
<I label="Name" value={p.name} onChange={(v: string) => setPlace({ ...p, name: v })} />