Skip to content

Commit

Permalink
fix: add toast container back
Browse files Browse the repository at this point in the history
Signed-off-by: Innei <i@innei.in>
  • Loading branch information
Innei committed Jul 1, 2023
1 parent 875f326 commit 0e51407
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/components/in-page/Friend/FriendSection/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import styles from './index.module.css'
export type FriendSectionProps = {
data: LinkModel[]
}

export const FavoriteSection: FC<FriendSectionProps> = ({ data }) => {
return (
<ul>
Expand Down
9 changes: 7 additions & 2 deletions src/components/widgets/Toast/card.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import clsx from 'clsx'
import type { FC } from 'react'
import { memo, useRef } from 'react'
import { toast } from 'react-toastify'
Expand Down Expand Up @@ -30,7 +31,7 @@ export const ToastCard: FC<{
>
<div
onClick={(e) => props.onClick?.(e.nativeEvent)}
className="bg-bg-opacity border-shallow relative mb-4 ml-auto mr-4 box-border flex w-full
className="bg-bg-opacity border-shallow group relative mb-4 ml-auto mr-4 box-border flex w-full
cursor-pointer select-none items-center space-x-4
overflow-hidden rounded-xl border border-opacity-50 p-4 text-[12px]
text-inherit backdrop-blur-md backdrop-brightness-110 backdrop-brightness-150 backdrop-saturate-150 backdrop-filter"
Expand All @@ -41,7 +42,11 @@ export const ToastCard: FC<{
<div
role="button"
tabIndex={0}
className="bg-gray-6 dark:bg-dark-100 text-dark-50 absolute left-2 top-2 z-10 flex h-6 w-6 items-center justify-center overflow-hidden rounded-full bg-opacity-80 dark:text-white"
className={clsx(
'bg-gray-6 dark:bg-dark-100 text-dark-50 absolute left-2 top-2 z-10 flex h-6 w-6 items-center justify-center',
'overflow-hidden rounded-full bg-opacity-80 dark:text-white',
'opacity-0 transition-opacity group-hover:opacity-100',
)}
onClick={(e) => {
e.stopPropagation()
props.getToastId && toast.dismiss(props.getToastId())
Expand Down
2 changes: 2 additions & 0 deletions src/pages/_app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import { useUserStore } from '~/atoms/user'
import { useCheckLogged } from '~/hooks/app/use-check-logged'
import { useCheckOldBrowser } from '~/hooks/app/use-check-old-browser'
import { useInitialData } from '~/hooks/app/use-initial-data'
import { ToastContainer } from '~/provider/toastify'
import { printToConsole } from '~/utils/console'

interface DataModel {
Expand Down Expand Up @@ -81,6 +82,7 @@ const App: FC<DataModel & { Component: any; pageProps: any; err: any }> = (
return initData.aggregateData ? (
<ProviderComposer contexts={PageProviders}>
<Component {...pageProps} />
<ToastContainer key="ToastContainer" />
</ProviderComposer>
) : (
<NoDataErrorView />
Expand Down

1 comment on commit 0e51407

@vercel
Copy link

@vercel vercel bot commented on 0e51407 Jul 1, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

kami – ./

kami-psi.vercel.app
kami-git-master-innei-dev.vercel.app
dev.innei.ren
kami-innei-dev.vercel.app

Please sign in to comment.