Update of packages and simplification
This commit is contained in:
15
.babelrc
15
.babelrc
@@ -1,15 +0,0 @@
|
||||
{
|
||||
"presets": [
|
||||
"next/babel"
|
||||
],
|
||||
"plugins": [
|
||||
[
|
||||
"styled-components",
|
||||
{
|
||||
"ssr": true,
|
||||
"displayName": true,
|
||||
"preprocess": false
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
3
.eslintrc.json
Normal file
3
.eslintrc.json
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"extends": "next/core-web-vitals"
|
||||
}
|
||||
3
.gitignore
vendored
3
.gitignore
vendored
@@ -32,3 +32,6 @@ yarn-error.log*
|
||||
|
||||
# vercel
|
||||
.vercel
|
||||
|
||||
# gsap npmrc
|
||||
.npmrc
|
||||
|
||||
2
.npmrc.sample
Normal file
2
.npmrc.sample
Normal file
@@ -0,0 +1,2 @@
|
||||
//npm.greensock.com/:_authToken=TOKEN
|
||||
@gsap:registry=https://npm.greensock.com
|
||||
@@ -1,79 +0,0 @@
|
||||
import React, { useEffect, useState } from "react";
|
||||
import { useDropzone } from "react-dropzone";
|
||||
|
||||
const thumbsContainer = {
|
||||
display: "flex",
|
||||
flexDirection: "row",
|
||||
flexWrap: "wrap",
|
||||
marginTop: 16,
|
||||
};
|
||||
|
||||
const thumb = {
|
||||
display: "inline-flex",
|
||||
borderRadius: 2,
|
||||
border: "1px solid #eaeaea",
|
||||
marginBottom: 8,
|
||||
marginRight: 8,
|
||||
width: 100,
|
||||
height: 100,
|
||||
padding: 4,
|
||||
boxSizing: "border-box",
|
||||
};
|
||||
|
||||
const thumbInner = {
|
||||
display: "flex",
|
||||
minWidth: 0,
|
||||
overflow: "hidden",
|
||||
};
|
||||
|
||||
const img = {
|
||||
display: "block",
|
||||
width: "auto",
|
||||
height: "100%",
|
||||
};
|
||||
|
||||
export default function Dropzone(props) {
|
||||
const [files, setFiles] = useState([]);
|
||||
const { getRootProps, getInputProps } = useDropzone({
|
||||
accept: "image/*,.dxf,.stp,.step,.pdf",
|
||||
onDrop: (acceptedFiles) => {
|
||||
props.setFieldValue(
|
||||
`parts[${props.index}].files`,
|
||||
props.files.concat(acceptedFiles)
|
||||
);
|
||||
setFiles(
|
||||
props.files.map((file) =>
|
||||
Object.assign(file, {
|
||||
preview: URL.createObjectURL(file),
|
||||
})
|
||||
)
|
||||
);
|
||||
},
|
||||
});
|
||||
|
||||
const thumbs = files.map((file) => (
|
||||
<div style={thumb} key={file.name}>
|
||||
<div style={thumbInner}>
|
||||
<img src={file.preview} style={img} />
|
||||
</div>
|
||||
</div>
|
||||
));
|
||||
|
||||
useEffect(
|
||||
() => () => {
|
||||
// Make sure to revoke the data uris to avoid memory leaks
|
||||
files.forEach((file) => URL.revokeObjectURL(file.preview));
|
||||
},
|
||||
[files]
|
||||
);
|
||||
|
||||
return (
|
||||
<section className="container">
|
||||
<div {...getRootProps({ className: "dropzone" })}>
|
||||
<input {...getInputProps()} />
|
||||
<p>Drag 'n' drop some files here, or click to select files</p>
|
||||
</div>
|
||||
<aside style={thumbsContainer}>{thumbs}</aside>
|
||||
</section>
|
||||
);
|
||||
}
|
||||
@@ -1,42 +0,0 @@
|
||||
import React from "react";
|
||||
|
||||
export default class Thumb extends React.Component {
|
||||
state = {
|
||||
loading: false,
|
||||
thumb: undefined,
|
||||
};
|
||||
|
||||
componentDidUpdate(prevProps) {
|
||||
if (prevProps.file !== this.props.file) {
|
||||
this.setState({ loading: true }, () => {
|
||||
let reader = new FileReader();
|
||||
|
||||
reader.onloadend = () => {
|
||||
this.setState({ loading: false, thumb: reader.result });
|
||||
};
|
||||
|
||||
reader.readAsDataURL(this.props.file);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
render() {
|
||||
if (!this.props.file) {
|
||||
return null;
|
||||
}
|
||||
|
||||
if (this.state.loading) {
|
||||
return <p>loading...</p>;
|
||||
}
|
||||
|
||||
return (
|
||||
<img
|
||||
src={this.state.thumb}
|
||||
alt={this.props.file.name}
|
||||
className=""
|
||||
height={200}
|
||||
width={200}
|
||||
/>
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1,207 +0,0 @@
|
||||
import React from "react";
|
||||
import {
|
||||
TextInput,
|
||||
TextareaInput,
|
||||
SelectInput,
|
||||
CheckInput,
|
||||
} from "../formfields.jsx";
|
||||
|
||||
export default function ContactPersonForm(props) {
|
||||
return (
|
||||
<>
|
||||
<div className="row g-2 mb-5">
|
||||
<div className="col">
|
||||
<h1>Informationen</h1>
|
||||
</div>
|
||||
</div>
|
||||
<div className="row g-2 mb-5">
|
||||
<div className="col">
|
||||
<TextInput
|
||||
isSubmitting={props.isSubmitting}
|
||||
rescode={props.rescode}
|
||||
error={props.errors.firma}
|
||||
touched={props.touched.firma}
|
||||
placeholder={"Musterfirma"}
|
||||
onChange={props.handleChange("firma")}
|
||||
onBlur={props.handleBlur("firma")}
|
||||
value={props.values.firma}
|
||||
label="Firma (optional)"
|
||||
type="text"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div className="row g-2 mb-3">
|
||||
<h3>Anprechpartner</h3>
|
||||
<div className="col">
|
||||
<SelectInput
|
||||
isSubmitting={props.isSubmitting}
|
||||
rescode={props.rescode}
|
||||
error={props.errors.anrede}
|
||||
touched={props.touched.anrede}
|
||||
placeholder={"Anrede"}
|
||||
onChange={props.handleChange("anrede")}
|
||||
onBlur={props.handleBlur("anrede")}
|
||||
value={props.values.anrede}
|
||||
label="Anrede"
|
||||
options={["Herr", "Frau", "Divers"]}
|
||||
/>
|
||||
</div>
|
||||
<div className="col">
|
||||
<SelectInput
|
||||
isSubmitting={props.isSubmitting}
|
||||
rescode={props.rescode}
|
||||
error={props.errors.titel}
|
||||
touched={props.touched.titel}
|
||||
placeholder={"Titel"}
|
||||
onChange={props.handleChange("titel")}
|
||||
onBlur={props.handleBlur("titel")}
|
||||
value={props.values.titel}
|
||||
label="Titel"
|
||||
options={["Dr.", "Prof.", "Dipl."]}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div className="row g-2 mb-3">
|
||||
<div className="col">
|
||||
<TextInput
|
||||
isSubmitting={props.isSubmitting}
|
||||
rescode={props.rescode}
|
||||
error={props.errors.vorname}
|
||||
touched={props.touched.vorname}
|
||||
placeholder={"Max"}
|
||||
onChange={props.handleChange("vorname")}
|
||||
onBlur={props.handleBlur("vorname")}
|
||||
value={props.values.vorname}
|
||||
label="Vorname (optional)"
|
||||
type="text"
|
||||
/>
|
||||
</div>
|
||||
<div className="col">
|
||||
<TextInput
|
||||
isSubmitting={props.isSubmitting}
|
||||
rescode={props.rescode}
|
||||
error={props.errors.nachname}
|
||||
touched={props.touched.nachname}
|
||||
placeholder={"Mustermann"}
|
||||
onChange={props.handleChange("nachname")}
|
||||
onBlur={props.handleBlur("nachname")}
|
||||
value={props.values.nachname}
|
||||
label="Nachname"
|
||||
type="text"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div className="row g-2 mb-5">
|
||||
<div className="col">
|
||||
<TextInput
|
||||
isSubmitting={props.isSubmitting}
|
||||
rescode={props.rescode}
|
||||
error={props.errors.email}
|
||||
touched={props.touched.email}
|
||||
placeholder={"max@mustermann.de"}
|
||||
onChange={props.handleChange("email")}
|
||||
onBlur={props.handleBlur("email")}
|
||||
value={props.values.email}
|
||||
label="eMail"
|
||||
type="text"
|
||||
/>
|
||||
</div>
|
||||
<div className="col">
|
||||
<TextInput
|
||||
isSubmitting={props.isSubmitting}
|
||||
rescode={props.rescode}
|
||||
error={props.errors.telefon}
|
||||
touched={props.touched.telefon}
|
||||
placeholder={"0815 123456"}
|
||||
onChange={props.handleChange("telefon")}
|
||||
onBlur={props.handleBlur("telefon")}
|
||||
value={props.values.telefon}
|
||||
label="Telfon (optional)"
|
||||
type="text"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="row g-2 mb-3">
|
||||
<h3>Rechnungsadresse</h3>
|
||||
<div className="col">
|
||||
<TextInput
|
||||
isSubmitting={props.isSubmitting}
|
||||
rescode={props.rescode}
|
||||
error={props.errors.invoiceadress}
|
||||
touched={props.touched.invoiceadress}
|
||||
placeholder={"Musterstraße 1"}
|
||||
onChange={props.handleChange("invoiceadress")}
|
||||
onBlur={props.handleBlur("invoiceadress")}
|
||||
value={props.values.invoiceadress}
|
||||
label="Adresse"
|
||||
type="text"
|
||||
/>
|
||||
</div>
|
||||
<div className="col">
|
||||
<TextInput
|
||||
isSubmitting={props.isSubmitting}
|
||||
rescode={props.rescode}
|
||||
error={props.errors.invoiceplz}
|
||||
touched={props.touched.invoiceplz}
|
||||
placeholder={"12345"}
|
||||
onChange={props.handleChange("invoiceplz")}
|
||||
onBlur={props.handleBlur("invoiceplz")}
|
||||
value={props.values.invoiceplz}
|
||||
label="PLZ"
|
||||
type="text"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="row g-2 mb-5">
|
||||
<div className="col">
|
||||
<CheckInput
|
||||
isSubmitting={props.isSubmitting}
|
||||
rescode={props.rescode}
|
||||
error={props.errors.diffrentshipping}
|
||||
touched={props.touched.diffrentshipping}
|
||||
onChange={props.handleChange("diffrentshipping")}
|
||||
onBlur={props.handleBlur("diffrentshipping")}
|
||||
value={props.values.diffrentshipping}
|
||||
label=" Lieferadresse ist anders als Rechnungsadresse"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{props.values.diffrentshipping && (
|
||||
<div className="row g-2 mb-5">
|
||||
<h3>Lieferadresse</h3>
|
||||
<div className="col">
|
||||
<TextInput
|
||||
isSubmitting={props.isSubmitting}
|
||||
rescode={props.rescode}
|
||||
error={props.errors.shippingaddress}
|
||||
touched={props.touched.shippingaddress}
|
||||
placeholder={"Musterstraße 1"}
|
||||
onChange={props.handleChange("shippingaddress")}
|
||||
onBlur={props.handleBlur("shippingaddress")}
|
||||
value={props.values.shippingaddress}
|
||||
label="Lieferadresse"
|
||||
type="text"
|
||||
/>
|
||||
</div>
|
||||
<div className="col">
|
||||
<TextInput
|
||||
isSubmitting={props.isSubmitting}
|
||||
rescode={props.rescode}
|
||||
error={props.errors.shippingplz}
|
||||
touched={props.touched.shippingplz}
|
||||
placeholder={"12345"}
|
||||
onChange={props.handleChange("shippingplz")}
|
||||
onBlur={props.handleBlur("shippingplz")}
|
||||
value={props.values.shippingplz}
|
||||
label="PLZ"
|
||||
type="text"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -1,23 +0,0 @@
|
||||
import React from "react";
|
||||
|
||||
export default function IntroForm(props) {
|
||||
return (
|
||||
<>
|
||||
<div>
|
||||
<h1>eAnfrage</h1>
|
||||
<p>
|
||||
Herzlich Wilkommen bei der Prothman GmbH. Wir freuen uns sehr, dass
|
||||
Sie Interesse an unserem Produktionsspektrum haben.
|
||||
<br />
|
||||
<br />
|
||||
Hier haben Sie die Möglichkeit, direkt online eine Produktionsanfrage
|
||||
an uns zu schicken. Dies ist für sie volkommen kostenlos!
|
||||
<br />
|
||||
Das Tool erfrgägt alle wichtigen Parameter, die wir für die
|
||||
Kalkulation eines Angebotes benötigen. Sollten noch Unklarheiten
|
||||
aufkommen, setzen wir uns mit Ihnen in Verbindung.
|
||||
</p>
|
||||
</div>
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -1,380 +0,0 @@
|
||||
import React from "react";
|
||||
import {
|
||||
TextInput,
|
||||
TextareaInput,
|
||||
SelectInput,
|
||||
CheckInput,
|
||||
} from "../formfields.jsx";
|
||||
import Image from "next/image";
|
||||
import Dropzone from "../Dropzone.jsx";
|
||||
|
||||
const dropzoneStyle = {
|
||||
width: "100%",
|
||||
height: "auto",
|
||||
borderWidth: 2,
|
||||
borderColor: "rgb(102, 102, 102)",
|
||||
borderStyle: "dashed",
|
||||
borderRadius: 5,
|
||||
};
|
||||
|
||||
export default class PartForm extends React.Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
|
||||
this._handleModalShow = this._handleModalShow.bind(this);
|
||||
this._handleModalHide = this._handleModalHide.bind(this);
|
||||
|
||||
this.state = {
|
||||
show: false,
|
||||
modalindex: 0,
|
||||
newmodaldata: {},
|
||||
};
|
||||
}
|
||||
|
||||
_handleModalShow(index) {
|
||||
this.setState({
|
||||
show: true,
|
||||
modalindex: index,
|
||||
});
|
||||
}
|
||||
|
||||
_handleModalHide(index) {
|
||||
this.setState({
|
||||
show: false,
|
||||
});
|
||||
}
|
||||
|
||||
render() {
|
||||
const that = this;
|
||||
const props = this.props;
|
||||
|
||||
return (
|
||||
<>
|
||||
{this.state.show && (
|
||||
<Overlay
|
||||
index={this.state.modalindex}
|
||||
show={this.state.show}
|
||||
handleHide={this._handleModalHide}
|
||||
{...props}
|
||||
/>
|
||||
)}
|
||||
|
||||
<div className="row g-2 mb-5">
|
||||
<div className="col">
|
||||
<h1>Produktionsdaten</h1>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="row g-2 mb-5">
|
||||
<div className="col">
|
||||
<table className="table mt-5">
|
||||
<thead className="table-secondary">
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<th>Material</th>
|
||||
<th>Anzahl</th>
|
||||
<th>Anzahl Dateien</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{props.values.parts.map(function (part, index) {
|
||||
return (
|
||||
<tr key={index}>
|
||||
<td>{part.name}</td>
|
||||
<td>{part.material}</td>
|
||||
<td>{part.amount}</td>
|
||||
<td>{part.files.length}</td>
|
||||
<td colSpan="1">
|
||||
<button
|
||||
type="button"
|
||||
className={`btn btn-dark text-center m-0`}
|
||||
onClick={that._handleModalShow.bind(this, index)}
|
||||
>
|
||||
<svg
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
width="16"
|
||||
height="16"
|
||||
fill="currentColor"
|
||||
className="bi bi-pencil-square"
|
||||
viewBox="0 0 16 16"
|
||||
>
|
||||
<path d="M15.502 1.94a.5.5 0 0 1 0 .706L14.459 3.69l-2-2L13.502.646a.5.5 0 0 1 .707 0l1.293 1.293zm-1.75 2.456l-2-2L4.939 9.21a.5.5 0 0 0-.121.196l-.805 2.414a.25.25 0 0 0 .316.316l2.414-.805a.5.5 0 0 0 .196-.12l6.813-6.814z" />
|
||||
<path
|
||||
fillRule="evenodd"
|
||||
d="M1 13.5A1.5 1.5 0 0 0 2.5 15h11a1.5 1.5 0 0 0 1.5-1.5v-6a.5.5 0 0 0-1 0v6a.5.5 0 0 1-.5.5h-11a.5.5 0 0 1-.5-.5v-11a.5.5 0 0 1 .5-.5H9a.5.5 0 0 0 0-1H2.5A1.5 1.5 0 0 0 1 2.5v11z"
|
||||
/>
|
||||
</svg>
|
||||
</button>
|
||||
|
||||
<button
|
||||
type="button"
|
||||
className={`btn btn-danger text-center m-0`}
|
||||
onClick={() => console.log("Edit")}
|
||||
>
|
||||
<svg
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
width="16"
|
||||
height="16"
|
||||
fill="currentColor"
|
||||
className="bi bi-x-square"
|
||||
viewBox="0 0 16 16"
|
||||
>
|
||||
<path d="M14 1a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1h12zM2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2H2z" />
|
||||
<path d="M4.646 4.646a.5.5 0 0 1 .708 0L8 7.293l2.646-2.647a.5.5 0 0 1 .708.708L8.707 8l2.647 2.646a.5.5 0 0 1-.708.708L8 8.707l-2.646 2.647a.5.5 0 0 1-.708-.708L7.293 8 4.646 5.354a.5.5 0 0 1 0-.708z" />
|
||||
</svg>
|
||||
</button>
|
||||
</td>
|
||||
</tr>
|
||||
);
|
||||
})}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
function Overlay(props) {
|
||||
return (
|
||||
<div className="modal" tabIndex="-1" style={{ display: "block" }}>
|
||||
<div className="modal-dialog modal-fullscreen">
|
||||
<div className="modal-content">
|
||||
<div className="modal-header">
|
||||
<h5 className="modal-title">
|
||||
{props.values.parts[props.index]["name"]}
|
||||
</h5>
|
||||
<button
|
||||
type="button"
|
||||
className="btn-close bg-white"
|
||||
data-bs-dismiss="modal"
|
||||
aria-label="Close"
|
||||
onClick={props.handleHide}
|
||||
></button>
|
||||
</div>
|
||||
<div className="modal-body">
|
||||
<div className="container">
|
||||
<div className="row">
|
||||
<div className="col">
|
||||
<div className="row g-2 mb-3">
|
||||
<h3>Angaben</h3>
|
||||
<div className="col">
|
||||
<TextInput
|
||||
isSubmitting={props.isSubmitting}
|
||||
// error={props.errors.parts[props.index]["name"]}
|
||||
// touched={props.touched.parts[props.index]["name"]}
|
||||
placeholder={"Metallteil 123"}
|
||||
onChange={props.handleChange(
|
||||
`parts[${props.index}].name`
|
||||
)}
|
||||
// onBlur={
|
||||
// props.handleBlur.values.parts[props.index]["name"]
|
||||
// }
|
||||
value={props.values.parts[props.index]["name"]}
|
||||
label="Name"
|
||||
type="text"
|
||||
/>
|
||||
</div>
|
||||
<div className="col">
|
||||
<TextInput
|
||||
isSubmitting={props.isSubmitting}
|
||||
// error={props.errors.parts[props.index]["amount"]}
|
||||
// touched={props.touched.parts[props.index]["amount"]}
|
||||
placeholder={"123"}
|
||||
onChange={props.handleChange(
|
||||
`parts[${props.index}].amount`
|
||||
)}
|
||||
// onBlur={props.handleBlur("amount")}
|
||||
value={props.values.parts[props.index]["amount"]}
|
||||
label="Anzahl"
|
||||
type="text"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div className="row g-2 mb-3">
|
||||
<div className="col">
|
||||
<TextareaInput
|
||||
isSubmitting={props.isSubmitting}
|
||||
// error={props.errors.parts[props.index]["description"]}
|
||||
// touched={props.touched.parts[props.index]["description"]}
|
||||
placeholder={"Metallteil 123"}
|
||||
onChange={props.handleChange(
|
||||
`parts[${props.index}].description`
|
||||
)}
|
||||
onBlur={props.handleBlur(
|
||||
`parts[${props.index}].description`
|
||||
)}
|
||||
value={props.values.parts[props.index]["description"]}
|
||||
label="Beschreibung"
|
||||
type="text"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div className="row g-2 mb-5">
|
||||
<div className="col">
|
||||
<SelectInput
|
||||
isSubmitting={props.isSubmitting}
|
||||
type="radio"
|
||||
// error={props.errors.titel}
|
||||
// touched={props.touched.titel}
|
||||
placeholder={"Material"}
|
||||
onChange={props.handleChange(
|
||||
`parts[${props.index}].material`
|
||||
)}
|
||||
onBlur={props.handleBlur(
|
||||
`parts[${props.index}].material`
|
||||
)}
|
||||
value={props.values.parts[props.index]["material"]}
|
||||
label="Material"
|
||||
options={[
|
||||
"1.4301 V2A",
|
||||
"1.4310 Federstahl",
|
||||
"1.4404 V4A",
|
||||
"1.4751 V4A",
|
||||
"1.4016 Blech",
|
||||
"DC01 Stahl",
|
||||
"St37 Stahl",
|
||||
"AlMg3",
|
||||
"AlSi",
|
||||
"Al99",
|
||||
"Sonstiges",
|
||||
]}
|
||||
/>
|
||||
</div>
|
||||
{props.values.parts[props.index]["material"] ==
|
||||
"Sonstiges" && (
|
||||
<div className="col">
|
||||
<TextInput
|
||||
isSubmitting={props.isSubmitting}
|
||||
// error={props.errors.parts[props.index]["materialother"]}
|
||||
// touched={props.touched.parts[props.index]["materialother"]}
|
||||
placeholder={"Material (Sonstiges)"}
|
||||
onChange={props.handleChange(
|
||||
`parts[${props.index}].materialother`
|
||||
)}
|
||||
onBlur={props.handleBlur(
|
||||
`parts[${props.index}].materialother`
|
||||
)}
|
||||
value={
|
||||
props.values.parts[props.index]["materialother"]
|
||||
}
|
||||
label="Material Sonstiges"
|
||||
type="text"
|
||||
/>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
|
||||
<div className="row g-2 mb-3">
|
||||
<h3>Oberfläche</h3>
|
||||
<p>Unsere Teile werden standardmäßig entgratet. </p>
|
||||
<div className="col">
|
||||
<SelectInput
|
||||
isSubmitting={props.isSubmitting}
|
||||
type="radio"
|
||||
// error={props.errors.titel}
|
||||
// touched={props.touched.titel}
|
||||
placeholder={"Oberfläche"}
|
||||
onChange={props.handleChange(
|
||||
`parts[${props.index}].finish`
|
||||
)}
|
||||
onBlur={props.handleBlur(
|
||||
`parts[${props.index}].finish`
|
||||
)}
|
||||
value={props.values.parts[props.index]["finish"]}
|
||||
label="Material"
|
||||
options={[
|
||||
"2B matt",
|
||||
"Oszillationsschliff",
|
||||
"Gerader Schliff",
|
||||
"K240 Schliff",
|
||||
"Sonstiges",
|
||||
]}
|
||||
/>
|
||||
</div>
|
||||
{props.values.parts[props.index]["finish"] ==
|
||||
"Sonstiges" && (
|
||||
<div className="col">
|
||||
<TextInput
|
||||
isSubmitting={props.isSubmitting}
|
||||
// error={props.errors.parts[props.index]["finishother"]}
|
||||
// touched={props.touched.parts[props.index]["finishother"]}
|
||||
placeholder={"Oberfläche (Sonstiges)"}
|
||||
onChange={props.handleChange(
|
||||
`parts[${props.index}].finishother`
|
||||
)}
|
||||
onBlur={props.handleBlur(
|
||||
`parts[${props.index}].finishother`
|
||||
)}
|
||||
value={props.values.parts[props.index]["finishother"]}
|
||||
label="Oberfläche Sonstiges"
|
||||
type="text"
|
||||
/>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
|
||||
<div className="row g-2 mb-3">
|
||||
<h3>Gravur</h3>
|
||||
<p>Unsere Teile werden standardmäßig entgratet. </p>
|
||||
<div className="col">
|
||||
<CheckInput
|
||||
isSubmitting={props.isSubmitting}
|
||||
// error={props.errors.diffrentshipping}
|
||||
// touched={props.touched.diffrentshipping}
|
||||
onChange={props.handleChange(
|
||||
`parts[${props.index}].engraving`
|
||||
)}
|
||||
onBlur={props.handleBlur(
|
||||
`parts[${props.index}].engraving`
|
||||
)}
|
||||
value={props.values.parts[props.index]["engraving"]}
|
||||
label=" Dieses Teil soll lasergraviert werden"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div className="col">
|
||||
<div className="row g-2 mb-3">
|
||||
<h3>Dateien</h3>
|
||||
<p>
|
||||
Bite fügen Sie alle Dateien in gängigen Formaten (.step,
|
||||
.pdf) hinzu, die wir für die Produktion benötigen. Die
|
||||
Produktionsdateien müssen im Maßststab 1:1 sein.
|
||||
</p>
|
||||
{props.values.parts[props.index]["engraving"] === true && (
|
||||
<p>
|
||||
Zum lasergravieren benötigen wir eine seperate Vektor
|
||||
Datei (.dwg, .dxf) im Maßstab 1:1, welche nur die zu
|
||||
gravierenden Formen enthält. Schriften müssen in Pfade
|
||||
umgewandelt werden!
|
||||
</p>
|
||||
)}
|
||||
<div className="col">
|
||||
<Dropzone
|
||||
files={props.values.parts[props.index]["files"]}
|
||||
setFieldValue={props.setFieldValue}
|
||||
index={props.index}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div className="modal-footer">
|
||||
<button
|
||||
type="button"
|
||||
className="btn btn-primary"
|
||||
onClick={props.handleHide}
|
||||
>
|
||||
Schließen
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
import React from "react";
|
||||
import { TextInput, TextareaInput, SelectInput } from "../formfields.jsx";
|
||||
|
||||
export default function Summary(props) {
|
||||
return (
|
||||
<>
|
||||
<h1>Übersicht</h1>
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -51,11 +51,6 @@ class Navbar extends React.Component {
|
||||
name: "Kontakt",
|
||||
link: "/kontakt",
|
||||
},
|
||||
{
|
||||
key: 6,
|
||||
name: "eAnfrage",
|
||||
link: "/eanfrage",
|
||||
},
|
||||
],
|
||||
submenuServices: [
|
||||
{
|
||||
|
||||
@@ -1,34 +1,16 @@
|
||||
const path = require("path");
|
||||
const withPlugins = require("next-compose-plugins");
|
||||
const optimizedImages = require("next-optimized-images");
|
||||
|
||||
module.exports = withPlugins([
|
||||
[
|
||||
optimizedImages,
|
||||
{
|
||||
mozjpeg: {
|
||||
quality: 70,
|
||||
},
|
||||
svgo: {
|
||||
plugins: [{ removeComments: false }],
|
||||
},
|
||||
},
|
||||
],
|
||||
{
|
||||
sassOptions: {
|
||||
includePaths: [path.join(__dirname, "styles")],
|
||||
},
|
||||
async rewrites() {
|
||||
module.exports = {
|
||||
async redirects() {
|
||||
return [
|
||||
{
|
||||
source: "/fertigungsverfahren",
|
||||
destination: "/fertigungsverfahren/laserteile",
|
||||
permanent: true
|
||||
},
|
||||
{
|
||||
source: "/qualitaet",
|
||||
destination: "/qualitaet/auszeichnungen",
|
||||
permanent: true
|
||||
},
|
||||
];
|
||||
]
|
||||
},
|
||||
},
|
||||
]);
|
||||
}
|
||||
Binary file not shown.
7030
package-lock.json
generated
Normal file
7030
package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
48
package.json
48
package.json
@@ -6,39 +6,27 @@
|
||||
"dev": "next dev",
|
||||
"start": "next start -p 3001",
|
||||
"build": "NODE_ENV=production next build",
|
||||
"update": "ncu -u && yarn install",
|
||||
"deploy": "git pull && yarn install && yarn build && pm2 restart 0"
|
||||
"lint": "next lint"
|
||||
},
|
||||
"dependencies": {
|
||||
"@fortawesome/fontawesome-svg-core": "^1.2.35",
|
||||
"@fortawesome/free-solid-svg-icons": "^5.15.3",
|
||||
"@fortawesome/react-fontawesome": "^0.1.14",
|
||||
"@fullhuman/postcss-purgecss": "^4.0.3",
|
||||
"@react-google-maps/api": "^2.1.1",
|
||||
"axios": "^0.21.1",
|
||||
"babel-plugin-styled-components": "^1.12.0",
|
||||
"bootstrap": "^5.0.0-beta2",
|
||||
"bootstrap-icons": "^1.4.0",
|
||||
"classnames": "^2.2.6",
|
||||
"formik": "^2.2.6",
|
||||
"gsap": "file:./node_addons/gsap-bonus.tgz",
|
||||
"imagemin-mozjpeg": "^9.0.0",
|
||||
"imagemin-svgo": "^9.0.0",
|
||||
"next": "10.0.9",
|
||||
"next-compose-plugins": "^2.2.1",
|
||||
"next-optimized-images": "^2.6.2",
|
||||
"nodemailer": "^6.5.0",
|
||||
"postcss": "^8.2.8",
|
||||
"postcss-flexbugs-fixes": "^5.0.2",
|
||||
"postcss-preset-env": "^6.7.0",
|
||||
"@react-google-maps/api": "^2.7.0",
|
||||
"axios": "^0.26.0",
|
||||
"bootstrap": "^5.1.3",
|
||||
"formik": "^2.2.9",
|
||||
"gsap": "npm:@gsap/shockingly@^3.9.1",
|
||||
"next": "12.0.10",
|
||||
"nodemailer": "^6.7.2",
|
||||
"react": "17.0.2",
|
||||
"react-dom": "17.0.2",
|
||||
"react-dropzone": "^11.3.2",
|
||||
"react-svg": "^12.1.0",
|
||||
"react-transition-group": "^4.4.1",
|
||||
"sass": "^1.32.8",
|
||||
"styled-components": "^5.2.1",
|
||||
"webpack": "^5.28.0",
|
||||
"yup": "^0.32.9"
|
||||
"react-dropzone": "^12.0.4",
|
||||
"react-svg": "^14.1.11",
|
||||
"react-transition-group": "^4.4.2",
|
||||
"sass": "^1.49.7",
|
||||
"sharp": "^0.30.1",
|
||||
"yup": "^0.32.11"
|
||||
},
|
||||
"devDependencies": {
|
||||
"eslint": "8.9.0",
|
||||
"eslint-config-next": "12.0.10"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import App, { Container } from "next/app";
|
||||
import Router from "next/router";
|
||||
import Script from 'next/script'
|
||||
import Head from "next/head";
|
||||
|
||||
import { gsap } from "gsap/dist/gsap";
|
||||
@@ -204,20 +204,19 @@ export default class Site extends App {
|
||||
</SwitchTransition>
|
||||
<Footer />
|
||||
|
||||
<script
|
||||
async
|
||||
<Script
|
||||
src="https://www.googletagmanager.com/gtag/js?id=G-504FPVG74X"
|
||||
></script>
|
||||
<script
|
||||
dangerouslySetInnerHTML={{
|
||||
__html: `
|
||||
window.dataLayer = window.dataLayer || [];
|
||||
function gtag(){dataLayer.push(arguments);}
|
||||
gtag('js', new Date());
|
||||
gtag('config', 'G-504FPVG74X');
|
||||
`,
|
||||
}}
|
||||
strategy="afterInteractive"
|
||||
/>
|
||||
<Script id="google-analytics" strategy="afterInteractive">
|
||||
{`
|
||||
window.dataLayer = window.dataLayer || [];
|
||||
function gtag(){window.dataLayer.push(arguments);}
|
||||
gtag('js', new Date());
|
||||
|
||||
gtag('config', 'G-504FPVG74X');
|
||||
`}
|
||||
</Script>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@ const transporter = nodemailer.createTransport({
|
||||
},
|
||||
});
|
||||
|
||||
export default async (req, res) => {
|
||||
let send = async (req, res) => {
|
||||
const {
|
||||
firma,
|
||||
anrede,
|
||||
@@ -89,3 +89,6 @@ const mailer = ({
|
||||
);
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
export default send
|
||||
@@ -1,222 +0,0 @@
|
||||
import React from "react";
|
||||
import { Formik } from "formik";
|
||||
import * as Yup from "yup";
|
||||
import axios from "axios";
|
||||
import Head from "next/head";
|
||||
|
||||
import { EanfrageSchema } from "../components/forms/schemas.jsx";
|
||||
|
||||
import IntroForm from "../components/forms/eanfrageforms/introform.jsx";
|
||||
import ContactPersonForm from "../components/forms/eanfrageforms/contactperson.jsx";
|
||||
import PartForm from "../components/forms/eanfrageforms/partform.jsx";
|
||||
import Summary from "../components/forms/eanfrageforms/summary.jsx";
|
||||
|
||||
export default class Eanfrage extends React.Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
|
||||
this._renderStepContent = this._renderStepContent.bind(this);
|
||||
this._handleForward = this._handleForward.bind(this);
|
||||
this._handleBackwards = this._handleBackwards.bind(this);
|
||||
|
||||
this.state = {
|
||||
rescode: null,
|
||||
statustext: null,
|
||||
activeStep: 0,
|
||||
disabled: false,
|
||||
};
|
||||
}
|
||||
|
||||
_renderStepContent(
|
||||
step,
|
||||
values,
|
||||
isSubmitting,
|
||||
handleChange,
|
||||
handleBlur,
|
||||
touched,
|
||||
errors,
|
||||
setFieldValue
|
||||
) {
|
||||
switch (step) {
|
||||
case 0:
|
||||
return <IntroForm />;
|
||||
case 1:
|
||||
return (
|
||||
<ContactPersonForm
|
||||
values={values}
|
||||
isSubmitting={isSubmitting}
|
||||
handleChange={handleChange}
|
||||
handleBlur={handleBlur}
|
||||
touched={touched}
|
||||
errors={errors}
|
||||
disabled={this.state.disabled}
|
||||
/>
|
||||
);
|
||||
case 2:
|
||||
return (
|
||||
<PartForm
|
||||
values={values}
|
||||
isSubmitting={isSubmitting}
|
||||
handleChange={handleChange}
|
||||
handleBlur={handleBlur}
|
||||
touched={touched}
|
||||
errors={errors}
|
||||
disabled={this.state.disabled}
|
||||
setFieldValue={setFieldValue}
|
||||
/>
|
||||
);
|
||||
case 3:
|
||||
return <Summary values={values} />;
|
||||
default:
|
||||
return <div>Not Found</div>;
|
||||
}
|
||||
}
|
||||
|
||||
_handleForward() {
|
||||
this.setState({
|
||||
activeStep: this.state.activeStep + 1,
|
||||
});
|
||||
}
|
||||
|
||||
_handleBackwards() {
|
||||
this.setState({
|
||||
activeStep: this.state.activeStep - 1,
|
||||
});
|
||||
}
|
||||
|
||||
render() {
|
||||
return (
|
||||
<>
|
||||
<Head>
|
||||
<meta
|
||||
name="description"
|
||||
content="Die Hans Prothmann GmbH ist Ihr Experte für Blechverarbeitung in München. Professionelles Laserschneiden, Stanzen, Biegen und Gravieren in München."
|
||||
/>
|
||||
<meta
|
||||
name="keywords"
|
||||
content="Blechverarbeitung München, Blechverarbeitung Gröbenzell, Laserteile, Biegeteile, Stanzteile"
|
||||
/>
|
||||
<meta name="robots" content="index, follow" />
|
||||
<title>eAnfrage - Prothmann GmbH</title>
|
||||
</Head>
|
||||
<div className="container background-image landing-img d-flex align-items-center minh-100vh navbar-spacing mb-5">
|
||||
<div className="col text-center">
|
||||
<Formik
|
||||
validationSchema={EanfrageSchema}
|
||||
initialValues={{
|
||||
firma: "",
|
||||
anrede: "",
|
||||
titel: "",
|
||||
vorname: "",
|
||||
nachname: "",
|
||||
email: "",
|
||||
telefon: "",
|
||||
invoiceadress: "",
|
||||
invoiceplz: "",
|
||||
diffrentshipping: false,
|
||||
shippingaddress: "",
|
||||
shippingplz: "",
|
||||
parts: [
|
||||
{
|
||||
name: "Teststeil",
|
||||
description: "Dies ist eine total tolle Bschreibung",
|
||||
material: "Sonstiges",
|
||||
materialother: "Kupfer Beryllium",
|
||||
finish: "Sonstiges",
|
||||
finishother: "DLC",
|
||||
amount: "1000",
|
||||
files: [],
|
||||
engraving: true,
|
||||
comment:
|
||||
"Dies hier sind zusätzliche Produktionsanweisungen",
|
||||
},
|
||||
],
|
||||
consent: true,
|
||||
}}
|
||||
onSubmit={async (values, errors) => {
|
||||
console.log(values, errors);
|
||||
// const data = values;
|
||||
// try {
|
||||
// const res = await axios({
|
||||
// method: "post",
|
||||
// url: "/api/contactsend",
|
||||
// headers: {
|
||||
// "Content-Type": "application/json",
|
||||
// },
|
||||
// data,
|
||||
// });
|
||||
// this.setState({
|
||||
// status: "Ihre Nachricht wurde erfolgreich versendet",
|
||||
// res: res.status,
|
||||
// });
|
||||
// } catch (error) {
|
||||
// this.setState({
|
||||
// status:
|
||||
// "Beim versenden ist ein Fehler aufgetreten! Bitte versuchen Sie es in einigen Minuten noch einmal oder schicken Sie und direkt eine e-Mail.",
|
||||
// res: res.status,
|
||||
// });
|
||||
// }
|
||||
}}
|
||||
>
|
||||
{({
|
||||
values,
|
||||
errors,
|
||||
touched,
|
||||
handleChange,
|
||||
handleBlur,
|
||||
handleSubmit,
|
||||
isSubmitting,
|
||||
setFieldValue,
|
||||
}) => (
|
||||
<form onSubmit={handleSubmit} className="description">
|
||||
{this._renderStepContent(
|
||||
this.state.activeStep,
|
||||
values,
|
||||
isSubmitting,
|
||||
handleChange,
|
||||
handleBlur,
|
||||
touched,
|
||||
errors,
|
||||
setFieldValue
|
||||
)}
|
||||
|
||||
<div className="d-flex flex-row justify-content-between">
|
||||
<button
|
||||
type="button"
|
||||
className={`btn btn-dark ${
|
||||
this.state.activeStep <= 0 ? "disabled" : ""
|
||||
}`}
|
||||
onClick={this._handleBackwards}
|
||||
>
|
||||
Zurück
|
||||
</button>
|
||||
|
||||
{this.state.activeStep !== 3 ? (
|
||||
<button
|
||||
type="button"
|
||||
className={`btn btn-primary`}
|
||||
onClick={this._handleForward}
|
||||
>
|
||||
Weiter
|
||||
</button>
|
||||
) : (
|
||||
<button
|
||||
type="button"
|
||||
className={`btn btn-success ${
|
||||
values.consent === false ? "disabled" : ""
|
||||
}`}
|
||||
onClick={handleSubmit}
|
||||
>
|
||||
Abschicken
|
||||
</button>
|
||||
)}
|
||||
</div>
|
||||
</form>
|
||||
)}
|
||||
</Formik>
|
||||
</div>
|
||||
</div>
|
||||
</>
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -60,7 +60,7 @@ export default function Impressum(props) {
|
||||
<p>
|
||||
Unsere Maschinen von Amada
|
||||
<br />
|
||||
<a href="http://www.amada.de/" target="_blank">
|
||||
<a href="http://www.amada.de/" target="_blank" rel="noreferrer">
|
||||
www.amada.de
|
||||
</a>
|
||||
<br />
|
||||
@@ -70,6 +70,7 @@ export default function Impressum(props) {
|
||||
<a
|
||||
href="http://www.amada.co.jp/fair/eng/awards/27th/tatech01.html"
|
||||
target="_blank"
|
||||
rel="noreferrer"
|
||||
>
|
||||
www.amada.co.jp
|
||||
</a>
|
||||
@@ -80,6 +81,7 @@ export default function Impressum(props) {
|
||||
<a
|
||||
href="http://www.fachverband-metall-bayern.de/"
|
||||
target="_blank"
|
||||
rel="noreferrer"
|
||||
>
|
||||
www.fachverband-metall-bayern.de
|
||||
</a>
|
||||
@@ -87,7 +89,7 @@ export default function Impressum(props) {
|
||||
<br />
|
||||
Unsere Website von CAnetzberger Design
|
||||
<br />
|
||||
<a href="https://www.canetzberger.design" target="_blank">
|
||||
<a href="https://www.canetzberger.design" target="_blank" rel="noreferrer">
|
||||
www.canetzberger.design
|
||||
</a>
|
||||
</p>
|
||||
|
||||
@@ -4,7 +4,6 @@ import Link from "next/link";
|
||||
import Image from "next/image";
|
||||
import { gsap } from "gsap/dist/gsap";
|
||||
import { ScrollTrigger } from "gsap/dist/ScrollTrigger.js";
|
||||
import { ReactSVG } from "react-svg";
|
||||
|
||||
import ProductContainer from "../components/productscontainer.jsx";
|
||||
|
||||
|
||||
@@ -1,28 +0,0 @@
|
||||
module.exports = {
|
||||
plugins: [
|
||||
"postcss-flexbugs-fixes",
|
||||
[
|
||||
"postcss-preset-env",
|
||||
{
|
||||
autoprefixer: {
|
||||
flexbox: "no-2009",
|
||||
},
|
||||
stage: 3,
|
||||
features: {
|
||||
"custom-properties": false,
|
||||
},
|
||||
},
|
||||
],
|
||||
[
|
||||
"@fullhuman/postcss-purgecss",
|
||||
{
|
||||
content: [
|
||||
"./pages/**/*.{js,jsx,ts,tsx}",
|
||||
"./components/**/*.{js,jsx,ts,tsx}",
|
||||
],
|
||||
defaultExtractor: (content) => content.match(/[\w-/:]+(?<!:)/g) || [],
|
||||
safelist: ["html", "body"],
|
||||
},
|
||||
],
|
||||
],
|
||||
};
|
||||
Reference in New Issue
Block a user