react-toastify#ToastContainerProps TypeScript Examples

The following examples show how to use react-toastify#ToastContainerProps. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: Container.tsx    From houston with MIT License 5 votes vote down vote up
ToastContainer: React.FC<ToastContainerProps> = props => {
  const theme = useHoustonTheme();
  const styleContent = React.useMemo(
    () => ({
      __html: `
        ${styles}

        .Toastify__toast {
          border-radius: 4px;
          margin-bottom: 16px;
          padding: 8px 16px;
        }

        .Toastify__toast-body {
          font-family: ${theme?.font?.family ?? 'Open Sans'};
          font-weight: 600;
          padding-right: 8px;
          line-height: 1.45;
        }

        .Toastify__close-button {
          align-self: center;
        }
      `
    }),
    [theme?.font?.family]
  );

  return (
    <>
      <style dangerouslySetInnerHTML={styleContent} />

      <ToastContainerToastify
        {...props}
        transition={Slide}
        position='top-right'
        autoClose={4000}
        hideProgressBar={false}
        newestOnTop={false}
        closeOnClick
        rtl={false}
        draggable={false}
        pauseOnFocusLoss
        pauseOnHover
        icon={false}
        limit={4}
      />
    </>
  );
}