Update toast messages
All checks were successful
Lint / lint (20.x) (pull_request) Successful in 5m3s

This commit is contained in:
Neeraj 2024-10-22 15:31:09 +05:30
parent bbcbd4b5d3
commit 7504b3848d
4 changed files with 28 additions and 19 deletions

View File

@ -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 (
<div className="flex items-center gap-3 px-0 lg:px-2">
<img
src="/logo.svg"
alt="Snowball Logo"
className="lg:h-10 lg:w-10 h-8 w-8 rounded-lg"
/>
<Heading className="lg:text-[24px] text-[19px] font-semibold">
Snowball
</Heading>
</div>
<Link to={`/${orgSlug}`}>
<div className="flex items-center gap-3 px-0 lg:px-2">
<img
src="/logo.svg"
alt="Snowball Logo"
className="lg:h-10 lg:w-10 h-8 w-8 rounded-lg"
/>
<Heading className="lg:text-[24px] text-[19px] font-semibold">
Snowball
</Heading>
</div>
</Link>
);
};

View File

@ -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,
});

View File

@ -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 */}
<div className="hidden lg:flex">
<Logo />
<Logo orgSlug={orgSlug} />
</div>
{/* This element ensures the space between logo and navigation */}
<div className="flex-1"></div>

View File

@ -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 */}
<div className="flex lg:hidden items-center px-4 py-2.5 justify-between">
<Logo />
<Logo orgSlug={orgSlug} />
<div className="flex items-center gap-0.5">
<AnimatePresence>
{isSidebarOpen ? (