forked from huanghanzhilian/c-shopping
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8527f92
commit 3781bf0
Showing
11 changed files
with
198 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import { useRouter } from "next/navigation"; | ||
import { useDispatch } from "react-redux"; | ||
import { userLogout } from "store/slices/authSlice"; | ||
import { Icons } from "components"; | ||
import alert from "utils/alert"; | ||
|
||
export default function Logout() { | ||
const dispatch = useDispatch(); | ||
const router = useRouter(); | ||
|
||
const handleLogout = () => { | ||
router.push("/"); | ||
dispatch(userLogout()); | ||
alert("success", "退出成功"); | ||
}; | ||
return ( | ||
<div className='transition-colors hover:bg-gray-200 px-3'> | ||
|
||
<div role='button' | ||
className='flex justify-between cursor-pointer py-4 gap-x-2 mx-4 border-t border-gray-300' | ||
onClick={() => handleLogout()} | ||
> | ||
<Icons.Logout className='icon text-black' /> | ||
<span className='ml-auto mr-3'>其他组织者</span> | ||
</div> | ||
</div> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import Link from "next/link"; | ||
import { Icons } from "components"; | ||
|
||
const ArrowLink = ({ children, path }) => { | ||
return ( | ||
<Link href={path}> | ||
<span className='inline-flex items-center text-blue-400 text-sm max-w-max '> | ||
<span className='uppercase'>{children}</span> | ||
<Icons.ArrowLeft className='icon text-blue-400' /> | ||
</span> | ||
</Link> | ||
); | ||
}; | ||
|
||
export default ArrowLink; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import Link from "next/link"; | ||
import { useRouter } from "next/navigation"; | ||
import { Icons } from "components"; | ||
|
||
export default function BoxLink({ children, path, name }) { | ||
const router = useRouter(); | ||
|
||
return ( | ||
<div | ||
className={`transition-colors hover:bg-gray-200 px-3 ${ | ||
router.asPath === path && "border-r-4 border-red-600" | ||
}`} | ||
> | ||
<Link href={path}> | ||
<span className='flex justify-between mx-4 py-4 gap-x-2 border-t border-gray-300'> | ||
{children} | ||
<span className='ml-auto mr-3'>{name}</span> | ||
<Icons.ArrowLeft className='icon' /> | ||
</span> | ||
</Link> | ||
</div> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.