mirror of
https://github.com/harivansh-afk/Saas-Teamspace.git
synced 2026-04-20 14:05:11 +00:00
initial commit
This commit is contained in:
commit
ef9ccf22d3
133 changed files with 20802 additions and 0 deletions
7
hooks/use-current-role.ts
Normal file
7
hooks/use-current-role.ts
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
import { useSession } from 'next-auth/react'
|
||||
|
||||
export const useCurrentRole = () => {
|
||||
const session = useSession()
|
||||
|
||||
return session.data?.user?.role
|
||||
}
|
||||
7
hooks/use-current-user.ts
Normal file
7
hooks/use-current-user.ts
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
// Hook to get user data in a more convenient way
|
||||
import { useSession } from 'next-auth/react'
|
||||
|
||||
export const useCurrentUser = () => {
|
||||
const session = useSession()
|
||||
return session.data?.user
|
||||
}
|
||||
14
hooks/use-pro-modal.ts
Normal file
14
hooks/use-pro-modal.ts
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
import { create } from 'zustand'
|
||||
// create interface for proModal Display
|
||||
interface userProModalStore {
|
||||
isOpen: boolean
|
||||
onOpen: () => void
|
||||
onClose: () => void
|
||||
}
|
||||
|
||||
// if the button is clicked, isOpen will become true and the modal will be displayed
|
||||
export const useProModal = create<userProModalStore>((set) => ({
|
||||
isOpen: false,
|
||||
onOpen: () => set({ isOpen: true }),
|
||||
onClose: () => set({ isOpen: false })
|
||||
}))
|
||||
Loading…
Add table
Add a link
Reference in a new issue