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