Skip to content

Commit

Permalink
prettify
Browse files Browse the repository at this point in the history
  • Loading branch information
johnrees committed Jan 21, 2020
1 parent c28c7c7 commit 6690dfe
Show file tree
Hide file tree
Showing 18 changed files with 32 additions and 16 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,11 @@
},
"husky": {
"hooks": {
"pre-commit": "yarn type-check && pretty-quick --staged --pattern 'frontend/**/*.*'"
"pre-commit": "yarn type-check && pretty-quick --staged --pattern 'src/**/*.*'"
}
},
"lint-staged": {
"*.{js,jsx,ts,tsx,html,md}": [
"*.{js,jsx,ts,tsx,html,md,css,scss}": [
"prettier --write",
"git add"
]
Expand Down
4 changes: 3 additions & 1 deletion src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
import "./editor.scss";

import React from "react";
import { DndProvider } from "react-dnd";
import HTML5Backend from "react-dnd-html5-backend";
import { useNavigation } from "react-navi";

import Card from "./components/cards/Card";
import Hanger from "./components/Hanger";
import "./editor.scss";
import { api, useStore } from "./lib/store";

const Current = ({ id }) => {
Expand Down
3 changes: 2 additions & 1 deletion src/components/Hanger.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ import classNames from "classnames";
import React from "react";
import { useDrop } from "react-dnd";
import { useNavigation } from "react-navi";
import { api, TYPES } from "../lib/store";

import { TYPES, api } from "../lib/store";

const Hanger = ({ before = null, parent = null, hidden = false }) => {
const navigate = useNavigation();
Expand Down
1 change: 1 addition & 0 deletions src/components/cards/Breadcrumb.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import * as React from "react";
import { useDrop } from "react-dnd";
import { useNavigation } from "react-navi";

// import { moveNode, useStore } from "../../../../../lib/store";
import { TYPES, useStore } from "../../lib/store";

Expand Down
1 change: 1 addition & 0 deletions src/components/cards/Card.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React from "react";

import { TYPES, useStore } from "../../lib/store";
import Portal from "./Portal";
import Statement from "./Statement";
Expand Down
3 changes: 2 additions & 1 deletion src/components/cards/Portal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ import React from "react";
import { useDrag, useDrop } from "react-dnd";
import { LogIn as Share } from "react-feather";
import { useNavigation } from "react-navi";
import { api, TYPES } from "../../lib/store";

import { TYPES, api } from "../../lib/store";
import Hanger from "../Hanger";

const Portal = ({ id, node, parent = null }) => {
Expand Down
3 changes: 2 additions & 1 deletion src/components/cards/Statement.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ import classNames from "classnames";
import React from "react";
import { useDrag } from "react-dnd";
import { useNavigation } from "react-navi";
import { api, TYPES, useStore } from "../../lib/store";

import { TYPES, api, useStore } from "../../lib/store";
import Hanger from "../Hanger";
import Card from "./Card";

Expand Down
3 changes: 2 additions & 1 deletion src/components/forms/PortalForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ import React from "react";
import { AlignLeft as MenuIcon } from "react-feather";
import { Link } from "react-navi";
import { v4 as guid } from "uuid";
import { api, TYPES, useStore } from "../../lib/store";

import { TYPES, api, useStore } from "../../lib/store";
import useForm from "../../lib/useForm";
import FormSection from "./components/FormSection";
import InputField from "./components/InputField";
Expand Down
10 changes: 6 additions & 4 deletions src/components/forms/StatementForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,22 @@ import Modal from "@material-ui/core/Modal";
import difference from "lodash/difference";
import React from "react";
import {
AlignLeft as MenuIcon,
Edit3 as NotesIcon,
X as CloseIcon,
Info as InfoIcon,
AlignLeft as MenuIcon,
MessageSquare as MessageIcon,
X as CloseIcon
Edit3 as NotesIcon
} from "react-feather";
import { Link } from "react-navi";
import { api, TYPES, useStore } from "../../lib/store";

import { TYPES, api, useStore } from "../../lib/store";
import useForm from "../../lib/useForm";
import FormSection from "./components/FormSection";
import InputField from "./components/InputField";
import SelectField from "./components/SelectField";
import flags from "./flags";
import { useStyles } from "./form";

// import removeFor from "../../../lib/removeFor";

type IEditStatement = {
Expand Down
1 change: 1 addition & 0 deletions src/components/forms/components/FormSection.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import Box from "@material-ui/core/Box";
import React from "react";

import { useStyles } from "../form";

export default ({ children, label, icon, ...props }) => {
Expand Down
1 change: 1 addition & 0 deletions src/components/forms/components/InputField.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import InputBase from "@material-ui/core/InputBase";
import React from "react";

import { useStyles } from "../form";

export default ({ ...props }) => {
Expand Down
1 change: 1 addition & 0 deletions src/components/forms/components/SelectField.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import Select from "@material-ui/core/Select";
import React from "react";
import { ChevronDown } from "react-feather";

import { useStyles } from "../form";

export default ({ children, ...props }) => {
Expand Down
1 change: 1 addition & 0 deletions src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import React, { Suspense } from "react";
import ReactDOM from "react-dom";
import { Router, View } from "react-navi";
import HelmetProvider from "react-navi-helmet-async";

import routes from "./routes";
import * as serviceWorker from "./serviceWorker";

Expand Down
2 changes: 1 addition & 1 deletion src/lib/store.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { alg, Graph } from "graphlib";
import { Graph, alg } from "graphlib";
import * as jsondiffpatch from "jsondiffpatch";
import difference from "lodash/difference";
import create from "zustand";
Expand Down
1 change: 1 addition & 0 deletions src/routes/flow.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { compose, mount, route, withView } from "navi";
import * as React from "react";
import { View } from "react-navi";

import App from "../App";
import portalForm from "./portalForm";
import statementForm from "./statementForm";
Expand Down
5 changes: 3 additions & 2 deletions src/routes/portalForm.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
// import { loader } from "graphql.macro";
import { map, mount, route } from "navi";
import * as React from "react";
import { IContext } from ".";

import { EditPortal, NewPortal } from "../components/forms/PortalForm";
import { api, TYPES } from "../lib/store";
import { TYPES, api } from "../lib/store";
import { IContext } from ".";

export default map(async (req, context: any) => {
// const { data } = await context.client.query({
Expand Down
3 changes: 2 additions & 1 deletion src/routes/statementForm.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import { map, mount, route } from "navi";
import * as React from "react";
import { IContext } from ".";

import { EditStatement, NewStatement } from "../components/forms/StatementForm";
import { api } from "../lib/store";
import { IContext } from ".";

export default map(async (req, context) => {
const handleClose = () => {
Expand Down
1 change: 0 additions & 1 deletion tslint.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
"import-name": false,
"jsx-boolean-value": false,
"jsx-no-lambda": false,
"ordered-imports": true,
"variable-name": false
},
"rulesDirectory": []
Expand Down

0 comments on commit 6690dfe

Please sign in to comment.