mirror of
https://github.com/kamranahmedse/developer-roadmap.git
synced 2025-08-31 04:59:50 +02:00
Toast message on leaving team
This commit is contained in:
@@ -45,7 +45,7 @@ export function LeaveTeamPopup(props: LeaveTeamPopupProps) {
|
||||
return;
|
||||
}
|
||||
|
||||
window.location.href = '/account';
|
||||
window.location.href = '/account?c=tl';
|
||||
};
|
||||
|
||||
const handleClosePopup = () => {
|
||||
|
@@ -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;
|
||||
|
@@ -156,7 +156,7 @@ const gaPageIdentifier = Astro.url.pathname
|
||||
<slot name="login-popup">
|
||||
<LoginPopup />
|
||||
</slot>
|
||||
<Toaster client:idle />
|
||||
<Toaster client:only />
|
||||
<CommandMenu client:idle />
|
||||
<PageProgress initialMessage={initialLoadingMessage} client:idle />
|
||||
<PageSponsor
|
||||
|
Reference in New Issue
Block a user