From 219ec01457382ddfa5bb808d8580c9f38fccd959 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9o=20Poizat?= Date: Thu, 9 Oct 2025 13:34:22 +0200 Subject: [PATCH 1/2] feat: Set some Profile section as readonly We already could not update them but the user could modify text in input. It was doing nothing so it was confusing for the user. --- src/components/Email/EmailReadOnlySection.jsx | 1 + src/components/Input.jsx | 4 +++- src/components/Profile/MatrixIdSection.jsx | 1 + src/components/Profile/PhoneNumberSection.jsx | 1 + 4 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/components/Email/EmailReadOnlySection.jsx b/src/components/Email/EmailReadOnlySection.jsx index e445f937..5ae60516 100644 --- a/src/components/Email/EmailReadOnlySection.jsx +++ b/src/components/Email/EmailReadOnlySection.jsx @@ -27,6 +27,7 @@ const EmailReadOnlySection = () => { label={t('EmailReadOnlySection.subtitle')} value={instance.email} copyable={true} + readOnly /> ) } diff --git a/src/components/Input.jsx b/src/components/Input.jsx index ed8c6116..994a0056 100644 --- a/src/components/Input.jsx +++ b/src/components/Input.jsx @@ -13,7 +13,8 @@ const Input = ({ submitting, errors, onChange, - onBlur + onBlur, + readOnly }) => { return (
@@ -27,6 +28,7 @@ const Input = ({ onBlur={onBlur && (e => onBlur(name, e.target.value))} className={errors && errors.length !== 0 ? 'u-error' : ''} aria-busy={submitting} + readOnly={readOnly} />
) diff --git a/src/components/Profile/MatrixIdSection.jsx b/src/components/Profile/MatrixIdSection.jsx index f18d3753..2a9331cb 100644 --- a/src/components/Profile/MatrixIdSection.jsx +++ b/src/components/Profile/MatrixIdSection.jsx @@ -41,6 +41,7 @@ const MatrixIdSection = () => { label={t(`ProfileView.matrix_id.label`)} value={generatedMatrixId} copyable={true} + readOnly /> ) diff --git a/src/components/Profile/PhoneNumberSection.jsx b/src/components/Profile/PhoneNumberSection.jsx index 777a7888..89955052 100644 --- a/src/components/Profile/PhoneNumberSection.jsx +++ b/src/components/Profile/PhoneNumberSection.jsx @@ -32,6 +32,7 @@ const PhoneNumberSection = () => { label={t(`ProfileView.phone_number.label`)} value={instance?.phone} copyable={true} + readOnly />