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

New Front End #20

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open
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
22,990 changes: 22,974 additions & 16 deletions client/pinjamanku/package-lock.json

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions client/pinjamanku/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,14 @@
"antd": "^4.16.13",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react-infinite-scroller": "^1.2.4",
"react-redux": "^7.2.5",
"react-router-dom": "^5.3.0",
"react-scripts": "4.0.3",
"redux": "^4.1.1",
"redux-thunk": "^2.3.0",
"request": "^2.88.2",
"reqwest": "^2.0.5",
"web-vitals": "^1.1.2"
},
"scripts": {
Expand Down
42 changes: 19 additions & 23 deletions client/pinjamanku/public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,34 +10,30 @@
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/
-->
<!-- Boostrap -->
<link
href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.1/dist/css/bootstrap.min.css"
rel="stylesheet"
integrity="sha384-F3w7mX95PdgyTmZZMECAngseQB83DfGTowi0iMjiWaeVhAn4FJkqJByhZMI3AhiU"
crossorigin="anonymous"
/>
<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`.
-->
<title>React App</title>
<title>PinjamanKu</title>
</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`.
-->
<!-- JQuery Boostrap -->
<script
src="https://cdn.jsdelivr.net/npm/@popperjs/core@2.9.3/dist/umd/popper.min.js"
integrity="sha384-W8fXfP3gkOKtndU4JGtKDvXbO53Wy8SZCQHczT5FMiiqmQfUpWbYdTil/SxwZgAN"
crossorigin="anonymous"
></script>
<script
src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.1/dist/js/bootstrap.min.js"
integrity="sha384-skAcpIdS7UcVUC05LJ9Dxay8AXcDYfBJqt1CJ85S/CFujBsIzCIv+l9liuYLaMQ/"
crossorigin="anonymous"
></script>
</body>
</html>
136 changes: 110 additions & 26 deletions client/pinjamanku/src/App.css
Original file line number Diff line number Diff line change
@@ -1,38 +1,122 @@
.App {
text-align: center;
header {
position: absolute;
z-index: 10;
width: 100vw;
}
.bg-light {
background-color: transparent !important;
}
.navbar-brand {
font-size: 2em;
font-weight: 800;
text-transform: uppercase;
}

.App-logo {
height: 40vmin;
pointer-events: none;
.nav-item {
font-weight: 500;
text-transform: uppercase;
border-radius: 30px;
}

@media (prefers-reduced-motion: no-preference) {
.App-logo {
animation: App-logo-spin infinite 20s linear;
}
.nav-item .nav-link:hover {
background-color: black;
color: white !important;
}

.App-header {
background-color: #282c34;
.active {
background-color: black;
color: white !important;
}
.hero {
position: relative;
width: 100%;
background: url(https://images.unsplash.com/photo-1491317079341-38313806b657?ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&ixlib=rb-1.2.1&auto=format&fit=crop&w=1000&q=80);
min-height: 100vh;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
font-size: calc(10px + 2vmin);
color: white;
background-size: cover;
background-position: center;
position: relative;
}

.hero h1 {
font-size: 70px;
font-weight: 800;
margin: 0;
padding: 0;
}
.hero p {
padding: 0;
margin: 1em 0 0 0;
font-size: 20px;
font-weight: 500;
text-align: justify;
}
.hero-borrower {
position: relative;
width: 100%;
background: url(https://images.unsplash.com/photo-1489844097929-c8d5b91c456e?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=1052&q=80);
min-height: 40vh;
background-size: cover;
background-position: center;
position: relative;
}
.btn1 {
display: inline-block;
margin: 1em 0 0 0;
background-color: black;
color: #ffffff;
text-transform: uppercase;
border: none;
text-decoration: none;
font-weight: 800;
padding: 10px 20px;
border-radius: 30px;
border: 2px solid black;
}

.btn1:hover {
background-color: white;
color: black;
border: 2px solid black;
text-decoration: none;
}
.login {
position: relative;
width: 100%;
background: url(https://images.unsplash.com/photo-1626846563711-f2d01a141b77?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=2000&q=80);
min-height: 100vh;
background-size: cover;
background-position: center;
position: relative;
}
.login-card {
border-radius: 30px !important;
background-color: rgb(161, 161, 161);
}

.register {
position: relative;
width: 100%;
background: url(https://images.unsplash.com/photo-1454165804606-c3d57bc86b40?ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&ixlib=rb-1.2.1&auto=format&fit=crop&w=1000&q=80);
min-height: 100vh;
background-size: cover;
background-position: center;
position: relative;
}
.register-card {
border-radius: 30px !important;
background-color: darkgrey;
}

#components-layout-demo-responsive .logo {
height: 32px;
margin: 16px;
background: rgba(255, 255, 255, 0.2);
}

.App-link {
color: #61dafb;
.site-layout-sub-header-background {
background: #fff;
}

@keyframes App-logo-spin {
from {
transform: rotate(0deg);
}
to {
transform: rotate(360deg);
}
.site-layout-background {
background: #fff;
}
64 changes: 43 additions & 21 deletions client/pinjamanku/src/App.js
Original file line number Diff line number Diff line change
@@ -1,25 +1,47 @@
import logo from './logo.svg';
import './App.css';

function App() {
import { Provider } from "react-redux";
import { BrowserRouter, Switch, Route } from "react-router-dom";
import "./App.css";
import { DasboardBorower, Home, Lander, ListLoan, ListUser, ListUserStatus, Login, Register, TempatMinjam } from "./pages";
import store from "./store";
export default function App() {
return (
<div className="App">
<header className="App-header">
<img src={logo} className="App-logo" alt="logo" />
<p>
Edit <code>src/App.js</code> and save to reload.
</p>
<a
className="App-link"
href="https://reactjs.org"
target="_blank"
rel="noopener noreferrer"
>
Learn React
</a>
</header>
<div>
<Provider store={store}>
<BrowserRouter>
<Switch>
<Route path="/admin-dashboard/listUser">
<ListUser />
</Route>
<Route path="/admin-dashboard/listUserStatus">
<ListUserStatus />
</Route>
<Route path="/admin-dashboard/listLoan">
<ListLoan />
</Route>
{/* Nanti di tambah ID landernya */}
<Route path="/lender">
<Lander />
</Route>
{/* Nanti di tambah ID borowernya */}
<Route path="/pendana/tempat-minjam">
<TempatMinjam />
</Route>
{/* Nanti di tambah ID borowernya */}
<Route path="/pendana">
<DasboardBorower />
</Route>
<Route path="/register">
<Register />
</Route>
<Route path="/login">
<Login />
</Route>
<Route exact path="/">
<Home />
</Route>
</Switch>
</BrowserRouter>
</Provider>
</div>
);
}

export default App;
9 changes: 9 additions & 0 deletions client/pinjamanku/src/components/adminFooter.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { Layout } from "antd"

const { Footer } = Layout

export default function AdminFooter() {
return (
<Footer style={{ textAlign: 'center' }}>Ant Design ©2018 Created by PinjamKu</Footer>
)
}
48 changes: 48 additions & 0 deletions client/pinjamanku/src/components/adminNavbar.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
import { Layout, Menu, } from 'antd'
import {
Link, useLocation
} from 'react-router-dom'
const { Sider } = Layout

export default function AdminNavbar() {
const { pathname } = useLocation()
let menuKey;
switch (pathname) {
case '/listUser':
menuKey = "1"
break;
case '/listUserStatus':
menuKey = "2"
break;
case '/listLoan':
menuKey = "3"
break;
default:
break;
}
return (
<Sider
breakpoint="lg"
collapsedWidth="0"
onBreakpoint={broken => {
console.log(broken);
}}
onCollapse={(collapsed, type) => {
console.log(collapsed, type);
}}
>
<div className="logo" />
<Menu theme="dark" mode="inline" defaultSelectedKeys={[menuKey]}>
<Menu.Item key="1" >
<Link to='/listUser'>List User</Link>
</Menu.Item>
<Menu.Item key="2" >
<Link to='/listUserStatus'>List User Status</Link>
</Menu.Item>
<Menu.Item key="3" >
<Link to='/listLoan'>List Loan</Link>
</Menu.Item>
</Menu>
</Sider>
)
}
5 changes: 5 additions & 0 deletions client/pinjamanku/src/components/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
export { default as Navbar } from './navbar'
export { default as ListItemPinjam } from './listItemPinjam'
export { default as ListItemStatusPinjam } from './listItemStatusPinjam'
export { default as AdminNavbar } from './adminNavbar'
export { default as AdminFooter } from './adminFooter'
Loading