Skip to content

Commit

Permalink
regression: SIDE-170
Browse files Browse the repository at this point in the history
  • Loading branch information
ggazzo committed Sep 17, 2024
1 parent 1025f3e commit d6d31ed
Show file tree
Hide file tree
Showing 2 changed files with 90 additions and 78 deletions.
88 changes: 48 additions & 40 deletions apps/meteor/client/sidebarv2/header/CreateTeamModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import {
AccordionItem,
} from '@rocket.chat/fuselage';
import { useUniqueId } from '@rocket.chat/fuselage-hooks';
import { FeaturePreview, FeaturePreviewOff, FeaturePreviewOn } from '@rocket.chat/ui-client';
import {
useEndpoint,
usePermission,
Expand Down Expand Up @@ -248,49 +249,56 @@ const CreateTeamModal = ({ onClose }: CreateTeamModalProps) => {
</FieldGroup>
<Accordion>
<AccordionItem title={t('Advanced_settings')}>
<FieldGroup>
<Box is='h5' fontScale='h5' color='titles-labels'>
{t('Navigation')}
</Box>
<Field>
<FieldRow>
<FieldLabel htmlFor={showChannelsId}>{t('Channels')}</FieldLabel>
<Controller
control={control}
name='showChannels'
render={({ field: { onChange, value, ref } }): ReactElement => (
<ToggleSwitch
aria-describedby={`${showChannelsId}-hint`}
id={showChannelsId}
onChange={onChange}
checked={value}
ref={ref}
<FeaturePreview feature='sidepanelNavigation'>
<FeaturePreviewOff>{null}</FeaturePreviewOff>
<FeaturePreviewOn>
<FieldGroup>
<Box is='h5' fontScale='h5' color='titles-labels'>
{t('Navigation')}
</Box>
<Field>
<FieldRow>
<FieldLabel htmlFor={showChannelsId}>{t('Channels')}</FieldLabel>
<Controller
control={control}
name='showChannels'
render={({ field: { onChange, value, ref } }): ReactElement => (
<ToggleSwitch
aria-describedby={`${showChannelsId}-hint`}
id={showChannelsId}
onChange={onChange}
checked={value}
ref={ref}
/>
)}
/>
)}
/>
</FieldRow>
<FieldDescription id={`${showChannelsId}-hint`}>{t('Show_channels_description')}</FieldDescription>
</Field>
</FieldRow>
<FieldDescription id={`${showChannelsId}-hint`}>{t('Show_channels_description')}</FieldDescription>
</Field>

<Field>
<FieldRow>
<FieldLabel htmlFor={showDiscussionsId}>{t('Discussions')}</FieldLabel>
<Controller
control={control}
name='showDiscussions'
render={({ field: { onChange, value, ref } }): ReactElement => (
<ToggleSwitch
aria-describedby={`${showDiscussionsId}-hint`}
id={showDiscussionsId}
onChange={onChange}
checked={value}
ref={ref}
<Field>
<FieldRow>
<FieldLabel htmlFor={showDiscussionsId}>{t('Discussions')}</FieldLabel>
<Controller
control={control}
name='showDiscussions'
render={({ field: { onChange, value, ref } }): ReactElement => (
<ToggleSwitch
aria-describedby={`${showDiscussionsId}-hint`}
id={showDiscussionsId}
onChange={onChange}
checked={value}
ref={ref}
/>
)}
/>
)}
/>
</FieldRow>
<FieldDescription id={`${showDiscussionsId}-hint`}>{t('Show_discussions_description')}</FieldDescription>
</Field>
</FieldRow>
<FieldDescription id={`${showDiscussionsId}-hint`}>{t('Show_discussions_description')}</FieldDescription>
</Field>
</FieldGroup>
</FeaturePreviewOn>
</FeaturePreview>
<FieldGroup>
<Box is='h5' fontScale='h5' color='titles-labels'>
{t('Security_and_permissions')}
</Box>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import {
Divider,
} from '@rocket.chat/fuselage';
import { useEffectEvent, useUniqueId } from '@rocket.chat/fuselage-hooks';
import { FeaturePreview, FeaturePreviewOff, FeaturePreviewOn } from '@rocket.chat/ui-client';
import type { TranslationKey } from '@rocket.chat/ui-contexts';
import { useSetting, useTranslation, useToastMessageDispatch, useEndpoint } from '@rocket.chat/ui-contexts';
import type { ChangeEvent } from 'react';
Expand Down Expand Up @@ -371,44 +372,47 @@ const EditRoomInfo = ({ room, onClickClose, onClickBack }: EditRoomInfoProps) =>
{showAdvancedSettings && (
<AccordionItem title={t('Advanced_settings')}>
{roomType === 'team' && (
<>
<FieldGroup>
<Box is='h5' fontScale='h5' color='titles-labels'>
{t('Navigation')}
</Box>
<Field>
<FieldRow>
<FieldLabel htmlFor={showChannelsField}>{t('Channels')}</FieldLabel>
<Controller
control={control}
name='showChannels'
render={({ field: { value, ...field } }) => (
<ToggleSwitch id={showChannelsField} checked={value} {...field} />
)}
/>
</FieldRow>
<FieldRow>
<FieldHint id={`${showChannelsField}-hint`}>{t('Show_channels_description')}</FieldHint>
</FieldRow>
</Field>
<Field>
<FieldRow>
<FieldLabel htmlFor={showDiscussionsField}>{t('Discussions')}</FieldLabel>
<Controller
control={control}
name='showDiscussions'
render={({ field: { value, ...field } }) => (
<ToggleSwitch id={showDiscussionsField} checked={value} {...field} />
)}
/>
</FieldRow>
<FieldRow>
<FieldHint id={`${showDiscussionsField}-hint`}>{t('Show_discussions_description')}</FieldHint>
</FieldRow>
</Field>
</FieldGroup>
<Divider mb={24} />
</>
<FeaturePreview feature='sidepanelNavigation'>
<FeaturePreviewOff>{null}</FeaturePreviewOff>
<FeaturePreviewOn>
<FieldGroup>
<Box is='h5' fontScale='h5' color='titles-labels'>
{t('Navigation')}
</Box>
<Field>
<FieldRow>
<FieldLabel htmlFor={showChannelsField}>{t('Channels')}</FieldLabel>
<Controller
control={control}
name='showChannels'
render={({ field: { value, ...field } }) => (
<ToggleSwitch id={showChannelsField} checked={value} {...field} />
)}
/>
</FieldRow>
<FieldRow>
<FieldHint id={`${showChannelsField}-hint`}>{t('Show_channels_description')}</FieldHint>
</FieldRow>
</Field>
<Field>
<FieldRow>
<FieldLabel htmlFor={showDiscussionsField}>{t('Discussions')}</FieldLabel>
<Controller
control={control}
name='showDiscussions'
render={({ field: { value, ...field } }) => (
<ToggleSwitch id={showDiscussionsField} checked={value} {...field} />
)}
/>
</FieldRow>
<FieldRow>
<FieldHint id={`${showDiscussionsField}-hint`}>{t('Show_discussions_description')}</FieldHint>
</FieldRow>
</Field>
</FieldGroup>
<Divider mb={24} />
</FeaturePreviewOn>
</FeaturePreview>
)}
<FieldGroup>
<Box is='h5' fontScale='h5' color='titles-labels'>
Expand Down

0 comments on commit d6d31ed

Please sign in to comment.