Move toasts to sonner (#6053)
This commit is contained in:
@@ -2,6 +2,7 @@ import { observer } from "mobx-react";
|
||||
import { CloseIcon } from "outline-icons";
|
||||
import * as React from "react";
|
||||
import { Trans, useTranslation } from "react-i18next";
|
||||
import { toast } from "sonner";
|
||||
import styled from "styled-components";
|
||||
import Button from "~/components/Button";
|
||||
import Fade from "~/components/Fade";
|
||||
@@ -11,7 +12,6 @@ import NudeButton from "~/components/NudeButton";
|
||||
import Tooltip from "~/components/Tooltip";
|
||||
import useCurrentTeam from "~/hooks/useCurrentTeam";
|
||||
import useStores from "~/hooks/useStores";
|
||||
import useToasts from "~/hooks/useToasts";
|
||||
import SettingRow from "./SettingRow";
|
||||
|
||||
type Props = {
|
||||
@@ -22,7 +22,6 @@ function DomainManagement({ onSuccess }: Props) {
|
||||
const { auth } = useStores();
|
||||
const team = useCurrentTeam();
|
||||
const { t } = useTranslation();
|
||||
const { showToast } = useToasts();
|
||||
|
||||
const [allowedDomains, setAllowedDomains] = React.useState([
|
||||
...(team.allowedDomains ?? []),
|
||||
@@ -43,11 +42,9 @@ function DomainManagement({ onSuccess }: Props) {
|
||||
setExistingDomainsTouched(false);
|
||||
updateLastKnownDomainCount(allowedDomains.length);
|
||||
} catch (err) {
|
||||
showToast(err.message, {
|
||||
type: "error",
|
||||
});
|
||||
toast.error(err.message);
|
||||
}
|
||||
}, [auth, allowedDomains, onSuccess, showToast]);
|
||||
}, [auth, allowedDomains, onSuccess]);
|
||||
|
||||
const handleRemoveDomain = async (index: number) => {
|
||||
const newDomains = allowedDomains.filter((_, i) => index !== i);
|
||||
|
||||
Reference in New Issue
Block a user