-
Notifications
You must be signed in to change notification settings - Fork 76
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feat: added loading and better downloading for attachments
- Loading branch information
1 parent
a68746d
commit 6a287ae
Showing
20 changed files
with
455 additions
and
97 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
'use client'; | ||
|
||
import { ThemeProvider as NextThemesProvider } from 'next-themes'; | ||
import { type ThemeProviderProps } from 'next-themes/dist/types'; | ||
|
||
export function ThemeProvider({ children, ...props }: ThemeProviderProps) { | ||
return <NextThemesProvider {...props}>{children}</NextThemesProvider>; | ||
} |
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 |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import { type UseQueryResult, useQuery } from 'react-query'; | ||
|
||
import type { User } from 'common/types'; | ||
|
||
import { type XHRErrorResponse, ajaxGet } from 'services/utils'; | ||
|
||
/** | ||
* Query Key for Get user. | ||
*/ | ||
export const GetSignedURL = 'getSignedURLQuery'; | ||
|
||
export function getSignedURL(attachmentId: string) { | ||
return ajaxGet({ | ||
url: `/api/v1/attachment/get-signed-url/${attachmentId}`, | ||
}); | ||
} | ||
|
||
export function useGetSignedURLQuery( | ||
attachmentId: string, | ||
): UseQueryResult<User, XHRErrorResponse> { | ||
return useQuery([GetSignedURL], () => getSignedURL(attachmentId), { | ||
retry: 1, | ||
staleTime: Infinity, | ||
refetchOnWindowFocus: false, // Frequency of Change would be Low | ||
}); | ||
} |
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from './get-signed-url'; |
Oops, something went wrong.