Skip to content

Commit

Permalink
move react hooks to src/hooks
Browse files Browse the repository at this point in the history
  • Loading branch information
dEdmishka committed Jan 24, 2024
1 parent 13aa8da commit 6f5d1c9
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/app/page.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
'use client'

import { Button } from '@/components/ui/button'
import { useToast } from '@/hooks/use-toast'
import { useApi, useApiContext } from '@/utils'
import { useToast } from '@/utils/api/hooks/use-toast'

const Home = () => {
const api = useApiContext()
Expand Down
2 changes: 1 addition & 1 deletion src/components/ui/toaster.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
ToastTitle,
ToastViewport,
} from '@/components/ui/toast'
import { useToast } from '@/utils/api/hooks/use-toast'
import { useToast } from '@/hooks/use-toast'

export function Toaster() {
const { toasts } = useToast()
Expand Down
2 changes: 1 addition & 1 deletion src/utils/api/hooks/hooks.ts → src/hooks/hooks.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use client'

import { useToast } from '@/utils/api/hooks/use-toast'
import { useToast } from '@/hooks/use-toast'
import { useCallback, useEffect, useRef, useState } from 'react'

export const useApi = <T extends Promise<any>>(
Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions src/utils/api/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export * from './hooks/hooks'
export * from './metacom'
export * from '@/hooks/hooks'
export * from '@/utils/api/metacom'
2 changes: 1 addition & 1 deletion src/utils/api/metacom.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use client'

import { URL_PRODUCT_API } from '@/constants'
import { useToast } from '@/utils/api/hooks/use-toast'
import { useToast } from '@/hooks/use-toast'
import { Metacom } from 'metacom'
import {
createContext,
Expand Down
4 changes: 2 additions & 2 deletions src/utils/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export * from './misc'
export * from './api'
export * from '@/utils/misc'
export * from '@/utils/api'

0 comments on commit 6f5d1c9

Please sign in to comment.