-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'upstream/release/v4.0.0-beta.1' into de…
…velop
- Loading branch information
Showing
80 changed files
with
1,534 additions
and
387 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
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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 |
---|---|---|
@@ -1 +1,3 @@ | ||
export const LIKE_REACTION_KEY = 'like'; | ||
export const LOVE_REACTION_KEY = 'love'; | ||
export const FIRE_REACTION_KEY = 'fire'; |
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 |
---|---|---|
@@ -1,14 +1,16 @@ | ||
import { FileRepository } from '@amityco/ts-sdk'; | ||
import useFetcher from './useFetcher'; | ||
import { useQuery } from '@tanstack/react-query'; | ||
|
||
const useFile = <T extends Amity.File>(fileId?: string | null) => { | ||
const file = useFetcher({ | ||
fetchFn: FileRepository.getFile, | ||
params: [fileId] as [string], | ||
shouldCall: () => !!fileId, | ||
const { data: file } = useQuery({ | ||
queryKey: ['asc-uikit', 'FileRepository', 'getFile', fileId], | ||
queryFn: () => { | ||
return FileRepository.getFile(fileId as string); | ||
}, | ||
enabled: !!fileId, | ||
}); | ||
|
||
return file?.data as T; | ||
return file?.data as T | undefined; | ||
}; | ||
|
||
export default useFile; |
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
Oops, something went wrong.