-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #75 from masterHAWK99/refactor/update-next-and-router
Update dependencies and use app router
- Loading branch information
Showing
27 changed files
with
3,544 additions
and
4,081 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { ReactNode } from "react"; | ||
import { Metadata } from "next"; | ||
|
||
export const metadata: Metadata = { | ||
title: "Azure Fundamentals - Exam", | ||
openGraph: { | ||
title: "Azure Fundamentals - Exam", | ||
}, | ||
}; | ||
|
||
export default function ExamLayout({ children }: { children: ReactNode }) { | ||
return <>{children}</>; | ||
} |
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
File renamed without changes.
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,53 @@ | ||
import TopNav from "@azure-fundamentals/components/TopNav"; | ||
import Footer from "../components/Footer"; | ||
import { ReactNode } from "react"; | ||
import { Metadata } from "next"; | ||
import "styles/globals.css"; | ||
import Script from "next/script"; | ||
import ApolloProvider from "@azure-fundamentals/components/ApolloProvider"; | ||
|
||
export const metadata: Metadata = { | ||
metadataBase: new URL("http://localhost:3000"), | ||
title: "Azure Fundamentals", | ||
openGraph: { | ||
title: "Azure Fundamentals", | ||
}, | ||
}; | ||
|
||
type RootLayoutProps = { | ||
children: ReactNode; | ||
}; | ||
|
||
export default function RootLayout({ children }: RootLayoutProps) { | ||
const GA_TRACKING_ID = process.env.NEXT_PUBLIC_GA_TRACKING_ID; | ||
|
||
return ( | ||
<html lang="en"> | ||
<body className="bg-slate-900"> | ||
<ApolloProvider> | ||
<TopNav /> | ||
<main className="flex flex-col justify-between h-[calc(100vh-2.5rem-64px)]"> | ||
{children} | ||
<Footer /> | ||
</main> | ||
<Script | ||
src={ | ||
"https://www.googletagmanager.com/gtag/js?id=" + GA_TRACKING_ID | ||
} | ||
/> | ||
<Script id="google-analytics"> | ||
{` | ||
window.dataLayer = window.dataLayer || []; | ||
function gtag(){dataLayer.push(arguments);} | ||
gtag('js', new Date()); | ||
gtag('config', '${GA_TRACKING_ID}', { | ||
page_path: window.location.pathname, | ||
}); | ||
`} | ||
</Script> | ||
</ApolloProvider> | ||
</body> | ||
</html> | ||
); | ||
} |
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,13 @@ | ||
import { ReactNode } from "react"; | ||
import { Metadata } from "next"; | ||
|
||
export const metadata: Metadata = { | ||
title: "Azure Fundamentals - Practice", | ||
openGraph: { | ||
title: "Azure Fundamentals - Practice", | ||
}, | ||
}; | ||
|
||
export default function ExamLayout({ children }: { children: ReactNode }) { | ||
return <>{children}</>; | ||
} |
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
File renamed without changes.
File renamed without changes.
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,15 @@ | ||
"use client"; | ||
|
||
import client from "@azure-fundamentals/lib/graphql/apollo-client"; | ||
import { ReactNode } from "react"; | ||
import { ApolloProvider as NextApolloProvider } from "@apollo/client"; | ||
|
||
type RootLayoutProps = { | ||
children: ReactNode; | ||
}; | ||
|
||
const ApolloProvider = ({ children }: RootLayoutProps) => { | ||
return <NextApolloProvider client={client}>{children}</NextApolloProvider>; | ||
}; | ||
|
||
export default ApolloProvider; |
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 was deleted.
Oops, something went wrong.
File renamed without changes.
File renamed without changes.
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
File renamed without changes.
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,27 @@ | ||
const resolvers = { | ||
Query: { | ||
questions: async ( | ||
_: unknown, | ||
__: unknown, | ||
{ dataSources }: { dataSources: any }, | ||
) => { | ||
return await dataSources.questionsDB.getQuestions(); | ||
}, | ||
questionById: async ( | ||
_: unknown, | ||
{ id }: { id: string }, | ||
{ dataSources }: { dataSources: any }, | ||
) => { | ||
return await dataSources.questionsDB.getQuestion(id); | ||
}, | ||
randomQuestions: async ( | ||
_: unknown, | ||
{ range }: { range: number }, | ||
{ dataSources }: { dataSources: any }, | ||
) => { | ||
return await dataSources.questionsDB.getRandomQuestions(range); | ||
}, | ||
}, | ||
}; | ||
|
||
export default resolvers; |
File renamed without changes.
File renamed without changes
Oops, something went wrong.