Commit a6fe7eed authored by chaiwat's avatar chaiwat

add Homr page

parent 4c20e709
REACT_APP_SECRET_API=http://localhost:3000
\ No newline at end of file
const CracoLessPlugin = require('craco-less');
module.exports = {
plugins: [
{
plugin: CracoLessPlugin,
options: {
lessLoaderOptions: {
lessOptions: {
modifyVars: { '@primary-color': '#1DA57A' },
javascriptEnabled: true,
},
},
},
},
],
};
\ No newline at end of file
......@@ -3,10 +3,13 @@
"version": "0.1.0",
"private": true,
"dependencies": {
"@craco/craco": "^6.4.3",
"@line/liff": "^2.17.0",
"@testing-library/jest-dom": "^5.11.4",
"@testing-library/react": "^11.1.0",
"@testing-library/user-event": "^12.1.10",
"antd": "^4.18.2",
"craco-less": "^2.0.0",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react-router-dom": "5.2.0",
......@@ -14,10 +17,9 @@
"web-vitals": "^1.0.1"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
"start": "craco start",
"build": "craco build",
"test": "craco test"
},
"eslintConfig": {
"extends": [
......
public/favicon.ico

3.78 KB | W: | H:

public/favicon.ico

28.5 KB | W: | H:

public/favicon.ico
public/favicon.ico
public/favicon.ico
public/favicon.ico
  • 2-up
  • Swipe
  • Onion skin
......@@ -5,42 +5,25 @@
<meta charset="utf-8" />
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#000000" />
<meta name="description" content="Web site created using create-react-app" />
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
<!--
manifest.json provides metadata used when your web app is installed on a
user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
-->
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
<!--
Notice the use of %PUBLIC_URL% in the tags above.
It will be replaced with the URL of the `public` folder during the build.
Only files inside the `public` folder can be referenced from the HTML.
Unlike "/favicon.ico" or "favicon.ico", "%PUBLIC_URL%/favicon.ico" will
work correctly both with client-side routing and a non-root public URL.
Learn how to configure a non-root public URL by running `npm run build`.
-->
<!-- line sdk -->
<script src="https://static.line-scdn.net/liff/edge/2.1/liff.js"></script>
<!-- line sdk -->
<title>React App</title>
<script src="https://d.line-scdn.net/liff/1.0/sdk.js"></script>
<title>Repair Center</title>
<style>
.da-contact-card .ant-table-tbody>tr>td:first-child {
text-align: left !important;
}
</style>
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root"></div>
<!--
This HTML file is a template.
If you open it directly in the browser, you will see an empty page.
You can add webfonts, meta tags, or analytics to this file.
The build step will place the bundled scripts into the <body> tag.
To begin the development, run `npm start` or `yarn start`.
To create a production bundle, use `npm run build` or `yarn build`.
-->
</body>
</html>
\ No newline at end of file
import Routers from './router/Routers';
import './assets/less/theme.less';
function App() {
return <Routers />
}
......
import { React, Fragment } from "react";
import TabHeader from "./tabHeader";
export default function App () {
return (
<Fragment>
<TabHeader />
</Fragment>
);
}
import { React } from "react";
import { Col, Layout, Row } from "antd";
import { useHistory } from "react-router-dom";
const { Header } = Layout;
export default function App() {
const history = useHistory();
const clicklogo = () => {
history.push("/");
};
return (
<Header className="header-home" style={{ zIndex: 1 }}>
<div>
{/* <img src={logo} alt="Logo" width={30} height={30}/> */}
<Row>
<Col span={20}>
<Row className="main-logo" onClick={clicklogo}>
<div> Repair </div>&nbsp;
<div className="logo"> Center</div>
</Row>
</Col>
</Row>
</div>
</Header>
);
}
.header-home {
background-color: red;
position: "fixed";
width: "100%";
font-size: 20px;
font-weight: bold;
}
.footer-home {
background-color: red;
}
.site-layout-background {
background-color: red;
width: 100%;
height: 100%;
text-align: center;
}
.main-logo {
cursor: pointer;
float: left;
width: 190px;
height: 31px;
}
.home-content {
padding: 90px 0;
text-align: center;
}
.text-repair {
font-size: 60px;
font-weight: bold;
}
.img-repair {
width: 500px;
}
.text-discripttion {
font-size: 18px;
color: aliceblue;
}
.pading {
padding: 50px 0;
text-align: center;
}
.widget1 {
width: 50px;
height: 50px;
background-color: rgb(0, 0, 0);
position: absolute;
animation: mymove1 1.5s infinite;
border-radius: 50%;
}
@keyframes mymove1 {
from {right: 50%;}
to {right: 45%;}
}
.widget2 {
width: 50px;
height: 50px;
background-color: rgb(255, 255, 255);
position: absolute;
animation: mymove2 1.5s infinite;
border-radius: 50%;
}
@keyframes mymove2 {
from {left: 50%;}
to {left: 45%;}
}
.bg-color-red {
background-color: red;
}
\ No newline at end of file
.logo {
float: left;
color: rgb(255, 255, 255);
font-size: 100 px;
font-weight: bold;
}
.site-layout .site-layout-background {
background: #fff;
}
\ No newline at end of file
@import "Layouts/header.less";
@import "Home/index.less";
\ No newline at end of file
@import '~antd/dist/antd.less';
@import "./index.less";
@font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial,
'Noto Sans', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol',
'Noto Color Emoji';
\ No newline at end of file
import { BrowserRouter as AppRouter, Route, Switch } from "react-router-dom";
import Ecommerce from "../view/Dashboards/ecommerce";
//import Login
//import
import Login from "../view/Login";
// import Home from "../view/Homes/index";
import Home from "../view/Homes/index"
export default function Routers() {
return (
......@@ -11,6 +13,14 @@ export default function Routers() {
<Route
exact
path={"/"}
render={() => {
return <Home />;
}}
/>
<Route
exact
path={"/login"}
render={() => {
return <Login />;
}}
......@@ -18,7 +28,7 @@ export default function Routers() {
<Route
exact
path={"/Dashboard"}
path={"/dashboard"}
render={() => {
return <Ecommerce />;
}}
......
import React from 'react'
import { React, Fragment } from "react";
import Header from '../../../Layouts/tabHeader'
export default function Ecommerce() {
return (
<div>
<h3>สวัสดี, Fariw 👋</h3>
</div>
)
}
\ No newline at end of file
return (
<Fragment>
<Header />
<h3>สวัสดี, Fariw 👋</h3>
</Fragment>
);
}
import { React } from "react";
import { Layout, Row, Col, Button, Spin } from "antd";
import textrepair from "../../assets/images/repair.png";
import { useHistory } from "react-router-dom";
const { Header, Content, Footer } = Layout;
export default function App() {
const history = useHistory();
const clicklogo = () => {
history.push("/");
};
const getstarted = () => {
history.push("/dashboard");
}
return (
<div className="home">
<Header className="header-home" style={{ zIndex: 1 }}>
<div>
{/* <img src={logo} alt="Logo" width={30} height={30}/> */}
<Row>
<Col span={20}>
<Row className="main-logo" onClick={clicklogo}>
<div> Repair </div>&nbsp;
<div className="logo"> Center</div>
</Row>
</Col>
</Row>
</div>
</Header>
<Content
className="site-layout-background"
style={{
minHeight: 522,
}}
>
<div className="home-content">
<Col span={24}>
<Row>
<Col span={24}>
<img className="img-repair" src={textrepair} alt="Logo" />
</Col>
</Row>
<Row>
<Col span={24}>
<div className="text-discripttion">
<Spin />
ระบบจัดการร้านซ่อม รวบรวมร้านซ่อมทุกประเภทเข้ามาในระบบ
เพื่อง่ายต่อการซ่อมในครั้งถัดไป
<Spin />
</div>
</Col>
</Row>
<div className="pading">
<Row>
<Col span={24}>
<Button size="large" shape="round" onClick={getstarted}>
เริ่มต้นใช้งาน
</Button>
</Col>
</Row>
</div>
<Row>
<Col span={24}>
<div className="widget1"></div>
</Col>
<Col span={24}>
<div className="widget2"></div>
</Col>
</Row>
</Col>
</div>
</Content>
<Footer className="footer-home" style={{ textAlign: "center" }}>
Ant Design ©2018 Created by Ant UED
</Footer>
</div>
);
}
import liff from "@line/liff";
import { Fragment, useEffect, useState } from "react";
// import liff from "@line/liff";
import { React, Fragment } from "react";
function App() {
// const [pictureUrl, setPictureUrl] = useState(logo)
// eslint-disable-next-line no-unused-vars
const [idToken, setIdToken] = useState("");
// const [displayName, setDisplayName] = useState('')
// const [statusMessage, setStatusMessage] = useState('')
// const [userId, setUserId] = useState('')
// const logout = () => {
// liff.logout()
// window.location.reload()
// }
const initLine = () => {
liff.init(
{ liffId: "1656654849-0gQezROW" },
() => {
if (liff.isLoggedIn()) {
runApp();
} else {
liff.login();
}
},
(err) => console.error(err)
);
};
const runApp = () => {
const idToken = liff.getIDToken();
setIdToken(idToken);
liff
.getProfile()
.then((profile) => {
console.log(profile)
setTimeout(() => {
window.location.href = '/Dashboard'
}, 3000);
})
.catch((err) => console.error(err));
};
useEffect(() => {
initLine();
// eslint-disable-next-line react-hooks/exhaustive-deps
}, []);
console.log(process.env.REACT_APP_SECRET_API)
return (
<Fragment></Fragment>
<Fragment>
<h3>สวัสดี, Login page 👋</h3>
</Fragment>
);
}
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment