yazid138 3 years ago
parent
commit
75d4384b29
5 changed files with 41 additions and 62 deletions
  1. 1 1
      components/Sanksi/TableLaporan.js
  2. 39 39
      next.config.js
  3. 0 8
      pages/app/_middleware.js
  4. 1 14
      pages/app/index.js
  5. 0 0
      pages/app/pt/index.js

+ 1 - 1
components/Sanksi/TableLaporan.js

@@ -8,7 +8,7 @@ function TableLaporan({ listData }) {
 		<div className="card b">
 			<div className="card-body">
 				{listData && (
-					<Datatable options={{ responsive: true }}>
+					<Datatable options={{ responsive: false }}>
 						<table className="table w-100">
 							<thead>
 								<tr>

+ 39 - 39
next.config.js

@@ -4,48 +4,48 @@ const withSass = require("@zeit/next-sass");
 const withCss = require("@zeit/next-css");
 
 module.exports = withSass(
-    withCss({
-        // target: 'serverless',
-        webpack: config => {
-            // Fixes npm packages that depend on `fs` module
-            config.node = {
-                fs: "empty"
-            };
+	withCss({
+		target: "serverless",
+		webpack: (config) => {
+			// Fixes npm packages that depend on `fs` module
+			config.node = {
+				fs: "empty",
+			};
 
-            // Resolves alias to root folder
-            config.resolve.alias["@"] = __dirname;
+			// Resolves alias to root folder
+			config.resolve.alias["@"] = __dirname;
 
-            // Provide alias for plugins
-            config.plugins.push(
-                new webpack.ProvidePlugin({
-                    $: "jquery",
-                    jQuery: "jquery",
-                    "window.jQuery": "jquery",
-                    "window.moment": "moment",
-                    moment: "moment",
-                    Raphael: "raphael" // required by morris.js
-                })
-            );
+			// Provide alias for plugins
+			config.plugins.push(
+				new webpack.ProvidePlugin({
+					$: "jquery",
+					jQuery: "jquery",
+					"window.jQuery": "jquery",
+					"window.moment": "moment",
+					moment: "moment",
+					Raphael: "raphael", // required by morris.js
+				})
+			);
 
-            // Fix for flot resize
-            config.module.rules.push({
-                test: /jquery\.flot\.resize\.js$/,
-                use: ["imports-loader?this=>window"]
-            });
+			// Fix for flot resize
+			config.module.rules.push({
+				test: /jquery\.flot\.resize\.js$/,
+				use: ["imports-loader?this=>window"],
+			});
 
-            // Font face support
-            config.module.rules.push({
-                test: /\.(eot|woff|woff2|ttf|svg|png|jpg|gif)$/,
-                use: {
-                    loader: "url-loader",
-                    options: {
-                        limit: 100000,
-                        name: "[name].[ext]"
-                    }
-                }
-            });
+			// Font face support
+			config.module.rules.push({
+				test: /\.(eot|woff|woff2|ttf|svg|png|jpg|gif)$/,
+				use: {
+					loader: "url-loader",
+					options: {
+						limit: 100000,
+						name: "[name].[ext]",
+					},
+				},
+			});
 
-            return config;
-        }
-    })
+			return config;
+		},
+	})
 );

+ 0 - 8
pages/app/_middleware.js

@@ -1,8 +0,0 @@
-import { NextResponse, NextRequest } from "next/server";
-
-export async function middleware(req, ev) {
-	if (!req.session.user) {
-		return NextResponse.redirect("/login");
-	}
-	return NextResponse.next();
-}

+ 1 - 14
pages/app/index.js

@@ -1,21 +1,9 @@
 import React, { Component } from "react";
 import BasePage from "@/components/Layout/BasePage";
-import { getPT } from "@/actions/PT";
-import { getPelanggaran } from "@/actions/pelanggaran";
-import Select from "react-select";
-import AsyncSelect from "react-select/async";
-import { Row, Col, FormGroup, Input, Card, CardBody, Button, CustomInput, Navbar, NavItem, NavLink, NavbarBrand, NavbarToggler, Nav, Collapse } from "reactstrap";
+import { Row, Col, Navbar, NavItem, NavLink, NavbarBrand, NavbarToggler, Nav, Collapse } from "reactstrap";
 import ContentWrapper from "@/components/Layout/ContentWrapper";
 import Link from "next/link";
 
-const loadOptions = (inputValue, callback) => {
-	setTimeout(async () => {
-		const pt = await getPT({ search: inputValue });
-		const data = pt.data.map((e) => ({ value: e.id, label: e.nama, className: "State-ACT" }));
-		callback(data);
-	}, 1000);
-};
-
 const menu = [
 	{
 		title: "Home",
@@ -34,7 +22,6 @@ const menu = [
 		path: "/login",
 	},
 ];
-const selectInstanceId = 1;
 class App extends Component {
 	constructor(props) {
 		super(props);

+ 0 - 0
pages/app/pt/index.js