Skip to content

Commit 35051ac

Browse files
committed
New website basic structure
1 parent eec85cc commit 35051ac

33 files changed

+4850
-0
lines changed

website/.eslintrc.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"extends": "next/core-web-vitals"
3+
}

website/.gitignore

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2+
3+
# dependencies
4+
/node_modules
5+
/.pnp
6+
.pnp.js
7+
8+
# testing
9+
/coverage
10+
11+
# next.js
12+
/.next/
13+
/out/
14+
15+
# production
16+
/build
17+
18+
# misc
19+
.DS_Store
20+
*.pem
21+
22+
# debug
23+
npm-debug.log*
24+
yarn-debug.log*
25+
yarn-error.log*
26+
27+
# local env files
28+
.env.local
29+
.env.development.local
30+
.env.test.local
31+
.env.production.local
32+
33+
# vercel
34+
.vercel
35+
36+
# typescript
37+
*.tsbuildinfo

website/README.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
This is a [Next.js](https://nextjs.org/) project bootstrapped with [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app).
2+
3+
## Getting Started
4+
5+
First, run the development server:
6+
7+
```bash
8+
npm run dev
9+
# or
10+
yarn dev
11+
```
12+
13+
Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.
14+
15+
You can start editing the page by modifying `pages/index.tsx`. The page auto-updates as you edit the file.
16+
17+
[API routes](https://nextjs.org/docs/api-routes/introduction) can be accessed on [http://localhost:3000/api/hello](http://localhost:3000/api/hello). This endpoint can be edited in `pages/api/hello.ts`.
18+
19+
The `pages/api` directory is mapped to `/api/*`. Files in this directory are treated as [API routes](https://nextjs.org/docs/api-routes/introduction) instead of React pages.
20+
21+
## Learn More
22+
23+
To learn more about Next.js, take a look at the following resources:
24+
25+
- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API.
26+
- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial.
27+
28+
You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js/) - your feedback and contributions are welcome!
29+
30+
## Deploy on Vercel
31+
32+
The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js.
33+
34+
Check out our [Next.js deployment documentation](https://nextjs.org/docs/deployment) for more details.

website/global-styles.css

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
:root {
2+
--content-margin-left: 200px;
3+
--content-margin-top: 80px;
4+
--content-width: 800px;
5+
}
6+
7+
body {
8+
margin: 0;
9+
font-family: Open Sans, sans-serif;
10+
-webkit-font-smoothing: antialiased;
11+
-moz-osx-font-smoothing: grayscale;
12+
}
13+
14+
code {
15+
font-family: source-code-pro, Menlo, Monaco, Consolas, "Courier New",
16+
monospace;
17+
}

website/globals.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
declare module "*.md";

website/next-env.d.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
/// <reference types="next" />
2+
/// <reference types="next/image-types/global" />
3+
4+
// NOTE: This file should not be edited
5+
// see https://nextjs.org/docs/basic-features/typescript for more information.

website/next.config.js

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
/** @type {import('next').NextConfig} */
2+
module.exports = {
3+
webpack: (config) => {
4+
config.module.rules.push({
5+
test: /\.md$/,
6+
use: "raw-loader",
7+
});
8+
9+
return config;
10+
},
11+
reactStrictMode: true,
12+
async redirects() {
13+
return [
14+
{
15+
source: "/",
16+
destination: "/overview/introduction",
17+
permanent: true,
18+
},
19+
];
20+
},
21+
};

website/package.json

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{
2+
"name": "docs-site",
3+
"private": true,
4+
"scripts": {
5+
"dev": "NODE_OPTIONS='--inspect' next dev",
6+
"build": "next build",
7+
"start": "next start",
8+
"lint": "next lint"
9+
},
10+
"dependencies": {
11+
"@dxc-technology/halstack-react": "0.0.0-13254da",
12+
"@types/styled-components": "^5.1.18",
13+
"next": "12.0.9",
14+
"raw-loader": "^4.0.2",
15+
"react": "17.0.2",
16+
"react-dom": "17.0.2",
17+
"react-markdown": "^8.0.0",
18+
"styled-components": "^5.3.3"
19+
},
20+
"devDependencies": {
21+
"@types/node": "17.0.2",
22+
"@types/react": "17.0.37",
23+
"eslint": "8.5.0",
24+
"eslint-config-next": "12.0.9",
25+
"typescript": "4.5.4"
26+
}
27+
}

website/pages/_app.tsx

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
import type { ReactElement, ReactNode } from "react";
2+
import type { NextPage } from "next";
3+
import type { AppProps } from "next/app";
4+
import Head from "next/head";
5+
import {
6+
DxcApplicationLayout,
7+
ThemeProvider,
8+
} from "@dxc-technology/halstack-react";
9+
import SidenavContent from "../screens/common/sidenav/Sidenav";
10+
import "../global-styles.css";
11+
12+
type NextPageWithLayout = NextPage & {
13+
getLayout?: (page: ReactElement) => ReactNode;
14+
};
15+
16+
type AppPropsWithLayout = AppProps & {
17+
Component: NextPageWithLayout;
18+
};
19+
20+
function MyApp({ Component, pageProps }: AppPropsWithLayout) {
21+
const getLayout = Component.getLayout || ((page) => page);
22+
23+
const componentWithLayout = getLayout(<Component {...pageProps} />);
24+
return (
25+
<>
26+
<Head>
27+
<link rel="icon" type="image/png" sizes="32x32" href="/favicon.png" />
28+
</Head>
29+
<ThemeProvider>
30+
<DxcApplicationLayout>
31+
<DxcApplicationLayout.SideNav mode="push">
32+
<SidenavContent></SidenavContent>
33+
</DxcApplicationLayout.SideNav>
34+
<DxcApplicationLayout.Main>
35+
{componentWithLayout}
36+
</DxcApplicationLayout.Main>
37+
</DxcApplicationLayout>
38+
</ThemeProvider>
39+
</>
40+
);
41+
}
42+
43+
export default MyApp;

website/pages/_document.tsx

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
import Document, { DocumentContext } from 'next/document'
2+
import { ServerStyleSheet } from 'styled-components'
3+
4+
export default class MyDocument extends Document {
5+
static async getInitialProps(ctx: DocumentContext) {
6+
const sheet = new ServerStyleSheet()
7+
const originalRenderPage = ctx.renderPage
8+
9+
try {
10+
ctx.renderPage = () =>
11+
originalRenderPage({
12+
enhanceApp: (App) => (props) =>
13+
sheet.collectStyles(<App {...props} />),
14+
})
15+
16+
const initialProps = await Document.getInitialProps(ctx)
17+
return {
18+
...initialProps,
19+
styles: (
20+
<>
21+
{initialProps.styles}
22+
{sheet.getStyleElement()}
23+
</>
24+
),
25+
}
26+
} finally {
27+
sheet.seal()
28+
}
29+
}
30+
}

0 commit comments

Comments
 (0)