From f34bab081982a1a7201eba5fea9ad402cbd5b6b7 Mon Sep 17 00:00:00 2001 From: Ivan Li Date: Sun, 4 Apr 2021 16:07:43 +0800 Subject: [PATCH] refactor: move components from src/routes/ to /src/components --- src/components/app.tsx | 4 ++-- .../pipeline-tasks}/project-details.scss | 0 .../pipeline-tasks}/project-details.scss.d.ts | 0 .../pipeline-tasks}/project-details.tsx | 0 src/{routes => components}/pipelines/pipeline-editor.scss | 2 +- .../pipelines/pipeline-editor.scss.d.ts | 0 src/{routes => components}/pipelines/pipeline-editor.tsx | 2 +- src/components/pipelines/pipeline-list.tsx | 8 ++++---- 8 files changed, 8 insertions(+), 8 deletions(-) rename src/{routes/projects => components/pipeline-tasks}/project-details.scss (100%) rename src/{routes/projects => components/pipeline-tasks}/project-details.scss.d.ts (100%) rename src/{routes/projects => components/pipeline-tasks}/project-details.tsx (100%) rename src/{routes => components}/pipelines/pipeline-editor.scss (97%) rename src/{routes => components}/pipelines/pipeline-editor.scss.d.ts (100%) rename src/{routes => components}/pipelines/pipeline-editor.tsx (98%) diff --git a/src/components/app.tsx b/src/components/app.tsx index a61e07b..cc37bd0 100644 --- a/src/components/app.tsx +++ b/src/components/app.tsx @@ -5,9 +5,9 @@ import styles from './app.scss'; import { OverlayContainer } from './commons/overlay/overlay'; import { useObserver } from 'mobx-react'; import Router, { Route } from 'preact-router'; -import { ProjectDetails } from '../routes/projects/project-details'; import { createApolloClient } from '../units/apollo-client'; -import { PipelineEditor } from '../routes/pipelines/pipeline-editor'; +import { ProjectDetails } from './pipeline-tasks/project-details'; +import { PipelineEditor } from './pipelines/pipeline-editor'; const client = createApolloClient(); diff --git a/src/routes/projects/project-details.scss b/src/components/pipeline-tasks/project-details.scss similarity index 100% rename from src/routes/projects/project-details.scss rename to src/components/pipeline-tasks/project-details.scss diff --git a/src/routes/projects/project-details.scss.d.ts b/src/components/pipeline-tasks/project-details.scss.d.ts similarity index 100% rename from src/routes/projects/project-details.scss.d.ts rename to src/components/pipeline-tasks/project-details.scss.d.ts diff --git a/src/routes/projects/project-details.tsx b/src/components/pipeline-tasks/project-details.tsx similarity index 100% rename from src/routes/projects/project-details.tsx rename to src/components/pipeline-tasks/project-details.tsx diff --git a/src/routes/pipelines/pipeline-editor.scss b/src/components/pipelines/pipeline-editor.scss similarity index 97% rename from src/routes/pipelines/pipeline-editor.scss rename to src/components/pipelines/pipeline-editor.scss index a18611f..e20e89d 100644 --- a/src/routes/pipelines/pipeline-editor.scss +++ b/src/components/pipelines/pipeline-editor.scss @@ -3,4 +3,4 @@ .workUnitMetadata { min-height: 16rem; @apply max-h-64; -} \ No newline at end of file +} diff --git a/src/routes/pipelines/pipeline-editor.scss.d.ts b/src/components/pipelines/pipeline-editor.scss.d.ts similarity index 100% rename from src/routes/pipelines/pipeline-editor.scss.d.ts rename to src/components/pipelines/pipeline-editor.scss.d.ts diff --git a/src/routes/pipelines/pipeline-editor.tsx b/src/components/pipelines/pipeline-editor.tsx similarity index 98% rename from src/routes/pipelines/pipeline-editor.tsx rename to src/components/pipelines/pipeline-editor.tsx index 8054c4d..01a6f89 100644 --- a/src/routes/pipelines/pipeline-editor.tsx +++ b/src/components/pipelines/pipeline-editor.tsx @@ -1,4 +1,4 @@ -import { Field, Form, Formik, useFormik } from 'formik'; +import { Field, Form, Formik } from 'formik'; import { h } from 'preact'; import { RoutableProps } from 'preact-router'; import styles from './pipeline-editor.scss'; diff --git a/src/components/pipelines/pipeline-list.tsx b/src/components/pipelines/pipeline-list.tsx index 4ec8f6c..f155c83 100644 --- a/src/components/pipelines/pipeline-list.tsx +++ b/src/components/pipelines/pipeline-list.tsx @@ -1,7 +1,7 @@ import { gql, useQuery, useMutation } from '@apollo/client'; -import { autorun, makeAutoObservable, reaction } from 'mobx'; +import { makeAutoObservable, reaction } from 'mobx'; import { useLocalObservable } from 'mobx-react-lite'; -import { useCallback, useMemo } from 'preact/hooks'; +import { useMemo } from 'preact/hooks'; import { h } from 'preact'; import { Pipeline } from '../../generated/graphql'; import styles from './pipeline-list.scss'; @@ -15,10 +15,10 @@ import { faTrash } from '@fortawesome/free-solid-svg-icons'; import { createOverlay } from '../commons/overlay/overlay'; -import { PipelineEditor } from '../../routes/pipelines/pipeline-editor'; +import { PipelineEditor } from './pipeline-editor'; import { LIST_PIPELINES } from './pipeline-list.constants'; import { Observer, observer } from 'mobx-react'; -import { getCurrentUrl, route } from 'preact-router'; +import { route } from 'preact-router'; const DELETE_PIPELINE = gql` mutation DeletePipeline($id: String!) {