diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..7a56b73 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,7 @@ +{ + "editor.codeActionsOnSave": { + "source.fixAll.eslint": true + }, + "editor.formatOnSave": true, + "editor.defaultFormatter": "esbenp.prettier-vscode" + } \ No newline at end of file diff --git a/src/.eslintrc.json b/src/.eslintrc.json index bffb357..4d765f2 100644 --- a/src/.eslintrc.json +++ b/src/.eslintrc.json @@ -1,3 +1,3 @@ { - "extends": "next/core-web-vitals" + "extends": ["next/core-web-vitals", "prettier"] } diff --git a/src/.gitignore b/src/.gitignore index c87c9b3..46f26a8 100644 --- a/src/.gitignore +++ b/src/.gitignore @@ -33,4 +33,4 @@ yarn-error.log* # typescript *.tsbuildinfo -next-env.d.ts +next-env.d.ts \ No newline at end of file diff --git a/src/.prettierrc.json b/src/.prettierrc.json new file mode 100644 index 0000000..123d3e8 --- /dev/null +++ b/src/.prettierrc.json @@ -0,0 +1,7 @@ +{ + "semi": true, + "trailingComma": "es5", + "singleQuote": true, + "tabWidth": 2, + "useTabs": false +} diff --git a/src/README.md b/src/README.md index 99dda1a..fb27022 100644 --- a/src/README.md +++ b/src/README.md @@ -1,11 +1,12 @@ # GraphQL Dashboard ## Development + For development run `yarn dev` and make sure that a backend is running at http://localhost:54321/graphql. Example backends can be found under `/examples.` ## Production + We use next.js as a static site generater. Run `yarn build` to generate the static assets. The backend, which is responsible for authentication and authorization, will serve these static files. - diff --git a/src/assets/caretDown.tsx b/src/assets/caretDown.tsx index f21a4b2..f43a6f0 100644 --- a/src/assets/caretDown.tsx +++ b/src/assets/caretDown.tsx @@ -1,21 +1,21 @@ -function CaretDown(props: any) { - return ( - - ) -} - -export default CaretDown \ No newline at end of file +function CaretDown(props: any) { + return ( + + ); +} + +export default CaretDown; diff --git a/src/components/commandBubble.module.css b/src/components/commandBubble.module.css index a295dc2..788abc1 100644 --- a/src/components/commandBubble.module.css +++ b/src/components/commandBubble.module.css @@ -1,6 +1,6 @@ .openClosedSwitch { - padding: 1.5rem 2ch; - opacity: 0.75; + padding: 1.5rem 2ch; + opacity: 0.75; min-width: 10ch; cursor: pointer; transition: all 0.25s 0s ease-in-out; @@ -27,7 +27,7 @@ } .bubble:hover { - box-shadow: -8px 10px 12px 4px rgba(0, 0, 0, 0.18); + box-shadow: -8px 10px 12px 4px rgba(0, 0, 0, 0.18); transform: scale(1.01); } @@ -45,7 +45,7 @@ opacity: 0.5; } -.title { +.title { flex-grow: 0; margin: 1.5rem; transform: translate(0, 2px); @@ -77,10 +77,10 @@ .bubbleContent { max-height: 0px; transition: max-height 0.5s 0s ease; - overflow: hidden; + overflow: hidden; } .open .bubbleContent { - height: fit-content; + height: fit-content; max-height: 500px; -} \ No newline at end of file +} diff --git a/src/components/commandBubble.tsx b/src/components/commandBubble.tsx index c49a11e..f9a4804 100644 --- a/src/components/commandBubble.tsx +++ b/src/components/commandBubble.tsx @@ -1,10 +1,10 @@ -import { GraphQLArgument } from "graphql"; -import { Maybe } from "graphql/jsutils/Maybe"; -import { useState } from "react"; -import CaretDown from "../assets/caretDown"; -import styles from "./commandBubble.module.css"; -import InputBox from "./inputBox"; -import { argumentsToInputType } from "./inputType"; +import { GraphQLArgument } from 'graphql'; +import { Maybe } from 'graphql/jsutils/Maybe'; +import { useState } from 'react'; +import CaretDown from '../assets/caretDown'; +import styles from './commandBubble.module.css'; +import InputBox from './inputBox'; +import { argumentsToInputType } from './inputType'; type Props = { title: string; @@ -17,12 +17,12 @@ export default function CommandBubble({ title, titleWidthInCh, description, - input + input, }: Props) { let [isOpen, toggleOpen] = useState(false); return ( -