Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,4 +1,14 @@
import { Button, Modal } from '@rocket.chat/fuselage';
import {
Button,
Modal,
ModalClose,
ModalContent,
ModalFooter,
ModalFooterControllers,
ModalHeader,
ModalIcon,
ModalTitle,
} from '@rocket.chat/fuselage';
import { useTranslation } from 'react-i18next';

type PlaceChatOnHoldModalProps = {
Expand All @@ -12,20 +22,20 @@ const PlaceChatOnHoldModal = ({ onCancel, onOnHoldChat, confirm = onOnHoldChat,

return (
<Modal {...props} data-qa-id='on-hold-modal'>
<Modal.Header>
<Modal.Icon name='pause-unfilled' />
<Modal.Title>{t('Omnichannel_onHold_Chat')}</Modal.Title>
<Modal.Close onClick={onCancel} />
</Modal.Header>
<Modal.Content fontScale='p2'>{t('Would_you_like_to_place_chat_on_hold')}</Modal.Content>
<Modal.Footer>
<Modal.FooterControllers>
<ModalHeader>
<ModalIcon name='pause-unfilled' />
<ModalTitle>{t('Omnichannel_onHold_Chat')}</ModalTitle>
<ModalClose onClick={onCancel} />
</ModalHeader>
<ModalContent fontScale='p2'>{t('Would_you_like_to_place_chat_on_hold')}</ModalContent>
<ModalFooter>
<ModalFooterControllers>
<Button onClick={onCancel}>{t('Cancel')}</Button>
<Button primary onClick={confirm}>
{t('Omnichannel_onHold_Chat')}
</Button>
</Modal.FooterControllers>
</Modal.Footer>
</ModalFooterControllers>
</ModalFooter>
</Modal>
);
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@ import {
FieldDescription,
Accordion,
AccordionItem,
ModalHeader,
ModalTitle,
ModalClose,
ModalContent,
ModalFooter,
ModalFooterControllers,
} from '@rocket.chat/fuselage';
import type { TranslationKey } from '@rocket.chat/ui-contexts';
import {
Expand Down Expand Up @@ -206,11 +212,11 @@ const CreateChannelModal = ({ teamId = '', onClose, reload }: CreateChannelModal
<Box is='form' id={createChannelFormId} onSubmit={handleSubmit(handleCreateChannel)} {...props} />
)}
>
<Modal.Header>
<Modal.Title id={`${createChannelFormId}-title`}>{t('Create_channel')}</Modal.Title>
<Modal.Close tabIndex={-1} title={t('Close')} onClick={onClose} />
</Modal.Header>
<Modal.Content mbe={2}>
<ModalHeader>
<ModalTitle id={`${createChannelFormId}-title`}>{t('Create_channel')}</ModalTitle>
<ModalClose tabIndex={-1} title={t('Close')} onClick={onClose} />
</ModalHeader>
<ModalContent mbe={2}>
<FieldGroup mbe={24}>
<Field>
<FieldLabel required htmlFor={nameId}>
Expand Down Expand Up @@ -370,15 +376,15 @@ const CreateChannelModal = ({ teamId = '', onClose, reload }: CreateChannelModal
</FieldGroup>
</AccordionItem>
</Accordion>
</Modal.Content>
<Modal.Footer>
<Modal.FooterControllers>
</ModalContent>
<ModalFooter>
<ModalFooterControllers>
<Button onClick={onClose}>{t('Cancel')}</Button>
<Button type='submit' primary data-qa-type='create-channel-confirm-button'>
{t('Create')}
</Button>
</Modal.FooterControllers>
</Modal.Footer>
</ModalFooterControllers>
</ModalFooter>
</Modal>
);
};
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,20 @@
import type { IUser } from '@rocket.chat/core-typings';
import { Box, Modal, Button, FieldGroup, Field, FieldRow, FieldError, FieldHint } from '@rocket.chat/fuselage';
import {
Box,
Modal,
Button,
FieldGroup,
Field,
FieldRow,
FieldError,
FieldHint,
ModalHeader,
ModalTitle,
ModalClose,
ModalContent,
ModalFooter,
ModalFooterControllers,
} from '@rocket.chat/fuselage';
import { useTranslation, useEndpoint, useToastMessageDispatch, useSetting } from '@rocket.chat/ui-contexts';
import { useMutation } from '@tanstack/react-query';
import { useId, memo } from 'react';
Expand Down Expand Up @@ -43,11 +58,11 @@ const CreateDirectMessage = ({ onClose }: CreateDirectMessageProps) => {

return (
<Modal data-qa='create-direct-modal' wrapperFunction={(props) => <Box is='form' onSubmit={handleSubmit(handleCreate)} {...props} />}>
<Modal.Header>
<Modal.Title>{t('Create_direct_message')}</Modal.Title>
<Modal.Close tabIndex={-1} onClick={onClose} />
</Modal.Header>
<Modal.Content mbe={2}>
<ModalHeader>
<ModalTitle>{t('Create_direct_message')}</ModalTitle>
<ModalClose tabIndex={-1} onClick={onClose} />
</ModalHeader>
<ModalContent mbe={2}>
<FieldGroup>
<Field>
<Box htmlFor={membersFieldId}>{t('Direct_message_creation_description')}</Box>
Expand Down Expand Up @@ -84,15 +99,15 @@ const CreateDirectMessage = ({ onClose }: CreateDirectMessageProps) => {
<FieldHint id={`${membersFieldId}-hint`}>{t('Direct_message_creation_description_hint')}</FieldHint>
</Field>
</FieldGroup>
</Modal.Content>
<Modal.Footer>
<Modal.FooterControllers>
</ModalContent>
<ModalFooter>
<ModalFooterControllers>
<Button onClick={onClose}>{t('Cancel')}</Button>
<Button loading={isSubmitting || isValidating} type='submit' primary>
{t('Create')}
</Button>
</Modal.FooterControllers>
</Modal.Footer>
</ModalFooterControllers>
</ModalFooter>
</Modal>
);
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@ import {
Accordion,
AccordionItem,
Divider,
ModalHeader,
ModalTitle,
ModalClose,
ModalContent,
ModalFooter,
ModalFooterControllers,
} from '@rocket.chat/fuselage';
import { FeaturePreview, FeaturePreviewOff, FeaturePreviewOn } from '@rocket.chat/ui-client';
import {
Expand Down Expand Up @@ -178,11 +184,11 @@ const CreateTeamModal = ({ onClose }: CreateTeamModalProps) => {
<Box is='form' id={createTeamFormId} onSubmit={handleSubmit(handleCreateTeam)} {...props} />
)}
>
<Modal.Header>
<Modal.Title id={`${createTeamFormId}-title`}>{t('Teams_New_Title')}</Modal.Title>
<Modal.Close title={t('Close')} onClick={onClose} tabIndex={-1} />
</Modal.Header>
<Modal.Content mbe={2}>
<ModalHeader>
<ModalTitle id={`${createTeamFormId}-title`}>{t('Teams_New_Title')}</ModalTitle>
<ModalClose title={t('Close')} onClick={onClose} tabIndex={-1} />
</ModalHeader>
<ModalContent mbe={2}>
<Box fontScale='p2' mbe={16}>
{t('Teams_new_description')}
</Box>
Expand Down Expand Up @@ -367,15 +373,15 @@ const CreateTeamModal = ({ onClose }: CreateTeamModalProps) => {
</FieldGroup>
</AccordionItem>
</Accordion>
</Modal.Content>
<Modal.Footer>
<Modal.FooterControllers>
</ModalContent>
<ModalFooter>
<ModalFooterControllers>
<Button onClick={onClose}>{t('Cancel')}</Button>
<Button disabled={!canCreateTeam} loading={isSubmitting} type='submit' primary>
{t('Create')}
</Button>
</Modal.FooterControllers>
</Modal.Footer>
</ModalFooterControllers>
</ModalFooter>
</Modal>
);
};
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,23 @@
import type { IUser } from '@rocket.chat/core-typings';
import { Field, TextInput, FieldGroup, Modal, Button, Box, FieldLabel, FieldRow, FieldError, FieldHint } from '@rocket.chat/fuselage';
import {
Field,
TextInput,
FieldGroup,
Modal,
Button,
Box,
FieldLabel,
FieldRow,
FieldError,
FieldHint,
ModalHeader,
ModalIcon,
ModalTitle,
ModalClose,
ModalContent,
ModalFooter,
ModalFooterControllers,
} from '@rocket.chat/fuselage';
import { useEffectEvent, useLocalStorage } from '@rocket.chat/fuselage-hooks';
import { useToastMessageDispatch, useSetting, useTranslation, useEndpoint } from '@rocket.chat/ui-contexts';
import type { ReactElement, ChangeEvent, ComponentProps, FormEvent } from 'react';
Expand Down Expand Up @@ -49,7 +67,7 @@ const EditStatusModal = ({ onClose, userStatus, userStatusText }: EditStatusModa
}

onClose();
}, [dispatchToastMessage, setUserStatus, statusText, statusType, onClose, t]);
}, [onClose, setUserStatus, statusText, statusType, setCustomStatus, dispatchToastMessage, t]);

return (
<Modal
Expand All @@ -64,12 +82,12 @@ const EditStatusModal = ({ onClose, userStatus, userStatusText }: EditStatusModa
/>
)}
>
<Modal.Header>
<Modal.Icon name='info' />
<Modal.Title>{t('Edit_Status')}</Modal.Title>
<Modal.Close onClick={onClose} />
</Modal.Header>
<Modal.Content fontScale='p2'>
<ModalHeader>
<ModalIcon name='info' />
<ModalTitle>{t('Edit_Status')}</ModalTitle>
<ModalClose onClick={onClose} />
</ModalHeader>
<ModalContent fontScale='p2'>
<FieldGroup>
<Field>
<FieldLabel>{t('StatusMessage')}</FieldLabel>
Expand All @@ -88,17 +106,17 @@ const EditStatusModal = ({ onClose, userStatus, userStatusText }: EditStatusModa
<FieldError>{statusTextError}</FieldError>
</Field>
</FieldGroup>
</Modal.Content>
<Modal.Footer>
<Modal.FooterControllers>
</ModalContent>
<ModalFooter>
<ModalFooterControllers>
<Button secondary onClick={onClose}>
{t('Cancel')}
</Button>
<Button primary type='submit' disabled={!!statusTextError}>
{t('Save')}
</Button>
</Modal.FooterControllers>
</Modal.Footer>
</ModalFooterControllers>
</ModalFooter>
</Modal>
);
};
Expand Down
8 changes: 4 additions & 4 deletions apps/meteor/client/components/Backdrop.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Modal } from '@rocket.chat/fuselage';
import type { ComponentProps, ReactElement } from 'react';
import { ModalBackdrop } from '@rocket.chat/fuselage';
import type { ComponentProps } from 'react';

type BackdropProps = ComponentProps<typeof Modal.Backdrop>;
type BackdropProps = ComponentProps<typeof ModalBackdrop>;

export const Backdrop = (props: BackdropProps): ReactElement => <Modal.Backdrop bg='transparent' {...props} />;
export const Backdrop = (props: BackdropProps) => <ModalBackdrop bg='transparent' {...props} />;
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@ import {
FieldLabel,
FieldRow,
FieldError,
ModalHeader,
ModalTitle,
ModalClose,
ModalContent,
ModalFooter,
ModalFooterControllers,
} from '@rocket.chat/fuselage';
import { useTranslation, useEndpoint } from '@rocket.chat/ui-contexts';
import { useMutation } from '@tanstack/react-query';
Expand Down Expand Up @@ -98,11 +104,11 @@ const CreateDiscussion = ({ onClose, defaultParentRoom, parentMessageId, nameSug
aria-labelledby={`${modalId}-title`}
wrapperFunction={(props) => <Box is='form' onSubmit={handleSubmit(handleCreate)} {...props} />}
>
<Modal.Header>
<Modal.Title id={`${modalId}-title`}>{t('Discussion_title')}</Modal.Title>
<Modal.Close tabIndex={-1} onClick={onClose} />
</Modal.Header>
<Modal.Content>
<ModalHeader>
<ModalTitle id={`${modalId}-title`}>{t('Discussion_title')}</ModalTitle>
<ModalClose tabIndex={-1} onClick={onClose} />
</ModalHeader>
<ModalContent>
<Box mbe={24}>{t('Discussion_description')}</Box>
<FieldGroup>
<Field>
Expand Down Expand Up @@ -243,15 +249,15 @@ const CreateDiscussion = ({ onClose, defaultParentRoom, parentMessageId, nameSug
)}
</Field>
</FieldGroup>
</Modal.Content>
<Modal.Footer>
<Modal.FooterControllers>
</ModalContent>
<ModalFooter>
<ModalFooterControllers>
<Button onClick={onClose}>{t('Cancel')}</Button>
<Button type='submit' primary loading={createDiscussionMutation.isPending}>
{t('Create')}
</Button>
</Modal.FooterControllers>
</Modal.Footer>
</ModalFooterControllers>
</ModalFooter>
</Modal>
);
};
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import { Box, Modal } from '@rocket.chat/fuselage';
import { Box, ModalHeroImage } from '@rocket.chat/fuselage';
import { GenericModal } from '@rocket.chat/ui-client';
import type { ReactElement, ComponentProps } from 'react';
import { useTranslation } from 'react-i18next';

type GenericUpsellModalProps = Omit<ComponentProps<typeof GenericModal>, 'variant' | 'children' | 'onClose' | 'onDismiss'> & {
subtitle?: string | ReactElement;
description?: string | ReactElement;
img: ComponentProps<typeof Modal.HeroImage>['src'];
img: ComponentProps<typeof ModalHeroImage>['src'];

imgWidth?: ComponentProps<typeof Modal.HeroImage>['width'];
imgHeight?: ComponentProps<typeof Modal.HeroImage>['height'];
imgWidth?: ComponentProps<typeof ModalHeroImage>['width'];
imgHeight?: ComponentProps<typeof ModalHeroImage>['height'];
imgAlt?: string;
onClose: () => void;
onConfirm?: () => void;
Expand Down Expand Up @@ -37,7 +37,7 @@ const GenericUpsellModal = ({
variant='upsell'
confirmText={confirmText ?? t('Upgrade')}
>
<Modal.HeroImage src={img} alt={imgAlt} width={imgWidth} height={imgHeight} />
<ModalHeroImage src={img} alt={imgAlt} width={imgWidth} height={imgHeight} />
{subtitle && (
<Box is='h3' fontScale='h3'>
{subtitle}
Expand Down
Loading
Loading