|
|
@ -6,12 +6,26 @@ import { ErrorIcon } from './ReactIcons/ErrorIcon'; |
|
|
|
import { WarningIcon } from './ReactIcons/WarningIcon'; |
|
|
|
import { WarningIcon } from './ReactIcons/WarningIcon'; |
|
|
|
import { InfoIcon } from './ReactIcons/InfoIcon'; |
|
|
|
import { InfoIcon } from './ReactIcons/InfoIcon'; |
|
|
|
import { Spinner } from './ReactIcons/Spinner'; |
|
|
|
import { Spinner } from './ReactIcons/Spinner'; |
|
|
|
|
|
|
|
import { deleteUrlParam, getUrlParams, setUrlParams } from '../lib/browser'; |
|
|
|
|
|
|
|
|
|
|
|
export interface Props {} |
|
|
|
export interface Props {} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const messageCodes: Record<string, string> = { |
|
|
|
|
|
|
|
tl: 'Successfully left the team', |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
export function Toaster(props: Props) { |
|
|
|
export function Toaster(props: Props) { |
|
|
|
const toastMessage = useStore($toastMessage); |
|
|
|
const toastMessage = useStore($toastMessage); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const { c } = getUrlParams(); |
|
|
|
|
|
|
|
if (c) { |
|
|
|
|
|
|
|
deleteUrlParam('c'); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (messageCodes[c]) { |
|
|
|
|
|
|
|
$toastMessage.set({ type: 'success', message: messageCodes[c] }); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
useEffect(() => { |
|
|
|
useEffect(() => { |
|
|
|
if (toastMessage === undefined) { |
|
|
|
if (toastMessage === undefined) { |
|
|
|
return; |
|
|
|
return; |
|
|
|