|
| 1 | +// -i- Mocked to avoid using @clerk/nextjs in Storybook |
| 2 | +import React from 'react' |
| 3 | +import { useMemo } from 'react' |
| 4 | +import { action } from '@storybook/addon-actions' |
| 5 | + |
| 6 | +/* --- useAuth() ------------------------------------------------------------------------------- */ |
| 7 | + |
| 8 | +export const useAuth = () => ({ |
| 9 | + isSignedIn: false, |
| 10 | + session: null, |
| 11 | + user: null, |
| 12 | + signUp: { |
| 13 | + isLoaded: true, |
| 14 | + create: async () => {}, |
| 15 | + prepareEmailAddressVerification: async () => {}, |
| 16 | + }, |
| 17 | + signIn: { |
| 18 | + isLoaded: true, |
| 19 | + create: async () => {}, |
| 20 | + }, |
| 21 | + signOut: { |
| 22 | + isLoaded: true, |
| 23 | + create: async () => {}, |
| 24 | + }, |
| 25 | + setActive: async () => {}, |
| 26 | + getActive: async () => {}, |
| 27 | +}) |
| 28 | + |
| 29 | +/* --- useClerk() ------------------------------------------------------------------------------ */ |
| 30 | + |
| 31 | +export const useClerk = () => ({ |
| 32 | + isLoaded: true, |
| 33 | + isSignedIn: false, |
| 34 | + session: null, |
| 35 | + user: null, |
| 36 | + signUp: { |
| 37 | + isLoaded: true, |
| 38 | + create: async () => {}, |
| 39 | + prepareEmailAddressVerification: async () => {}, |
| 40 | + }, |
| 41 | + signIn: { |
| 42 | + isLoaded: true, |
| 43 | + create: async () => {}, |
| 44 | + }, |
| 45 | + signOut: { |
| 46 | + isLoaded: true, |
| 47 | + create: async () => {}, |
| 48 | + }, |
| 49 | + setActive: async () => {}, |
| 50 | + getActive: async () => {}, |
| 51 | +}) |
| 52 | + |
| 53 | +/* --- useOrganisation() ----------------------------------------------------------------------- */ |
| 54 | + |
| 55 | +export const useOrganisation = () => ({ |
| 56 | + isLoaded: true, |
| 57 | + organisation: null, |
| 58 | + setOrganisation: async () => {}, |
| 59 | + getOrganisation: async () => {}, |
| 60 | +}) |
| 61 | + |
| 62 | +/* --- useOrganisationList() ------------------------------------------------------------------- */ |
| 63 | + |
| 64 | +export const useOrganisationList = () => ({ |
| 65 | + isLoaded: true, |
| 66 | + organisationList: [], |
| 67 | + setOrganisationList: async () => {}, |
| 68 | + getOrganisationList: async () => {}, |
| 69 | +}) |
| 70 | + |
| 71 | +/* --- useSession() ----------------------------------------------------------------------------- */ |
| 72 | + |
| 73 | +export const useSession = () => ({ |
| 74 | + isLoaded: true, |
| 75 | + isSignedIn: false, |
| 76 | + session: null, |
| 77 | + user: null, |
| 78 | + signUp: { |
| 79 | + isLoaded: true, |
| 80 | + create: async () => {}, |
| 81 | + prepareEmailAddressVerification: async () => {}, |
| 82 | + }, |
| 83 | + signIn: { |
| 84 | + isLoaded: true, |
| 85 | + create: async () => {}, |
| 86 | + }, |
| 87 | + signOut: { |
| 88 | + isLoaded: true, |
| 89 | + create: async () => {}, |
| 90 | + }, |
| 91 | + setActive: async () => {}, |
| 92 | + getActive: async () => {}, |
| 93 | +}) |
| 94 | + |
| 95 | +/* --- useSignIn() ------------------------------------------------------------------------------ */ |
| 96 | + |
| 97 | +export const useSignIn = () => ({ |
| 98 | + isLoaded: true, |
| 99 | + signIn: { |
| 100 | + isLoaded: true, |
| 101 | + create: async () => {}, |
| 102 | + }, |
| 103 | +}) |
| 104 | + |
| 105 | +/* --- useSignUp() ------------------------------------------------------------------------------ */ |
| 106 | + |
| 107 | +export const useSignUp = () => ({ |
| 108 | + isLoaded: true, |
| 109 | + signUp: { |
| 110 | + isLoaded: true, |
| 111 | + create: async () => {}, |
| 112 | + prepareEmailAddressVerification: async () => {}, |
| 113 | + }, |
| 114 | +}) |
| 115 | + |
| 116 | +/* --- useUser() ------------------------------------------------------------------------------- */ |
| 117 | + |
| 118 | +export const useUser = () => ({ |
| 119 | + isLoaded: true, |
| 120 | + user: null, |
| 121 | + setUser: async () => {}, |
| 122 | + getUser: async () => {}, |
| 123 | +}) |
| 124 | + |
| 125 | +/* --- useWarmUpBrowser() ---------------------------------------------------------------------- */ |
| 126 | + |
| 127 | +export const useWarmUpBrowser = () => {} |
0 commit comments