From a9cd4014f27065b2b21538b7132c0046fcbec692 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Fri, 29 Apr 2022 16:47:24 -0500 Subject: [PATCH] EditProfile: fix checkboxes --- app/soapbox/features/edit_profile/index.tsx | 99 +++++++++++---------- app/soapbox/features/forms/index.tsx | 4 +- 2 files changed, 54 insertions(+), 49 deletions(-) diff --git a/app/soapbox/features/edit_profile/index.tsx b/app/soapbox/features/edit_profile/index.tsx index e75a9d4c6..d654f95cc 100644 --- a/app/soapbox/features/edit_profile/index.tsx +++ b/app/soapbox/features/edit_profile/index.tsx @@ -353,59 +353,64 @@ const EditProfile: React.FC = () => { - {features.followRequests && ( - } - hint={} - checked={data.locked} - onChange={handleCheckboxChange('locked')} - /> - )} + {/* HACK: wrap these checkboxes in a .simple_form container so they get styled (for now) */} + {/* Need a either move, replace, or refactor these checkboxes. */} +
+ {features.followRequests && ( + } + hint={} + checked={data.locked} + onChange={handleCheckboxChange('locked')} + /> + )} - {features.hideNetwork && ( - } - hint={} - checked={account ? hidesNetwork(account): false} - onChange={handleHideNetworkChange} - /> - )} + {features.hideNetwork && ( + } + hint={} + checked={account ? hidesNetwork(account): false} + onChange={handleHideNetworkChange} + /> + )} - {features.bots && ( - } - hint={} - checked={data.bot} - onChange={handleCheckboxChange('bot')} - /> - )} + {features.bots && ( + } + hint={} + checked={data.bot} + onChange={handleCheckboxChange('bot')} + /> + )} - {/* - } - hint={} - checked={this.state.stranger_notifications} - onChange={this.handleCheckboxChange('stranger_notifications')} - /> - */} - - {features.profileDirectory && ( + {/* } - hint={} - checked={data.discoverable} - onChange={handleCheckboxChange('discoverable')} + label={} + hint={} + checked={this.state.stranger_notifications} + onChange={this.handleCheckboxChange('stranger_notifications')} /> - )} + */} + + {features.profileDirectory && ( + } + hint={} + checked={data.discoverable} + onChange={handleCheckboxChange('discoverable')} + /> + )} + + {features.emailList && ( + } + hint={} + checked={data.accepts_email_list} + onChange={handleCheckboxChange('accepts_email_list')} + /> + )} +
- {features.emailList && ( - } - hint={} - checked={data.accepts_email_list} - onChange={handleCheckboxChange('accepts_email_list')} - /> - )} {/* */} {/*
diff --git a/app/soapbox/features/forms/index.tsx b/app/soapbox/features/forms/index.tsx index 298b70e58..b7886c0b1 100644 --- a/app/soapbox/features/forms/index.tsx +++ b/app/soapbox/features/forms/index.tsx @@ -82,8 +82,8 @@ interface ISimpleInput { } export const SimpleInput: React.FC = (props) => { - const { hint, label, error, ...rest } = props; - const Input = label ? LabelInput : 'input'; + const { hint, error, ...rest } = props; + const Input = props.label ? LabelInput : 'input'; return (