Skip to content

Commit

Permalink
perf: remove transition on closing an account list
Browse files Browse the repository at this point in the history
  • Loading branch information
heorhi-deriv committed Jun 12, 2023
1 parent beb601e commit d19d8c8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/components/src/components/modal/modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,7 @@ type TModal = TModalElement & {
exit_classname?: string;
onEntered?: () => void;
onExited?: () => void;
transition_timeout?: React.ComponentProps<typeof CSSTransition>['timeout'];
};

const Modal = ({
Expand Down Expand Up @@ -242,13 +243,14 @@ const Modal = ({
should_header_stick_body = true,
small,
title,
transition_timeout,
toggleModal,
width,
}: React.PropsWithChildren<TModal>) => (
<CSSTransition
appear
in={is_open}
timeout={250}
timeout={transition_timeout || 250}
classNames={{
appear: 'dc-modal__container--enter',
enter: 'dc-modal__container--enter',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ const TransferAccountSelector = ({
is_open={is_list_modal_open}
onUnmount={() => setIsWalletNameVisible?.(true)}
portalId={portal_id}
transition_timeout={{ enter: 250, exit: 0 }}
title={label}
toggleModal={() => setIsListModalOpen(old => !old)}
>
Expand Down

0 comments on commit d19d8c8

Please sign in to comment.