chore: i18n in toast

This commit is contained in:
Tristan Yang
2023-01-19 08:39:57 +08:00
parent 1f7baef4b6
commit fd8c54e702
34 changed files with 107 additions and 86 deletions
@@ -23,7 +23,7 @@ const DeleteConfirmModal: FC<Props> = ({ id, closeModal }) => {
useEffect(() => {
if (isSuccess) {
toast.success("delete channel successfully!");
toast.success(ct("tip.delete"));
closeModal();
navigateTo("/chat");
}
+3 -2
View File
@@ -50,6 +50,7 @@ const StyledWrapper = styled.div`
`;
export default function Overview({ id = 0 }) {
const { t } = useTranslation("setting", { keyPrefix: "channel" });
const { t: ct } = useTranslation();
const { loginUser, channel } = useAppSelector((store) => {
return {
loginUser: store.authData.user,
@@ -105,13 +106,13 @@ export default function Overview({ id = 0 }) {
useEffect(() => {
if (updated) {
toast.success("Channel updated!");
toast.success(ct("tip.update"));
refetch();
}
}, [updated]);
useEffect(() => {
if (changeTypeSuccess) {
toast.success("Change channel visibility successfully!");
toast.success(ct("tip.update"));
}
}, [changeTypeSuccess]);