Skip to content

Commit

Permalink
feat: ✨ Hide join default channels on user editing page
Browse files Browse the repository at this point in the history
  • Loading branch information
rique223 committed Jul 30, 2024
1 parent 6cd4678 commit f92f17d
Showing 1 changed file with 16 additions and 14 deletions.
30 changes: 16 additions & 14 deletions apps/meteor/client/views/admin/users/AdminUserForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -353,20 +353,22 @@ const AdminUserForm = ({ userData, onReload, context, refetchUserFormData, roleD
</FieldRow>
{errors?.roles && <FieldError>{errors.roles.message}</FieldError>}
</Field>
<Field>
<Box display='flex' flexDirection='row' alignItems='center' justifyContent='space-between' flexGrow={1}>
<FieldLabel htmlFor={joinDefaultChannelsId}>{t('Join_default_channels')}</FieldLabel>
<FieldRow>
<Controller
control={control}
name='joinDefaultChannels'
render={({ field: { ref, onChange, value } }) => (
<ToggleSwitch id={joinDefaultChannelsId} ref={ref} onChange={onChange} checked={value} />
)}
/>
</FieldRow>
</Box>
</Field>
{isNewUserPage && (
<Field>
<Box display='flex' flexDirection='row' alignItems='center' justifyContent='space-between' flexGrow={1}>
<FieldLabel htmlFor={joinDefaultChannelsId}>{t('Join_default_channels')}</FieldLabel>
<FieldRow>
<Controller
control={control}
name='joinDefaultChannels'
render={({ field: { ref, onChange, value } }) => (
<ToggleSwitch id={joinDefaultChannelsId} ref={ref} onChange={onChange} checked={value} />
)}
/>
</FieldRow>
</Box>
</Field>
)}
<Field>
<Box display='flex' flexDirection='row' alignItems='center' justifyContent='space-between' flexGrow={1} mbe={8}>
<FieldLabel htmlFor={sendWelcomeEmailId} disabled={!isSmtpEnabled}>
Expand Down

0 comments on commit f92f17d

Please sign in to comment.