feat: lock CNPJ/email edits, add support dialog and CEP-first layout
This commit is contained in:
@@ -37,6 +37,8 @@ export default function ConfiguracoesPage() {
|
|||||||
const [customColor2, setCustomColor2] = useState('#FF0080');
|
const [customColor2, setCustomColor2] = useState('#FF0080');
|
||||||
const [showSuccessDialog, setShowSuccessDialog] = useState(false);
|
const [showSuccessDialog, setShowSuccessDialog] = useState(false);
|
||||||
const [successMessage, setSuccessMessage] = useState('');
|
const [successMessage, setSuccessMessage] = useState('');
|
||||||
|
const [showSupportDialog, setShowSupportDialog] = useState(false);
|
||||||
|
const [supportMessage, setSupportMessage] = useState('Para alterar estes dados, contate o suporte.');
|
||||||
const [loading, setLoading] = useState(true);
|
const [loading, setLoading] = useState(true);
|
||||||
|
|
||||||
// Dados da agência (buscados da API)
|
// Dados da agência (buscados da API)
|
||||||
@@ -313,32 +315,42 @@ export default function ConfiguracoesPage() {
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
<label className="block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2">
|
<label className="block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2 flex items-center justify-between">
|
||||||
CNPJ
|
<span>CNPJ</span>
|
||||||
|
<span className="text-xs text-gray-500">Alteração via suporte</span>
|
||||||
</label>
|
</label>
|
||||||
<input
|
<input
|
||||||
type="text"
|
type="text"
|
||||||
value={agencyData.cnpj}
|
value={agencyData.cnpj}
|
||||||
onChange={(e) => setAgencyData({ ...agencyData, cnpj: e.target.value })}
|
readOnly
|
||||||
className="w-full px-4 py-2 border border-gray-300 dark:border-gray-600 rounded-lg bg-white dark:bg-gray-900 text-gray-900 dark:text-white focus:ring-2 focus:ring-gray-400 dark:focus:ring-gray-600 focus:outline-none"
|
onClick={() => {
|
||||||
|
setSupportMessage('Para alterar CNPJ, contate o suporte.');
|
||||||
|
setShowSupportDialog(true);
|
||||||
|
}}
|
||||||
|
className="w-full px-4 py-2 border border-gray-300 dark:border-gray-600 rounded-lg bg-gray-50 dark:bg-gray-800 text-gray-900 dark:text-white focus:outline-none cursor-pointer"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
<label className="block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2">
|
<label className="block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2 flex items-center justify-between">
|
||||||
E-mail
|
<span>E-mail (acesso)</span>
|
||||||
|
<span className="text-xs text-gray-500">Alteração via suporte</span>
|
||||||
</label>
|
</label>
|
||||||
<input
|
<input
|
||||||
type="email"
|
type="email"
|
||||||
value={agencyData.email}
|
value={agencyData.email}
|
||||||
onChange={(e) => setAgencyData({ ...agencyData, email: e.target.value })}
|
readOnly
|
||||||
className="w-full px-4 py-2 border border-gray-300 dark:border-gray-600 rounded-lg bg-white dark:bg-gray-900 text-gray-900 dark:text-white focus:ring-2 focus:ring-gray-400 dark:focus:ring-gray-600 focus:outline-none"
|
onClick={() => {
|
||||||
|
setSupportMessage('Para alterar o e-mail de acesso, contate o suporte.');
|
||||||
|
setShowSupportDialog(true);
|
||||||
|
}}
|
||||||
|
className="w-full px-4 py-2 border border-gray-300 dark:border-gray-600 rounded-lg bg-gray-50 dark:bg-gray-800 text-gray-900 dark:text-white focus:outline-none cursor-pointer"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
<label className="block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2">
|
<label className="block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2">
|
||||||
Telefone
|
Telefone / WhatsApp
|
||||||
</label>
|
</label>
|
||||||
<input
|
<input
|
||||||
type="tel"
|
type="tel"
|
||||||
@@ -360,6 +372,18 @@ export default function ConfiguracoesPage() {
|
|||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<label className="block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2">
|
||||||
|
CEP
|
||||||
|
</label>
|
||||||
|
<input
|
||||||
|
type="text"
|
||||||
|
value={agencyData.zip}
|
||||||
|
onChange={(e) => setAgencyData({ ...agencyData, zip: e.target.value })}
|
||||||
|
className="w-full px-4 py-2 border border-gray-300 dark:border-gray-600 rounded-lg bg-white dark:bg-gray-900 text-gray-900 dark:text-white focus:ring-2 focus:ring-gray-400 dark:focus:ring-gray-600 focus:outline-none"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div className="md:col-span-2">
|
<div className="md:col-span-2">
|
||||||
<label className="block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2">
|
<label className="block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2">
|
||||||
Endereço
|
Endereço
|
||||||
@@ -396,17 +420,7 @@ export default function ConfiguracoesPage() {
|
|||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div>
|
|
||||||
<label className="block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2">
|
|
||||||
CEP
|
|
||||||
</label>
|
|
||||||
<input
|
|
||||||
type="text"
|
|
||||||
value={agencyData.zip}
|
|
||||||
onChange={(e) => setAgencyData({ ...agencyData, zip: e.target.value })}
|
|
||||||
className="w-full px-4 py-2 border border-gray-300 dark:border-gray-600 rounded-lg bg-white dark:bg-gray-900 text-gray-900 dark:text-white focus:ring-2 focus:ring-gray-400 dark:focus:ring-gray-600 focus:outline-none"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="mt-6 flex justify-end">
|
<div className="mt-6 flex justify-end">
|
||||||
@@ -708,6 +722,26 @@ export default function ConfiguracoesPage() {
|
|||||||
</button>
|
</button>
|
||||||
</Dialog.Footer>
|
</Dialog.Footer>
|
||||||
</Dialog>
|
</Dialog>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
{/* Dialog de Suporte */}
|
||||||
|
<Dialog
|
||||||
|
isOpen={showSupportDialog}
|
||||||
|
onClose={() => setShowSupportDialog(false)}
|
||||||
|
title="Contatar suporte"
|
||||||
|
>
|
||||||
|
<Dialog.Body>
|
||||||
|
<p className="text-sm text-gray-700 dark:text-gray-200">{supportMessage}</p>
|
||||||
|
<p className="mt-3 text-sm text-gray-500">Envie um e-mail para suporte@aggios.app ou abra um chamado para ajuste desses dados.</p>
|
||||||
|
</Dialog.Body>
|
||||||
|
<Dialog.Footer>
|
||||||
|
<button
|
||||||
|
onClick={() => setShowSupportDialog(false)}
|
||||||
|
className="px-4 py-2 bg-gray-900 dark:bg-gray-100 text-white dark:text-gray-900 rounded-lg font-medium hover:scale-105 transition-all"
|
||||||
|
>
|
||||||
|
Fechar
|
||||||
|
</button>
|
||||||
|
</Dialog.Footer>
|
||||||
|
</Dialog>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user