Replace company email with address field

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Krao Hasanee
2026-03-26 23:59:21 -04:00
parent 8b5494a824
commit e7174d392c
3 changed files with 16 additions and 16 deletions
+12 -12
View File
@@ -11,7 +11,7 @@ export default function Companies() {
const [tasks, setTasks] = useState([]);
const [loading, setLoading] = useState(true);
const [showNew, setShowNew] = useState(false);
const [newForm, setNewForm] = useState({ name: '', email: '', phone: '' });
const [newForm, setNewForm] = useState({ name: '', phone: '', address: '' });
const [saving, setSaving] = useState(false);
useEffect(() => {
@@ -38,8 +38,8 @@ export default function Companies() {
setSaving(true);
const { data } = await supabase.from('companies').insert({
name: newForm.name.trim(),
email: newForm.email.trim(),
phone: newForm.phone.trim(),
address: newForm.address.trim(),
}).select().single();
setSaving(false);
if (data) {
@@ -88,15 +88,6 @@ export default function Companies() {
/>
</div>
<div className="grid-2">
<div className="form-group">
<label>Email</label>
<input
type="email"
placeholder="contact@acme.com"
value={newForm.email}
onChange={e => setNewForm(f => ({ ...f, email: e.target.value }))}
/>
</div>
<div className="form-group">
<label>Phone</label>
<input
@@ -106,6 +97,15 @@ export default function Companies() {
onChange={e => setNewForm(f => ({ ...f, phone: e.target.value }))}
/>
</div>
<div className="form-group">
<label>Address</label>
<input
type="text"
placeholder="123 Main St, City, State"
value={newForm.address}
onChange={e => setNewForm(f => ({ ...f, address: e.target.value }))}
/>
</div>
</div>
<div className="action-buttons">
<button type="submit" className="btn btn-primary" disabled={saving || !newForm.name.trim()}>
@@ -164,7 +164,7 @@ export default function Companies() {
{' · '}
{companyProjects.length} project{companyProjects.length !== 1 ? 's' : ''}
{activeTasks.length > 0 && <> · <span style={{ color: 'var(--accent)', fontWeight: 600 }}>{activeTasks.length} active</span></>}
{company.email && <> · {company.email}</>}
{company.phone && <> · {company.phone}</>}
</div>
</div>
<Link to={`/companies/${company.id}`} className="btn btn-outline btn-sm">View</Link>
+3 -3
View File
@@ -110,10 +110,10 @@ export default function CompanyDetail() {
<div>
<div className="page-title">{company.name}</div>
<div className="page-subtitle">
{company.email && <>{company.email}</>}
{company.email && company.phone && ' · '}
{company.phone && <>{company.phone}</>}
{!company.email && !company.phone && 'No contact info'}
{company.phone && company.address && ' · '}
{company.address && <>{company.address}</>}
{!company.phone && !company.address && 'No contact info'}
</div>
</div>
<span className="badge badge-client" style={{ fontSize: 13, padding: '6px 14px' }}>Company</span>