mirror of
https://github.com/rzmk/learnhouse.git
synced 2025-12-19 04:19:25 +00:00
feat: format with prettier
This commit is contained in:
parent
03fb09c3d6
commit
a147ad6610
164 changed files with 11257 additions and 8154 deletions
|
|
@ -1,25 +1,25 @@
|
|||
'use client';
|
||||
import { getAPIUrl } from '@services/config/config';
|
||||
import { swrFetcher } from '@services/utils/ts/requests';
|
||||
'use client'
|
||||
import { getAPIUrl } from '@services/config/config'
|
||||
import { swrFetcher } from '@services/utils/ts/requests'
|
||||
import React, { useContext, useEffect } from 'react'
|
||||
import useSWR from 'swr';
|
||||
import { createContext } from 'react';
|
||||
import useSWR from 'swr'
|
||||
import { createContext } from 'react'
|
||||
|
||||
export const OrgContext = createContext({}) as any;
|
||||
export const OrgContext = createContext({}) as any
|
||||
|
||||
export function OrgProvider({ children, orgslug }: { children: React.ReactNode, orgslug: string }) {
|
||||
const { data: org } = useSWR(`${getAPIUrl()}orgs/slug/${orgslug}`, swrFetcher);
|
||||
useEffect(() => {
|
||||
export function OrgProvider({
|
||||
children,
|
||||
orgslug,
|
||||
}: {
|
||||
children: React.ReactNode
|
||||
orgslug: string
|
||||
}) {
|
||||
const { data: org } = useSWR(`${getAPIUrl()}orgs/slug/${orgslug}`, swrFetcher)
|
||||
useEffect(() => {}, [org])
|
||||
|
||||
}, [org]);
|
||||
|
||||
return (
|
||||
<OrgContext.Provider value={org}>
|
||||
{children}
|
||||
</OrgContext.Provider>
|
||||
)
|
||||
return <OrgContext.Provider value={org}>{children}</OrgContext.Provider>
|
||||
}
|
||||
|
||||
export function useOrg() {
|
||||
return useContext(OrgContext);
|
||||
return useContext(OrgContext)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue