Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FIX] Modal and sidebar footer styles on IE #22881

Merged
merged 9 commits into from
Aug 12, 2021
17 changes: 12 additions & 5 deletions client/components/CreateDiscussion/CreateDiscussion.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import {
ButtonGroup,
Button,
Icon,
Box,
} from '@rocket.chat/fuselage';
import { useMutableCallback } from '@rocket.chat/fuselage-hooks';
import React, { ReactElement } from 'react';
Expand Down Expand Up @@ -120,11 +121,17 @@ const CreateDiscussion = ({
)}
</Field.Row>
</Field>
<Field display='flex' flexDirection='row' justifyContent='spaceBetween' flexGrow={1}>
<Field.Label>{t('Encrypted')}</Field.Label>
<Field.Row>
<ToggleSwitch checked={encrypted} onChange={handleEncrypted} />
</Field.Row>
<Field
display='flex'
alignItems='center'
flexDirection='row'
justifyContent='spaceBetween'
flexGrow={1}
>
<Box display='flex' flexDirection='column' width='full'>
<Field.Label>{t('Encrypted')}</Field.Label>
</Box>
<ToggleSwitch checked={encrypted} onChange={handleEncrypted} />
</Field>
<Field>
<Field.Label>{t('Discussion_name')}</Field.Label>
Expand Down
11 changes: 6 additions & 5 deletions client/sidebar/footer/SidebarFooter.tsx
Original file line number Diff line number Diff line change
@@ -1,28 +1,29 @@
import { css } from '@rocket.chat/css-in-js';
import { Box } from '@rocket.chat/fuselage';
import colors from '@rocket.chat/fuselage-tokens/colors.json';
import React, { ReactElement } from 'react';

import { settings } from '../../../app/settings/client';

const SidebarFooter = (): ReactElement => {
const sidebarFooterStyle = css`
width: auto;
height: var(--sidebar-footer-height);
padding: var(--sidebar-extra-small-default-padding) var(--sidebar-default-padding);

& img {
max-width: 100%;
height: 100%;
}

& a:any-link {
color: var(--rc-color-primary-light);
color: ${colors.n600};
dougfabris marked this conversation as resolved.
Show resolved Hide resolved
}
`;

return (
<Box
is='footer'
pb='x12'
pi='x16'
height='x48'
width='auto'
className={sidebarFooterStyle}
dangerouslySetInnerHTML={{ __html: String(settings.get('Layout_Sidenav_Footer')).trim() }}
/>
Expand Down
167 changes: 85 additions & 82 deletions client/sidebar/header/CreateChannel.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import {
Icon,
Field,
ToggleSwitch,
FieldGroup,
} from '@rocket.chat/fuselage';
import { useDebouncedCallback } from '@rocket.chat/fuselage-hooks';
import React, { useEffect, useMemo, useState } from 'react';
Expand Down Expand Up @@ -77,92 +78,94 @@ const CreateChannel = ({
<Modal.Close onClick={onClose} />
</Modal.Header>
<Modal.Content>
<Field mbe='x24'>
<Field.Label>{t('Name')}</Field.Label>
<Field.Row>
<TextInput
error={hasUnsavedChanges ? nameError : undefined}
addon={<Icon name={values.type ? 'lock' : 'hash'} size='x20' />}
placeholder={t('Channel_name')}
onChange={handlers.handleName}
/>
</Field.Row>
{hasUnsavedChanges && nameError && <Field.Error>{nameError}</Field.Error>}
</Field>
<Field mbe='x24'>
<Field.Label>
{t('Topic')}{' '}
<Box is='span' color='neutral-600'>
({t('optional')})
<FieldGroup>
<Field>
<Field.Label>{t('Name')}</Field.Label>
<Field.Row>
<TextInput
error={hasUnsavedChanges ? nameError : undefined}
addon={<Icon name={values.type ? 'lock' : 'hash'} size='x20' />}
placeholder={t('Channel_name')}
onChange={handlers.handleName}
/>
</Field.Row>
{hasUnsavedChanges && nameError && <Field.Error>{nameError}</Field.Error>}
</Field>
<Field>
<Field.Label>
{t('Topic')}{' '}
<Box is='span' color='neutral-600'>
({t('optional')})
</Box>
</Field.Label>
<Field.Row>
<TextInput
placeholder={t('Channel_what_is_this_channel_about')}
onChange={handlers.handleDescription}
/>
</Field.Row>
</Field>
<Field>
<Box display='flex' justifyContent='space-between' alignItems='start'>
<Box display='flex' flexDirection='column' width='full'>
<Field.Label>{t('Private')}</Field.Label>
<Field.Description>
{values.type
? t('Only_invited_users_can_acess_this_channel')
: t('Everyone_can_access_this_channel')}
</Field.Description>
</Box>
<ToggleSwitch
checked={values.type}
disabled={!!canOnlyCreateOneType}
onChange={onChangeType}
/>
</Box>
</Field.Label>
<Field.Row>
<TextInput
placeholder={t('Channel_what_is_this_channel_about')}
onChange={handlers.handleDescription}
/>
</Field.Row>
</Field>
<Field mbe='x24'>
<Box display='flex' justifyContent='space-between' alignItems='start'>
<Box display='flex' flexDirection='column'>
<Field.Label>{t('Private')}</Field.Label>
<Field.Description>
{values.type
? t('Only_invited_users_can_acess_this_channel')
: t('Everyone_can_access_this_channel')}
</Field.Description>
</Field>
<Field>
<Box display='flex' justifyContent='space-between' alignItems='start'>
<Box display='flex' flexDirection='column' width='full'>
<Field.Label>{t('Read_only')}</Field.Label>
<Field.Description>
{t('All_users_in_the_channel_can_write_new_messages')}
</Field.Description>
</Box>
<ToggleSwitch
checked={values.readOnly}
disabled={values.broadcast}
onChange={handlers.handleReadOnly}
/>
</Box>
<ToggleSwitch
checked={values.type}
disabled={!!canOnlyCreateOneType}
onChange={onChangeType}
/>
</Box>
</Field>
<Field mbe='x24'>
<Box display='flex' justifyContent='space-between' alignItems='start'>
<Box display='flex' flexDirection='column'>
<Field.Label>{t('Read_only')}</Field.Label>
<Field.Description>
{t('All_users_in_the_channel_can_write_new_messages')}
</Field.Description>
</Field>
<Field>
<Box display='flex' justifyContent='space-between' alignItems='start'>
<Box display='flex' flexDirection='column' width='full'>
<Field.Label>{t('Encrypted')}</Field.Label>
<Field.Description>
{values.type ? t('Encrypted_channel_Description') : t('Encrypted_not_available')}
</Field.Description>
</Box>
<ToggleSwitch
checked={values.encrypted}
disabled={e2edisabled}
onChange={handlers.handleEncrypted}
/>
</Box>
<ToggleSwitch
checked={values.readOnly}
disabled={values.broadcast}
onChange={handlers.handleReadOnly}
/>
</Box>
</Field>
<Field mbe='x24'>
<Box display='flex' justifyContent='space-between' alignItems='start'>
<Box display='flex' flexDirection='column'>
<Field.Label>{t('Encrypted')}</Field.Label>
<Field.Description>
{values.type ? t('Encrypted_channel_Description') : t('Encrypted_not_available')}
</Field.Description>
</Field>
<Field>
<Box display='flex' justifyContent='space-between' alignItems='start'>
<Box display='flex' flexDirection='column' width='full'>
<Field.Label>{t('Broadcast')}</Field.Label>
<Field.Description>{t('Broadcast_channel_Description')}</Field.Description>
</Box>
<ToggleSwitch checked={values.broadcast} onChange={onChangeBroadcast} />
</Box>
<ToggleSwitch
checked={values.encrypted}
disabled={e2edisabled}
onChange={handlers.handleEncrypted}
/>
</Box>
</Field>
<Field mbe='x24'>
<Box display='flex' justifyContent='space-between' alignItems='start'>
<Box display='flex' flexDirection='column'>
<Field.Label>{t('Broadcast')}</Field.Label>
<Field.Description>{t('Broadcast_channel_Description')}</Field.Description>
</Box>
<ToggleSwitch checked={values.broadcast} onChange={onChangeBroadcast} />
</Box>
</Field>
<Field mbe='x24'>
<Field.Label>{`${t('Add_members')} (${t('optional')})`}</Field.Label>
<UserAutoCompleteMultiple value={values.users} onChange={onChangeUsers} />
</Field>
</Field>
<Field>
<Field.Label>{`${t('Add_members')} (${t('optional')})`}</Field.Label>
<UserAutoCompleteMultiple value={values.users} onChange={onChangeUsers} />
</Field>
</FieldGroup>
</Modal.Content>
<Modal.Footer>
<ButtonGroup align='end'>
Expand Down
8 changes: 4 additions & 4 deletions client/views/teams/CreateTeamModal/CreateTeamModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ const CreateTeamModal: FC<CreateTeamModalProps> = ({ onClose }) => {
</Field>
<Field mbe='x24'>
<Box display='flex' justifyContent='space-between' alignItems='start'>
<Box display='flex' flexDirection='column'>
<Box display='flex' flexDirection='column' width='full'>
<Field.Label>{t('Teams_New_Private_Label')}</Field.Label>
<Field.Description>
{type
Expand All @@ -294,7 +294,7 @@ const CreateTeamModal: FC<CreateTeamModalProps> = ({ onClose }) => {
</Field>
<Field mbe='x24' disabled={!canChangeReadOnly}>
<Box display='flex' justifyContent='space-between' alignItems='start'>
<Box display='flex' flexDirection='column'>
<Box display='flex' flexDirection='column' width='full'>
<Field.Label>{t('Teams_New_Read_only_Label')}</Field.Label>
<Field.Description>{t('Teams_New_Read_only_Description')}</Field.Description>
</Box>
Expand All @@ -307,7 +307,7 @@ const CreateTeamModal: FC<CreateTeamModalProps> = ({ onClose }) => {
</Field>
<Field disabled={!canChangeEncrypted} mbe='x24'>
<Box display='flex' justifyContent='space-between' alignItems='start'>
<Box display='flex' flexDirection='column'>
<Box display='flex' flexDirection='column' width='full'>
<Field.Label>{t('Teams_New_Encrypted_Label')}</Field.Label>
<Field.Description>
{type
Expand All @@ -324,7 +324,7 @@ const CreateTeamModal: FC<CreateTeamModalProps> = ({ onClose }) => {
</Field>
<Field mbe='x24'>
<Box display='flex' justifyContent='space-between' alignItems='start'>
<Box display='flex' flexDirection='column'>
<Box display='flex' flexDirection='column' width='full'>
<Field.Label>{t('Teams_New_Broadcast_Label')}</Field.Label>
<Field.Description>{t('Teams_New_Broadcast_Description')}</Field.Description>
</Box>
Expand Down
6 changes: 3 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@
"@rocket.chat/apps-engine": "1.27.1",
"@rocket.chat/css-in-js": "^0.28.0",
"@rocket.chat/emitter": "^0.28.0",
"@rocket.chat/fuselage": "^0.6.3-dev.303",
"@rocket.chat/fuselage": "^0.6.3-dev.306",
"@rocket.chat/fuselage-hooks": "^0.28.0",
"@rocket.chat/fuselage-polyfills": "^0.28.0",
"@rocket.chat/fuselage-tokens": "^0.28.0",
Expand Down