From bf7568fc699befdcc8d471d4b486a7a0ef5c8f4c Mon Sep 17 00:00:00 2001 From: SalmanAd01 Date: Thu, 26 Jan 2023 22:20:33 +0530 Subject: [PATCH] improve dir strcuture --- src/Components/{editor => common/Editor}/Style.css | 0 .../{editor => common/Editor}/common/Input.jsx | 0 .../{editor => common/Editor}/common/Output.jsx | 0 .../{editor => common/Editor}/common/Run.jsx | 2 +- .../Editor}/defaults/extLanguages.js | 0 .../Editor}/defaults/initialState.js | 0 .../Editor}/defaults/languages.js | 0 .../{editor => common/Editor}/defaults/themes.js | 0 .../{editor => common/Editor}/global/index.jsx | 8 ++++---- src/Components/{editor => common/Editor}/index.jsx | 2 +- .../{editor => common/Editor}/menu/index.jsx | 6 +++--- .../drawer/contests/common/SubmitOnProblemPage.jsx | 14 +++++++------- src/Routes.jsx | 2 +- 13 files changed, 17 insertions(+), 17 deletions(-) rename src/Components/{editor => common/Editor}/Style.css (100%) rename src/Components/{editor => common/Editor}/common/Input.jsx (100%) rename src/Components/{editor => common/Editor}/common/Output.jsx (100%) rename src/Components/{editor => common/Editor}/common/Run.jsx (96%) rename src/Components/{editor => common/Editor}/defaults/extLanguages.js (100%) rename src/Components/{editor => common/Editor}/defaults/initialState.js (100%) rename src/Components/{editor => common/Editor}/defaults/languages.js (100%) rename src/Components/{editor => common/Editor}/defaults/themes.js (100%) rename src/Components/{editor => common/Editor}/global/index.jsx (94%) rename src/Components/{editor => common/Editor}/index.jsx (95%) rename src/Components/{editor => common/Editor}/menu/index.jsx (97%) diff --git a/src/Components/editor/Style.css b/src/Components/common/Editor/Style.css similarity index 100% rename from src/Components/editor/Style.css rename to src/Components/common/Editor/Style.css diff --git a/src/Components/editor/common/Input.jsx b/src/Components/common/Editor/common/Input.jsx similarity index 100% rename from src/Components/editor/common/Input.jsx rename to src/Components/common/Editor/common/Input.jsx diff --git a/src/Components/editor/common/Output.jsx b/src/Components/common/Editor/common/Output.jsx similarity index 100% rename from src/Components/editor/common/Output.jsx rename to src/Components/common/Editor/common/Output.jsx diff --git a/src/Components/editor/common/Run.jsx b/src/Components/common/Editor/common/Run.jsx similarity index 96% rename from src/Components/editor/common/Run.jsx rename to src/Components/common/Editor/common/Run.jsx index b7f7a9d1..2e248d13 100644 --- a/src/Components/editor/common/Run.jsx +++ b/src/Components/common/Editor/common/Run.jsx @@ -2,7 +2,7 @@ import React, { useContext } from 'react'; import '../Style.css'; import PropTypes from 'prop-types'; import { Button } from '@material/react-button'; -import AceEditorContext from '../../../Contexts/AceEditorContext'; +import AceEditorContext from '../../../../Contexts/AceEditorContext'; const Run = ({ loading, setLoading, lang, input, setMessageType, setMessage, setOutput }) => { const { editorConfig } = useContext(AceEditorContext); diff --git a/src/Components/editor/defaults/extLanguages.js b/src/Components/common/Editor/defaults/extLanguages.js similarity index 100% rename from src/Components/editor/defaults/extLanguages.js rename to src/Components/common/Editor/defaults/extLanguages.js diff --git a/src/Components/editor/defaults/initialState.js b/src/Components/common/Editor/defaults/initialState.js similarity index 100% rename from src/Components/editor/defaults/initialState.js rename to src/Components/common/Editor/defaults/initialState.js diff --git a/src/Components/editor/defaults/languages.js b/src/Components/common/Editor/defaults/languages.js similarity index 100% rename from src/Components/editor/defaults/languages.js rename to src/Components/common/Editor/defaults/languages.js diff --git a/src/Components/editor/defaults/themes.js b/src/Components/common/Editor/defaults/themes.js similarity index 100% rename from src/Components/editor/defaults/themes.js rename to src/Components/common/Editor/defaults/themes.js diff --git a/src/Components/editor/global/index.jsx b/src/Components/common/Editor/global/index.jsx similarity index 94% rename from src/Components/editor/global/index.jsx rename to src/Components/common/Editor/global/index.jsx index bdb48f01..0e7cb916 100644 --- a/src/Components/editor/global/index.jsx +++ b/src/Components/common/Editor/global/index.jsx @@ -3,13 +3,13 @@ import Select from '@material/react-select'; import { Cell, Row } from '@material/react-layout-grid'; import React, { useState, useEffect } from 'react'; import { useLazyQuery } from '@apollo/client'; -import AceEditorContext from '../../../Contexts/AceEditorContext'; -import { languageOptions } from '../../drawer/contests/status/options'; +import AceEditorContext from '../../../../Contexts/AceEditorContext'; +import { languageOptions } from '../../../drawer/contests/status/options'; import languageDefaults from '../defaults/languages'; import Editor from '../index'; import Menu from '../menu'; -import MessageCard from '../../common/MessageCard'; -import { GET_EDITOR_SHARE } from '../../../graphql/queries'; +import MessageCard from '../../MessageCard'; +import { GET_EDITOR_SHARE } from '../../../../graphql/queries'; import Run from '../common/Run'; import Input from '../common/Input'; import Output from '../common/Output'; diff --git a/src/Components/editor/index.jsx b/src/Components/common/Editor/index.jsx similarity index 95% rename from src/Components/editor/index.jsx rename to src/Components/common/Editor/index.jsx index e58494dd..a6342d63 100644 --- a/src/Components/editor/index.jsx +++ b/src/Components/common/Editor/index.jsx @@ -9,7 +9,7 @@ import 'ace-builds/src-noconflict/theme-github'; import 'ace-builds/src-noconflict/ext-language_tools'; import optionToextLanguages from './defaults/extLanguages'; -import AceEditorContext from '../../Contexts/AceEditorContext'; +import AceEditorContext from '../../../Contexts/AceEditorContext'; const Editor = () => { const { editorConfig, setEditorConfig } = useContext(AceEditorContext); diff --git a/src/Components/editor/menu/index.jsx b/src/Components/common/Editor/menu/index.jsx similarity index 97% rename from src/Components/editor/menu/index.jsx rename to src/Components/common/Editor/menu/index.jsx index 42fda2e9..22ade20e 100644 --- a/src/Components/editor/menu/index.jsx +++ b/src/Components/common/Editor/menu/index.jsx @@ -17,9 +17,9 @@ import MaterialIcon from '@material/react-material-icon'; import * as ace from 'ace-builds/src-noconflict/ace'; import { useApolloClient } from '@apollo/client'; import themes from '../defaults/themes'; -import AceEditorContext from '../../../Contexts/AceEditorContext'; -import { SAVE_CODE } from '../../../graphql/mutations'; -import MessageCard from '../../common/MessageCard'; +import AceEditorContext from '../../../../Contexts/AceEditorContext'; +import { SAVE_CODE } from '../../../../graphql/mutations'; +import MessageCard from '../../MessageCard'; import '../Style.css'; ace.config.set('basePath', '/assets/ui/'); diff --git a/src/Components/drawer/contests/common/SubmitOnProblemPage.jsx b/src/Components/drawer/contests/common/SubmitOnProblemPage.jsx index 2c5f61a2..5dfc9ab6 100644 --- a/src/Components/drawer/contests/common/SubmitOnProblemPage.jsx +++ b/src/Components/drawer/contests/common/SubmitOnProblemPage.jsx @@ -12,17 +12,17 @@ import { languageOptions } from '../status/options'; import Uploading from '../submit/Uploading'; import useSessionExpired from '../../../../customHooks/useSessionExpired'; import AceEditorContext from '../../../../Contexts/AceEditorContext'; -import Menu from '../../../editor/menu'; -import Editor from '../../../editor'; -import languageDefaults from '../../../editor/defaults/languages'; +import Menu from '../../../common/Editor/menu'; +import Editor from '../../../common/Editor'; +import languageDefaults from '../../../common/Editor/defaults/languages'; import { GET_CONTEST_DASHBOARD } from '../../../../graphql/queries'; import Spinner from '../../../common/Spinner'; import SomethingWentWrong from '../../../common/SomethingWentWrong'; -import Run from '../../../editor/common/Run'; -import Input from '../../../editor/common/Input'; -import Output from '../../../editor/common/Output'; +import Run from '../../../common/Editor/common/Run'; +import Input from '../../../common/Editor/common/Input'; +import Output from '../../../common/Editor/common/Output'; import './Style.css'; -import initialState from '../../../editor/defaults/initialState'; +import initialState from '../../../common/Editor/defaults/initialState'; const SubmitOnProblemPage = ({ setEditorOpen }) => { const isMobile = window.innerWidth <= 768; diff --git a/src/Routes.jsx b/src/Routes.jsx index 835e7ecd..4bd6da24 100755 --- a/src/Routes.jsx +++ b/src/Routes.jsx @@ -98,7 +98,7 @@ const SuperuserAnnouncementsContainer = lazy(() => ); const SuperuserManage = lazy(() => import('./Components/superuser/manageSuperusers/index')); const PageNotFound = lazy(() => import('./Components/common/PageNotFound/index')); -const Editor = lazy(() => import('./Components/editor/global/index')); +const Editor = lazy(() => import('./Components/common/Editor/global/index')); const Routes = () => { const path = window.location.pathname; const { loading, error, data } = useQuery(GET_LOGGED_IN_USER);