From 1bfaabcccbf40b179ad7857135911f4330f3b28a Mon Sep 17 00:00:00 2001 From: BRAVO68WEB Date: Mon, 31 Jan 2022 23:04:21 +0530 Subject: [PATCH] Last Minute Conf --- frontend/.prettierignore | 1 + frontend/.prettierrc | 5 ++ frontend/next.config.js | 2 +- frontend/package.json | 67 +++++++++--------- frontend/pages/_app.js | 2 +- frontend/pages/api/hello.js | 2 +- frontend/pages/index.js | 56 +++++++-------- frontend/styles/Home.module.css | 122 ++++++++++++++++---------------- frontend/styles/globals.css | 14 ++-- frontend/yarn.lock | 5 ++ 10 files changed, 145 insertions(+), 131 deletions(-) create mode 100644 frontend/.prettierignore create mode 100644 frontend/.prettierrc diff --git a/frontend/.prettierignore b/frontend/.prettierignore new file mode 100644 index 0000000..d0d878e --- /dev/null +++ b/frontend/.prettierignore @@ -0,0 +1 @@ +.next \ No newline at end of file diff --git a/frontend/.prettierrc b/frontend/.prettierrc new file mode 100644 index 0000000..8addc20 --- /dev/null +++ b/frontend/.prettierrc @@ -0,0 +1,5 @@ +{ + "tabWidth": 3, + "semi": false, + "singleQuote": true +} diff --git a/frontend/next.config.js b/frontend/next.config.js index 0d60710..11731aa 100644 --- a/frontend/next.config.js +++ b/frontend/next.config.js @@ -1,3 +1,3 @@ module.exports = { - reactStrictMode: true, + reactStrictMode: true, } diff --git a/frontend/package.json b/frontend/package.json index 0d617f1..0ad9a08 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -1,34 +1,37 @@ { - "name": "url-minify", - "private": true, - "scripts": { - "dev": "next dev", - "build": "next build", - "start": "next start", - "lint": "next lint" - }, - "dependencies": { - "next": "12.0.9", - "react": "17.0.2", - "react-dom": "17.0.2" - }, - "license": "MIT", - "repository": { - "type": "git", - "url": "git+https://github.com/bravo68web/url-minify.git" - }, - "keywords": [ - "url-minify", - "short-link", - "generator", - "nextjs", - "frontend", - "api", - "rest" - ], - "author": "BRAVO68WEB", - "bugs": { - "url": "https://github.com/bravo68web/url-minify/issues" - }, - "homepage": "https://github.com/bravo68web/url-minify#readme" + "name": "url-minify", + "private": true, + "scripts": { + "dev": "next dev", + "build": "next build", + "start": "next start", + "prettier": "prettier --write ." + }, + "dependencies": { + "next": "12.0.9", + "react": "17.0.2", + "react-dom": "17.0.2" + }, + "license": "MIT", + "repository": { + "type": "git", + "url": "git+https://github.com/bravo68web/url-minify.git" + }, + "keywords": [ + "url-minify", + "short-link", + "generator", + "nextjs", + "frontend", + "api", + "rest" + ], + "author": "BRAVO68WEB", + "bugs": { + "url": "https://github.com/bravo68web/url-minify/issues" + }, + "homepage": "https://github.com/bravo68web/url-minify#readme", + "devDependencies": { + "prettier": "2.5.1" + } } diff --git a/frontend/pages/_app.js b/frontend/pages/_app.js index 1e1cec9..93ac0b7 100644 --- a/frontend/pages/_app.js +++ b/frontend/pages/_app.js @@ -1,7 +1,7 @@ import '../styles/globals.css' function MyApp({ Component, pageProps }) { - return + return } export default MyApp diff --git a/frontend/pages/api/hello.js b/frontend/pages/api/hello.js index df63de8..3d6a034 100644 --- a/frontend/pages/api/hello.js +++ b/frontend/pages/api/hello.js @@ -1,5 +1,5 @@ // Next.js API route support: https://nextjs.org/docs/api-routes/introduction export default function handler(req, res) { - res.status(200).json({ name: 'John Doe' }) + res.status(200).json({ name: 'John Doe' }) } diff --git a/frontend/pages/index.js b/frontend/pages/index.js index 3937dec..82a190a 100644 --- a/frontend/pages/index.js +++ b/frontend/pages/index.js @@ -1,33 +1,33 @@ -import { useState } from "react"; -import Head from "next/head"; -import styles from "../styles/Home.module.css"; +import { useState } from 'react' +import Head from 'next/head' +import styles from '../styles/Home.module.css' export default function Home() { - const [shortUrl, setShortUrl] = useState(null); - const [longURL, setLongURL] = useState(""); - return ( -
- - URL MiniFy - - + const [shortUrl, setShortUrl] = useState(null) + const [longURL, setLongURL] = useState('') + return ( +
+ + URL MiniFy + + -
-

Welcome to URL MiniFy

+
+

Welcome to URL MiniFy

-
-

Paste the URL to be Shortened

-
- setLongURL(evt.target.value)} - /> - -
-
-
-
- ); +
+

Paste the URL to be Shortened

+
+ setLongURL(evt.target.value)} + /> + +
+
+ +
+ ) } diff --git a/frontend/styles/Home.module.css b/frontend/styles/Home.module.css index 32a57d5..bfb5896 100644 --- a/frontend/styles/Home.module.css +++ b/frontend/styles/Home.module.css @@ -1,116 +1,116 @@ .container { - padding: 0 2rem; + padding: 0 2rem; } .main { - min-height: 100vh; - padding: 4rem 0; - flex: 1; - display: flex; - flex-direction: column; - justify-content: center; - align-items: center; + min-height: 100vh; + padding: 4rem 0; + flex: 1; + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; } .footer { - display: flex; - flex: 1; - padding: 2rem 0; - border-top: 1px solid #eaeaea; - justify-content: center; - align-items: center; + display: flex; + flex: 1; + padding: 2rem 0; + border-top: 1px solid #eaeaea; + justify-content: center; + align-items: center; } .footer a { - display: flex; - justify-content: center; - align-items: center; - flex-grow: 1; + display: flex; + justify-content: center; + align-items: center; + flex-grow: 1; } .title a { - color: #0070f3; - text-decoration: none; + color: #0070f3; + text-decoration: none; } .title a:hover, .title a:focus, .title a:active { - text-decoration: underline; + text-decoration: underline; } .title { - margin: 0; - line-height: 1.15; - font-size: 4rem; + margin: 0; + line-height: 1.15; + font-size: 4rem; } .title, .description { - text-align: center; + text-align: center; } .description { - margin: 4rem 0; - line-height: 1.5; - font-size: 1.5rem; + margin: 4rem 0; + line-height: 1.5; + font-size: 1.5rem; } .code { - background: #fafafa; - border-radius: 5px; - padding: 0.75rem; - font-size: 1.1rem; - font-family: Menlo, Monaco, Lucida Console, Liberation Mono, DejaVu Sans Mono, - Bitstream Vera Sans Mono, Courier New, monospace; + background: #fafafa; + border-radius: 5px; + padding: 0.75rem; + font-size: 1.1rem; + font-family: Menlo, Monaco, Lucida Console, Liberation Mono, DejaVu Sans Mono, + Bitstream Vera Sans Mono, Courier New, monospace; } .grid { - display: flex; - align-items: center; - justify-content: center; - flex-wrap: wrap; - max-width: 800px; + display: flex; + align-items: center; + justify-content: center; + flex-wrap: wrap; + max-width: 800px; } .card { - margin: 1rem; - padding: 1.5rem; - text-align: left; - color: inherit; - text-decoration: none; - border: 1px solid #eaeaea; - border-radius: 10px; - transition: color 0.15s ease, border-color 0.15s ease; - max-width: 300px; + margin: 1rem; + padding: 1.5rem; + text-align: left; + color: inherit; + text-decoration: none; + border: 1px solid #eaeaea; + border-radius: 10px; + transition: color 0.15s ease, border-color 0.15s ease; + max-width: 300px; } .card:hover, .card:focus, .card:active { - color: #0070f3; - border-color: #0070f3; + color: #0070f3; + border-color: #0070f3; } .card h2 { - margin: 0 0 1rem 0; - font-size: 1.5rem; + margin: 0 0 1rem 0; + font-size: 1.5rem; } .card p { - margin: 0; - font-size: 1.25rem; - line-height: 1.5; + margin: 0; + font-size: 1.25rem; + line-height: 1.5; } .logo { - height: 1em; - margin-left: 0.5rem; + height: 1em; + margin-left: 0.5rem; } @media (max-width: 600px) { - .grid { - width: 100%; - flex-direction: column; - } + .grid { + width: 100%; + flex-direction: column; + } } diff --git a/frontend/styles/globals.css b/frontend/styles/globals.css index e5e2dcc..cdac500 100644 --- a/frontend/styles/globals.css +++ b/frontend/styles/globals.css @@ -1,16 +1,16 @@ html, body { - padding: 0; - margin: 0; - font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen, - Ubuntu, Cantarell, Fira Sans, Droid Sans, Helvetica Neue, sans-serif; + padding: 0; + margin: 0; + font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen, + Ubuntu, Cantarell, Fira Sans, Droid Sans, Helvetica Neue, sans-serif; } a { - color: inherit; - text-decoration: none; + color: inherit; + text-decoration: none; } * { - box-sizing: border-box; + box-sizing: border-box; } diff --git a/frontend/yarn.lock b/frontend/yarn.lock index 4f2859f..4703bd5 100644 --- a/frontend/yarn.lock +++ b/frontend/yarn.lock @@ -126,6 +126,11 @@ postcss@8.4.5: picocolors "^1.0.0" source-map-js "^1.0.1" +prettier@2.5.1: + version "2.5.1" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.5.1.tgz#fff75fa9d519c54cf0fce328c1017d94546bc56a" + integrity sha512-vBZcPRUR5MZJwoyi3ZoyQlc1rXeEck8KgeC9AwwOn+exuxLxq5toTRDTSaVrXHxelDMHy9zlicw8u66yxoSUFg== + react-dom@17.0.2: version "17.0.2" resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-17.0.2.tgz#ecffb6845e3ad8dbfcdc498f0d0a939736502c23"