From 7504b3848d448aaab257443aa0032c3aaa7f704c Mon Sep 17 00:00:00 2001 From: Neeraj Date: Tue, 22 Oct 2024 15:31:09 +0530 Subject: [PATCH] Update toast messages --- packages/frontend/src/components/Logo.tsx | 29 ++++++++++++------- .../project/deployments/DeploymentMenu.tsx | 8 ++--- .../src/components/shared/Sidebar/Sidebar.tsx | 5 ++-- .../frontend/src/pages/org-slug/layout.tsx | 5 ++-- 4 files changed, 28 insertions(+), 19 deletions(-) diff --git a/packages/frontend/src/components/Logo.tsx b/packages/frontend/src/components/Logo.tsx index 81cf3555..6b6d8131 100644 --- a/packages/frontend/src/components/Logo.tsx +++ b/packages/frontend/src/components/Logo.tsx @@ -1,16 +1,23 @@ +import { Link } from 'react-router-dom'; import { Heading } from './shared/Heading'; -export const Logo = () => { +interface LogoProps { + orgSlug?: string; +} + +export const Logo = ({ orgSlug }: LogoProps) => { return ( -
- Snowball Logo - - Snowball - -
+ +
+ Snowball Logo + + Snowball + +
+ ); }; diff --git a/packages/frontend/src/components/projects/project/deployments/DeploymentMenu.tsx b/packages/frontend/src/components/projects/project/deployments/DeploymentMenu.tsx index 8ef1dd61..fec28246 100644 --- a/packages/frontend/src/components/projects/project/deployments/DeploymentMenu.tsx +++ b/packages/frontend/src/components/projects/project/deployments/DeploymentMenu.tsx @@ -117,8 +117,8 @@ export const DeploymentMenu = ({ const deleteDeployment = async () => { toast({ - id: 'deployment_going_to_be_deleted', - title: 'Deployment going to be deleted', + id: 'deleting_deployment', + title: 'Deleting deployment....', variant: 'success', onDismiss: dismiss, }); @@ -127,8 +127,8 @@ export const DeploymentMenu = ({ if (isDeleted) { await onUpdate(); toast({ - id: 'deployment_deleted', - title: 'Deployment deleted', + id: 'deployment_removal_requested', + title: 'Deployment removal requested', variant: 'success', onDismiss: dismiss, }); diff --git a/packages/frontend/src/components/shared/Sidebar/Sidebar.tsx b/packages/frontend/src/components/shared/Sidebar/Sidebar.tsx index daad9918..15e88d16 100644 --- a/packages/frontend/src/components/shared/Sidebar/Sidebar.tsx +++ b/packages/frontend/src/components/shared/Sidebar/Sidebar.tsx @@ -1,5 +1,5 @@ import { useCallback, useEffect, useState } from 'react'; -import { useNavigate } from 'react-router-dom'; +import { useNavigate, useParams } from 'react-router-dom'; import { User } from 'gql-client'; import { motion } from 'framer-motion'; import { useDisconnect } from 'wagmi'; @@ -26,6 +26,7 @@ interface SidebarProps { } export const Sidebar = ({ mobileOpen }: SidebarProps) => { + const { orgSlug } = useParams(); const navigate = useNavigate(); const client = useGQLClient(); const isDesktop = useMediaQuery('(min-width: 960px)'); @@ -72,7 +73,7 @@ export const Sidebar = ({ mobileOpen }: SidebarProps) => { > {/* Logo */}
- +
{/* This element ensures the space between logo and navigation */}
diff --git a/packages/frontend/src/pages/org-slug/layout.tsx b/packages/frontend/src/pages/org-slug/layout.tsx index 4cf7955a..b1bf2226 100644 --- a/packages/frontend/src/pages/org-slug/layout.tsx +++ b/packages/frontend/src/pages/org-slug/layout.tsx @@ -9,7 +9,7 @@ import { import { Sidebar } from 'components/shared/Sidebar'; import { OctokitProvider } from 'context/OctokitContext'; import { ComponentPropsWithoutRef, useEffect, useState } from 'react'; -import { Outlet } from 'react-router-dom'; +import { Outlet, useParams } from 'react-router-dom'; import { AnimatePresence, motion } from 'framer-motion'; import { cn } from 'utils/classnames'; import { useMediaQuery } from 'usehooks-ts'; @@ -22,6 +22,7 @@ export const DashboardLayout = ({ className, ...props }: DashboardLayoutProps) => { + const { orgSlug } = useParams(); const isDesktop = useMediaQuery('(min-width: 960px)'); const [isSidebarOpen, setIsSidebarOpen] = useState(false); @@ -44,7 +45,7 @@ export const DashboardLayout = ({ > {/* Header on mobile */}
- +
{isSidebarOpen ? (