diff --git a/components/App.tsx b/components/App.tsx index e48cf0e..0f5e3da 100644 --- a/components/App.tsx +++ b/components/App.tsx @@ -11,7 +11,7 @@ import { IDocProps } from '../interfaces/IDocProps' export default function App() { const [options, setOptions] = useState({ - address: 'Max Mustermann\\\\Musterstrasse\\\\12345 Musterstadt', + address: 'Max Mustermann\nMusterstrasse\n12345 Musterstadt', body: 'Inhalt des Briefs', closing: 'Mit freundlichen Grüßen', customer: '', @@ -79,17 +79,17 @@ export default function App() { } return ( -
-
+
+
- -
-
-
+
+
+
+
) diff --git a/components/Button.tsx b/components/Button.tsx index e647bfe..255b8e1 100644 --- a/components/Button.tsx +++ b/components/Button.tsx @@ -2,7 +2,11 @@ import React from 'react' export default function Button({ children, onClick }: { children: React.ReactNode; onClick: () => void }) { return ( - ) diff --git a/components/Header.tsx b/components/Header.tsx index 6fb7149..7934264 100644 --- a/components/Header.tsx +++ b/components/Header.tsx @@ -2,8 +2,8 @@ import React from 'react' export default function Header() { return ( -
-

PDFer

+
+

PDFer

) } diff --git a/components/Input.tsx b/components/Input.tsx index e9efa6b..0a1632e 100644 --- a/components/Input.tsx +++ b/components/Input.tsx @@ -14,15 +14,20 @@ export default function Input({ onchange: (name: string, event: ChangeEvent<{ value: string }>) => void }) { return ( - +
+ +
+ +
+
) } diff --git a/components/Layout.tsx b/components/Layout.tsx index 90a43b3..a3dca81 100644 --- a/components/Layout.tsx +++ b/components/Layout.tsx @@ -4,9 +4,9 @@ import Header from './Header' export default function Layout({ children }: { children: React.ReactNode }) { return ( -
+
-
{children}
+
{children}
) } diff --git a/components/LetterOptions.tsx b/components/LetterOptions.tsx index fc68fa4..c7b6a63 100644 --- a/components/LetterOptions.tsx +++ b/components/LetterOptions.tsx @@ -35,7 +35,7 @@ export default function LetterOptions(props: IProps) { ] return ( -
+
+ @@ -77,13 +85,6 @@ export default function LetterOptions(props: IProps) { /> -
) } diff --git a/components/Select.tsx b/components/Select.tsx index 5ff8e84..48b0ea4 100644 --- a/components/Select.tsx +++ b/components/Select.tsx @@ -14,15 +14,22 @@ export default function Select({ options: { name: string; value: string }[] }) { return ( - +
) } diff --git a/components/TextAreaInput.tsx b/components/TextAreaInput.tsx index 2f07bfc..448082d 100644 --- a/components/TextAreaInput.tsx +++ b/components/TextAreaInput.tsx @@ -6,17 +6,31 @@ export default function TextAreaInput({ placeholder, onchange, value, + styles = '', }: { text: string name: string placeholder: string onchange: (name: string, event: ChangeEvent<{ value: string }>) => void value: string + styles?: string }) { return ( -
+
) } diff --git a/package-lock.json b/package-lock.json index f3b6610..625e265 100644 --- a/package-lock.json +++ b/package-lock.json @@ -307,6 +307,14 @@ "resolved": "https://registry.npmjs.org/@opentelemetry/context-base/-/context-base-0.14.0.tgz", "integrity": "sha512-sDOAZcYwynHFTbLo6n8kIbLiVF3a3BLkrmehJUyEbT9F+Smbi47kLGS2gG2g0fjBLR/Lr1InPD7kXL7FaTqEkw==" }, + "@tailwindcss/forms": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/@tailwindcss/forms/-/forms-0.2.1.tgz", + "integrity": "sha512-czfvEdY+J2Ogfd6RUSr/ZSUmDxTujr34M++YLnp2cCPC3oJ4kFvFMaRXA6cEXKw7F1hJuapdjXRjsXIEXGgORg==", + "requires": { + "mini-svg-data-uri": "^1.2.3" + } + }, "@types/istanbul-lib-coverage": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.3.tgz", @@ -1800,6 +1808,11 @@ "integrity": "sha512-wXqjST+SLt7R009ySCglWBCFpjUygmCIfD790/kVbiGmUgfYGuB14PiTd5DwVxSV4NcYHjzMkoj5LjQZwTQLEA==", "optional": true }, + "mini-svg-data-uri": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/mini-svg-data-uri/-/mini-svg-data-uri-1.2.3.tgz", + "integrity": "sha512-zd6KCAyXgmq6FV1mR10oKXYtvmA9vRoB6xPSTUJTbFApCtkefDnYueVR1gkof3KcdLZo1Y8mjF2DFmQMIxsHNQ==" + }, "minimalistic-assert": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz", diff --git a/package.json b/package.json index dc91553..ec6f335 100644 --- a/package.json +++ b/package.json @@ -9,6 +9,7 @@ "format": "prettier --write **/*.{ts,tsx,json}" }, "dependencies": { + "@tailwindcss/forms": "^0.2.1", "@types/jest": "^26.0.20", "autoprefixer": "^10.2.4", "json-fs-store": "^1.0.1", diff --git a/pages/_app.tsx b/pages/_app.tsx index 5d47bbb..a9fcc9c 100644 --- a/pages/_app.tsx +++ b/pages/_app.tsx @@ -1,24 +1,9 @@ -// import App from "next/app"; -import type { AppProps /*, AppContext */ } from 'next/app' +import type { AppProps } from 'next/app' import '../styles/index.css' -import '../styles/App.css' -import '../styles/LetterOptions.css' function MyApp({ Component, pageProps }: AppProps) { return } -// Only uncomment this method if you have blocking data requirements for -// every single page in your application. This disables the ability to -// perform automatic static optimization, causing every page in your app to -// be server-side rendered. -// -// MyApp.getInitialProps = async (appContext: AppContext) => { -// // calls page's `getInitialProps` and fills `appProps.pageProps` -// const appProps = await App.getInitialProps(appContext); - -// return { ...appProps } -// } - export default MyApp diff --git a/styles/App.css b/styles/App.css deleted file mode 100644 index 20ea66e..0000000 --- a/styles/App.css +++ /dev/null @@ -1,17 +0,0 @@ -header h1 { - margin-left: 12px; -} - -.p-button { - margin-top: 12px; - margin-right: 12px; - margin-bottom: 12px; -} - -.home { - display: flex; -} - -.home > div { - padding: 12px; -} diff --git a/styles/LetterOptions.css b/styles/LetterOptions.css deleted file mode 100644 index 81d58e3..0000000 --- a/styles/LetterOptions.css +++ /dev/null @@ -1,61 +0,0 @@ -.letter-options { - width: 320px; -} - -.letter-options label { - display: block; - color: #333; - font-size: 14px; - font-weight: bold; -} -.letter-options input, -.letter-options textarea, -.letter-options select { - margin-top: 3px; - margin-bottom: 12px; - width: 100%; -} - -.letter-options textarea { - resize: vertical; -} - -.letter-options textarea.address { - height: 80px; -} - -.letter-options textarea.body { - height: 340px; -} - -.letter-options .Collapsible { - background-color: #ddd; - border-radius: 2px; -} - -.letter-options .Collapsible__trigger { - padding-left: 6px; - cursor: pointer; - line-height: 24px; - font-size: 14px; - font-weight: bold; -} - -.letter-options .Collapsible__trigger.is-closed:before { - content: "> "; -} - -.letter-options .Collapsible__trigger.is-open:before { - content: "< "; -} - -.letter-options .Collapsible { - margin-bottom: 12px; -} - -.letter-options .Collapsible__contentInner { - background-color: #fff; - padding-top: 12px; - padding-left: 12px; -} - diff --git a/styles/index.css b/styles/index.css index b5c61c9..fae772b 100644 --- a/styles/index.css +++ b/styles/index.css @@ -1,3 +1,34 @@ @tailwind base; @tailwind components; @tailwind utilities; + +.Collapsible { + background-color: #ddd; + border-radius: 2px; +} + +.Collapsible__trigger { + padding-left: 6px; + cursor: pointer; + line-height: 24px; + font-size: 14px; + font-weight: bold; +} + +.Collapsible__trigger.is-closed:before { + content: '> '; +} + +.Collapsible__trigger.is-open:before { + content: '< '; +} + +.Collapsible { + margin-bottom: 12px; +} + +.Collapsible__contentInner { + background-color: #fff; + padding-top: 12px; + padding-left: 12px; +} diff --git a/tailwind.config.js b/tailwind.config.js index d7f0874..5531e93 100644 --- a/tailwind.config.js +++ b/tailwind.config.js @@ -7,5 +7,5 @@ module.exports = { variants: { extend: {}, }, - plugins: [], + plugins: [require('@tailwindcss/forms')], }