feat: react front init

This commit is contained in:
swve 2022-09-21 20:55:51 +02:00
parent 130123b055
commit fcd281d1d6
18 changed files with 6594 additions and 0 deletions

3
front/.eslintrc.json Normal file
View file

@ -0,0 +1,3 @@
{
"extends": "next/core-web-vitals"
}

36
front/.gitignore vendored Normal file
View file

@ -0,0 +1,36 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
# dependencies
/node_modules
/.pnp
.pnp.js
# testing
/coverage
# next.js
/.next/
/out/
# production
/build
# misc
.DS_Store
*.pem
# debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*
.pnpm-debug.log*
# local env files
.env*.local
# vercel
.vercel
# typescript
*.tsbuildinfo
next-env.d.ts

0
front/README.md Normal file
View file

10
front/next.config.js Normal file
View file

@ -0,0 +1,10 @@
/** @type {import('next').NextConfig} */
const nextConfig = {
reactStrictMode: true,
swcMinify: true,
compiler: {
styledComponents: true,
},
};
module.exports = nextConfig;

6278
front/package-lock.json generated Normal file

File diff suppressed because it is too large Load diff

27
front/package.json Normal file
View file

@ -0,0 +1,27 @@
{
"name": "learnhouse",
"version": "0.1.0",
"private": true,
"scripts": {
"dev": "next dev",
"build": "next build",
"start": "next start",
"lint": "next lint"
},
"dependencies": {
"next": "12.3.1",
"react": "18.2.0",
"react-dom": "18.2.0",
"styled-components": "^5.3.5"
},
"devDependencies": {
"@types/node": "18.7.18",
"@types/react": "18.0.20",
"@types/react-dom": "18.0.6",
"@types/styled-components": "^5.1.26",
"autoprefixer": "^10.4.12",
"eslint": "8.23.1",
"eslint-config-next": "12.3.1",
"typescript": "4.8.3"
}
}

8
front/pages/_app.tsx Normal file
View file

@ -0,0 +1,8 @@
import '../styles/globals.css'
import type { AppProps } from 'next/app'
function MyApp({ Component, pageProps }: AppProps) {
return <Component {...pageProps} />
}
export default MyApp

View file

@ -0,0 +1,12 @@
import React from "react";
import styled from "styled-components";
export const HeaderProfileBox = () => {
return <ProfileArea>HeaderProfileBox</ProfileArea>;
};
const ProfileArea = styled.div`
display: flex;
place-items: stretch;
place-items: center;
`;

View file

@ -0,0 +1,8 @@
import React from 'react'
import { Menu } from './menu'
export const Header = () => {
return (
<div><Menu></Menu></div>
)
}

View file

@ -0,0 +1,42 @@
import React from "react";
import Head from "next/head";
import { Header } from "./header";
import styled from "styled-components";
const Layout = (props: any) => {
return (
<div>
<Head>
<title>{props.title}</title>
<meta name="description" content={props.description} />
<link rel="icon" href="/favicon.ico" />
</Head>
<Header></Header>
<Main className="min-h-screen">{props.children}</Main>
<Footer>
<a href="" target="_blank" rel="noopener noreferrer">
Powered by <img src="/learnhouse_logo.png" alt="Learnhouse Logo" />
</a>
</Footer>
</div>
);
};
const Main = styled.main`
min-height: 100vh;
`;
const Footer = styled.footer`
display: flex;
justify-content: center;
margin: 20px;
font-size: 16px;
img{
width: 100px;
display: inline;
}
`;
export default Layout;

View file

@ -0,0 +1,97 @@
import React from "react";
import styled from "styled-components";
import { HeaderProfileBox } from "../auth/HeaderProfileBox";
export const Menu = () => {
return (
<GlobalHeader>
<LogoArea>
<Logo>
<img src="./learnhouse_logo.png" alt="" />
</Logo>
<div id="accounts"></div>
</LogoArea>
<SearchArea>
<Search>
<SearchInput placeholder="find something" type="text" />
</Search>
</SearchArea>
<MenuArea>
<ul>
<li>Courses </li>
<li>Collections</li>
<li>Activity</li>
<li>More</li>
</ul>
</MenuArea>
<HeaderProfileBox></HeaderProfileBox>
</GlobalHeader>
);
};
const GlobalHeader = styled.div`
display: flex;
height: 60px;
background: #ffffff;
box-shadow: 0px 4px 16px rgba(0, 0, 0, 0.03);
`;
const LogoArea = styled.div`
display: flex;
place-items: stretch;
`;
const Logo = styled.div`
display: flex;
place-items: center;
padding-left: 20px;
img {
width: 100px;
}
`;
const SearchArea = styled.div`
display: flex;
place-items: stretch;
flex-grow: 2;
`;
const Search = styled.div`
display: flex;
place-items: center;
padding-left: 20px;
width: auto;
`;
const SearchInput = styled.input`
box-shadow: inset 5px 6px 16px rgba(0, 0, 0, 0.01);
background: rgb(244 242 242 / 35%);
border-radius: 6px;
height: 50%;
border: none;
margin-top: 20px;
margin-bottom: 20px;
padding-left: 10px;
color: #52525220;
`;
const MenuArea = styled.div`
display: flex;
place-items: stretch;
flex-grow: 1;
ul {
display: flex;
place-items: center;
list-style: none;
padding-left: 20px;
li {
padding-right: 20px;
font-size: 16px;
font-weight: 500;
color: #525252;
}
}
`;

View file

@ -0,0 +1,7 @@
import styled from "styled-components";
export const Title = styled.h1`
font-size: 1.5em;
padding-left: 20px;
font-weight: 500;
`;

15
front/pages/index.tsx Normal file
View file

@ -0,0 +1,15 @@
import type { NextPage } from "next";
import { Title } from "./components/ui/styles/title";
import Layout from "./components/ui/layout";
const Home: NextPage = () => {
return (
<div>
<Layout>
<Title>Home</Title>
</Layout>
</div>
);
};
export default Home;

BIN
front/public/favicon.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

4
front/public/vercel.svg Normal file
View file

@ -0,0 +1,4 @@
<svg width="283" height="64" viewBox="0 0 283 64" fill="none"
xmlns="http://www.w3.org/2000/svg">
<path d="M141.04 16c-11.04 0-19 7.2-19 18s8.96 18 20 18c6.67 0 12.55-2.64 16.19-7.09l-7.65-4.42c-2.02 2.21-5.09 3.5-8.54 3.5-4.79 0-8.86-2.5-10.37-6.5h28.02c.22-1.12.35-2.28.35-3.5 0-10.79-7.96-17.99-19-17.99zm-9.46 14.5c1.25-3.99 4.67-6.5 9.45-6.5 4.79 0 8.21 2.51 9.45 6.5h-18.9zM248.72 16c-11.04 0-19 7.2-19 18s8.96 18 20 18c6.67 0 12.55-2.64 16.19-7.09l-7.65-4.42c-2.02 2.21-5.09 3.5-8.54 3.5-4.79 0-8.86-2.5-10.37-6.5h28.02c.22-1.12.35-2.28.35-3.5 0-10.79-7.96-17.99-19-17.99zm-9.45 14.5c1.25-3.99 4.67-6.5 9.45-6.5 4.79 0 8.21 2.51 9.45 6.5h-18.9zM200.24 34c0 6 3.92 10 10 10 4.12 0 7.21-1.87 8.8-4.92l7.68 4.43c-3.18 5.3-9.14 8.49-16.48 8.49-11.05 0-19-7.2-19-18s7.96-18 19-18c7.34 0 13.29 3.19 16.48 8.49l-7.68 4.43c-1.59-3.05-4.68-4.92-8.8-4.92-6.07 0-10 4-10 10zm82.48-29v46h-9V5h9zM36.95 0L73.9 64H0L36.95 0zm92.38 5l-27.71 48L73.91 5H84.3l17.32 30 17.32-30h10.39zm58.91 12v9.69c-1-.29-2.06-.49-3.2-.49-5.81 0-10 4-10 10V51h-9V17h9v9.2c0-5.08 5.91-9.2 13.2-9.2z" fill="#000"/>
</svg>

After

Width:  |  Height:  |  Size: 1.1 KiB

27
front/styles/globals.css Normal file
View file

@ -0,0 +1,27 @@
html,
body {
padding: 0;
margin: 0;
font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen, Ubuntu, Cantarell, Fira Sans, Droid Sans, Helvetica Neue, sans-serif;
}
a {
color: inherit;
text-decoration: none;
}
* {
box-sizing: border-box;
}
@media (prefers-color-scheme: dark) {
html {
color-scheme: dark;
}
body {
color: black;
background: #FBFBFB;
}
}

20
front/tsconfig.json Normal file
View file

@ -0,0 +1,20 @@
{
"compilerOptions": {
"target": "es5",
"lib": ["dom", "dom.iterable", "esnext"],
"allowJs": true,
"skipLibCheck": true,
"strict": true,
"forceConsistentCasingInFileNames": true,
"noEmit": true,
"esModuleInterop": true,
"module": "esnext",
"moduleResolution": "node",
"resolveJsonModule": true,
"isolatedModules": true,
"jsx": "preserve",
"incremental": true
},
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"],
"exclude": ["node_modules"]
}