mirror of
https://github.com/AmruthPillai/Reactive-Resume.git
synced 2025-11-25 06:01:29 +10:00
feat(homepage): add new sections to homepage
This commit is contained in:
@ -12,7 +12,7 @@ export * from "./email-verification/verify-email";
|
||||
export * from "./password-recovery/forgot-password";
|
||||
export * from "./password-recovery/reset-password";
|
||||
|
||||
// Two Factor Authentication
|
||||
// Two-Factor Authentication
|
||||
export * from "./two-factor-authentication/backup-otp";
|
||||
export * from "./two-factor-authentication/disable";
|
||||
export * from "./two-factor-authentication/enable";
|
||||
|
||||
41
apps/client/src/services/resume/contributors.ts
Normal file
41
apps/client/src/services/resume/contributors.ts
Normal file
@ -0,0 +1,41 @@
|
||||
import { ContributorDto } from "@reactive-resume/dto";
|
||||
import { useQuery } from "@tanstack/react-query";
|
||||
|
||||
import { axios } from "@/client/libs/axios";
|
||||
|
||||
export const fetchGitHubContributors = async () => {
|
||||
const response = await axios.get<ContributorDto[]>(`/contributors/github`);
|
||||
|
||||
return response.data;
|
||||
};
|
||||
|
||||
export const fetchCrowdinContributors = async () => {
|
||||
const response = await axios.get<ContributorDto[]>(`/contributors/crowdin`);
|
||||
|
||||
return response.data;
|
||||
};
|
||||
|
||||
export const useContributors = () => {
|
||||
const {
|
||||
error: githubError,
|
||||
isPending: githubLoading,
|
||||
data: github,
|
||||
} = useQuery({
|
||||
queryKey: ["contributors", "github"],
|
||||
queryFn: fetchGitHubContributors,
|
||||
});
|
||||
|
||||
const {
|
||||
error: crowdinError,
|
||||
isPending: crowdinLoading,
|
||||
data: crowdin,
|
||||
} = useQuery({
|
||||
queryKey: ["contributors", "crowdin"],
|
||||
queryFn: fetchCrowdinContributors,
|
||||
});
|
||||
|
||||
const error = githubError || crowdinError;
|
||||
const loading = githubLoading || crowdinLoading;
|
||||
|
||||
return { github, crowdin, loading, error };
|
||||
};
|
||||
23
apps/client/src/services/resume/translation.ts
Normal file
23
apps/client/src/services/resume/translation.ts
Normal file
@ -0,0 +1,23 @@
|
||||
import { LanguageDto } from "@reactive-resume/dto";
|
||||
import { useQuery } from "@tanstack/react-query";
|
||||
|
||||
import { axios } from "@/client/libs/axios";
|
||||
|
||||
export const fetchLanguages = async () => {
|
||||
const response = await axios.get<LanguageDto[]>(`/translation/languages`);
|
||||
|
||||
return response.data;
|
||||
};
|
||||
|
||||
export const useLanguages = () => {
|
||||
const {
|
||||
error,
|
||||
isPending: loading,
|
||||
data: languages,
|
||||
} = useQuery({
|
||||
queryKey: ["translation", "languages"],
|
||||
queryFn: fetchLanguages,
|
||||
});
|
||||
|
||||
return { languages: languages ?? [], loading, error };
|
||||
};
|
||||
Reference in New Issue
Block a user