Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add bit.dev support #36

Merged
merged 2 commits into from
Feb 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@openclimatefix:registry=https://node.bit.cloud
11 changes: 11 additions & 0 deletions components/Layout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { FC, PropsWithChildren } from 'react';

const Layout: FC<PropsWithChildren> = ({ children }) => {
return (
<main className="bg-white dark:bg-black flex flex-col items-center justify-start px-10 min-h-screen">
{children}
</main>
);
};

export default Layout;
9 changes: 4 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,10 @@
"style": "yarn format && yarn lint"
},
"dependencies": {
"@auth0/nextjs-auth0": "^2.2.1",
"@next/font": "13.1.6",
"next": "^13.1.6",
"react": "18.2.0",
"react-dom": "18.2.0"
"@auth0/nextjs-auth0": "^1.8.0",
"next": "^12.0.0",
"react": "^17.0.0",
"react-dom": "^17.0.0"
},
"devDependencies": {
"@types/node": "^18.13.0",
Expand Down
13 changes: 4 additions & 9 deletions pages/_app.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
import '~/styles/globals.css';
import type { AppProps } from 'next/app';
import { UserProvider } from '@auth0/nextjs-auth0/client';
import { UserProvider } from '@auth0/nextjs-auth0';
import Head from 'next/head';

import { Inter } from '@next/font/google';

const inter = Inter({ subsets: ['latin'] });
import Layout from '~/components/Layout';

export default function App({ Component, pageProps }: AppProps) {
return (
Expand All @@ -16,11 +13,9 @@ export default function App({ Component, pageProps }: AppProps) {
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="icon" href="/favicon.ico" />
</Head>
<main
className={`${inter.className} bg-white dark:bg-black flex flex-col items-center justify-start px-10 min-h-screen"`}
>
<Layout>
<Component {...pageProps} />
</main>
</Layout>
</UserProvider>
);
}
13 changes: 12 additions & 1 deletion pages/_document.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,18 @@ import { Html, Head, Main, NextScript } from 'next/document';
export default function Document() {
return (
<Html lang="en">
<Head />
<Head>
{/*// @ts-ignore*/}
<link
rel="preconnect"
href="https://fonts.gstatic.com"
crossOrigin="anonymous"
/>
<link
href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600;700&family=Source+Code+Pro:wght@400;700&display=swap"
rel="stylesheet"
/>
</Head>
<body>
<Main />
<NextScript />
Expand Down
6 changes: 5 additions & 1 deletion pages/api/get_token.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
import { getAccessToken, withApiAuthRequired } from '@auth0/nextjs-auth0';
import { NextApiRequest, NextApiResponse } from 'next';

export default withApiAuthRequired(async function token(req, res) {
export default withApiAuthRequired(async function token(
req: NextApiRequest,
res: NextApiResponse
) {
try {
const accessToken = await getAccessToken(req, res);
res.status(200).json(accessToken);
Expand Down
Loading