Browse Source

fix paths

Yevheniia Akinshyna 2 years ago
parent
commit
83cd7ecfb8
45 changed files with 74 additions and 40 deletions
  1. 8 0
      jsconfig.json
  2. 0 0
      public/img/code.png
  3. 0 0
      public/img/logo.png
  4. 0 0
      public/img/user.png
  5. 4 2
      src/App.js
  6. 8 2
      src/components/Ava.js
  7. 3 1
      src/components/Editor.js
  8. 5 3
      src/components/EditorsPage.js
  9. 3 2
      src/components/Header.js
  10. 2 2
      src/components/Logo.js
  11. 11 10
      src/components/Routers.js
  12. 3 1
      src/components/UserHeader.js
  13. 1 0
      src/index.js
  14. 3 1
      src/pages/Cabinet.js
  15. 1 0
      src/pages/FormReg.js
  16. 4 2
      src/pages/FormUpload.js
  17. 1 0
      src/pages/LoginForm.js
  18. 5 5
      src/pages/Project.js
  19. 1 2
      src/pages/Projects.js
  20. 5 4
      src/pages/Search.js
  21. 4 3
      src/pages/WorkPage.js
  22. 0 0
      src/store/actions/actionAuthLogin.js
  23. 0 0
      src/store/actions/actionAuthLogout.js
  24. 0 0
      src/store/actions/actionFindUser.js
  25. 0 0
      src/store/actions/actionFullAva.js
  26. 0 0
      src/store/actions/actionFullLogin.js
  27. 0 0
      src/store/actions/actionFullRegister.js
  28. 0 0
      src/store/actions/actionImgFind.js
  29. 0 0
      src/store/actions/actionLogin.js
  30. 0 0
      src/store/actions/actionPending.js
  31. 0 0
      src/store/actions/actionPromise.js
  32. 0 0
      src/store/actions/actionReg.js
  33. 0 0
      src/store/actions/actionRejected.js
  34. 0 0
      src/store/actions/actionResolved.js
  35. 0 0
      src/store/actions/actionSearch.js
  36. 0 0
      src/store/actions/actionSetAva.js
  37. 0 0
      src/store/actions/actionSnippetAdd.js
  38. 0 0
      src/store/actions/actionSnippetById.js
  39. 0 0
      src/store/actions/actionSnippetFindByOwner.js
  40. 0 0
      src/store/actions/actionUploadFile.js
  41. 0 0
      src/store/actions/gql.js
  42. 0 0
      src/store/actions/requests.js
  43. 0 0
      src/store/reducers/auth.js
  44. 2 0
      src/reducers/index.js
  45. 0 0
      src/store/reducers/promise.js

+ 8 - 0
jsconfig.json

@@ -0,0 +1,8 @@
+{
+   "compilerOptions": {
+      "baseUrl": "src"
+   },
+   "include": [
+      "src"
+   ]
+}

src/code.png → public/img/code.png


src/logo.png → public/img/logo.png


src/user.png → public/img/user.png


+ 4 - 2
src/App.js

@@ -1,7 +1,9 @@
 import React from "react";
 import { Provider } from "react-redux";
-import ConnectedRouts from "./components/Routers";
-import store from "./reducers";
+
+import ConnectedRouts from "components/Routers";
+import store from "store/reducers";
+
 import "./App.css";
 
 function App() {

+ 8 - 2
src/components/Ava.js

@@ -1,10 +1,16 @@
 import React from "react";
 import { connect } from "react-redux";
+
 import "./Header.css";
-import icon from "../user.png";
 
 function AvaLogo({ link }) {
-	return <img src={link ? "http://localhost:3000/" + link : icon} className='avatar' alt='ava'></img>;
+	return (
+		<img
+			src={link ? "http://localhost:3000/" + link : `${process.env.PUBLIC_URL}/img/user.png`}
+			className='avatar'
+			alt='ava'
+		></img>
+	);
 }
 
 export const ConnectedAvaLogo = connect(state => ({

+ 3 - 1
src/components/Editor.js

@@ -27,7 +27,9 @@ import "ace-builds/src-noconflict/theme-textmate";
 import "ace-builds/src-noconflict/theme-terminal";
 import "ace-builds/src-noconflict/theme-solarized_dark";
 import "ace-builds/src-noconflict/theme-solarized_light";
-import { SelectMode } from "../helpers/SelectMode";
+
+import { SelectMode } from "helpers/SelectMode";
+
 import "./Editor.css";
 
 export const Editor = ({ data = { type: "", name: "", text: "", index: "" }, onChange, theme, font }) => {

+ 5 - 3
src/components/EditorsPage.js

@@ -1,8 +1,10 @@
 import { useState, useEffect } from "react";
-import { Editor } from "../components/Editor";
-import { SelectTheme } from "../helpers/SelectTheme";
-import { SelectFontSize } from "../helpers/SelectFontSize";
+
+import { SelectTheme } from "helpers/SelectTheme";
+import { SelectFontSize } from "helpers/SelectFontSize";
+
 import "./EditorsPage.css";
+import { Editor } from "./Editor";
 
 const datas = [
 	{

+ 3 - 2
src/components/Header.js

@@ -1,7 +1,8 @@
+import { ConnectFormUpload } from "pages/FormUpload";
+
+import "./Header.css";
 import ImgLogo from "./Logo";
 import ConnectedNick from "./UserHeader";
-import { ConnectFormUpload } from "../pages/FormUpload";
-import "./Header.css";
 
 const Header = () => {
 	return (

+ 2 - 2
src/components/Logo.js

@@ -1,5 +1,5 @@
 import React from "react";
-import logo from "../logo.png";
+
 import "./Header.css";
 
 function ImgLogo() {
@@ -7,7 +7,7 @@ function ImgLogo() {
 		<>
 			<a href='/work'>
 				{" "}
-				<img src={logo} alt='logo' className='img_logo' />
+				<img src={`${process.env.PUBLIC_URL}/img/logo.png`} alt='logo' className='img_logo' />
 			</a>
 			<a href='/search'>
 				<button className='button_search'>Search</button>

+ 11 - 10
src/components/Routers.js

@@ -2,16 +2,17 @@ import React from "react";
 import { BrowserRouter as Router, Route, Switch, Redirect } from "react-router-dom";
 import * as createHistory from "history";
 import { connect } from "react-redux";
-import { actionFullLogin } from "../actions/actionFullLogin";
-import { actionFullRegister } from "../actions/actionFullRegister";
-import { LoginForm } from "../pages/LoginForm";
-import { FormReg } from "../pages/FormReg";
-import { Main } from "../pages/Main";
-import { Home } from "../pages/WorkPage";
-import { Cabinet } from "../pages/Cabinet";
-import ConnectFormSearch from "../pages/Search";
-import CProjects from "../pages/Projects";
-import ConnectedProject from "../pages/Project";
+
+import { actionFullLogin } from "store/actions/actionFullLogin";
+import { actionFullRegister } from "store/actions/actionFullRegister";
+import { LoginForm } from "pages/LoginForm";
+import { FormReg } from "pages/FormReg";
+import { Main } from "pages/Main";
+import { Home } from "pages/WorkPage";
+import { Cabinet } from "pages/Cabinet";
+import ConnectFormSearch from "pages/Search";
+import CProjects from "pages/Projects";
+import ConnectedProject from "pages/Project";
 
 const history = createHistory.createBrowserHistory();
 

+ 3 - 1
src/components/UserHeader.js

@@ -1,5 +1,7 @@
 import { connect } from "react-redux";
-import { actionAuthLogout } from "../actions/actionAuthLogout";
+
+import { actionAuthLogout } from "store/actions/actionAuthLogout";
+
 import "./Header.css";
 
 const NickName = ({ nick, onLogOut }) => {

+ 1 - 0
src/index.js

@@ -1,5 +1,6 @@
 import React from "react";
 import ReactDOM from "react-dom";
+
 import "./index.css";
 import App from "./App";
 import reportWebVitals from "./reportWebVitals";

+ 3 - 1
src/pages/Cabinet.js

@@ -1,5 +1,7 @@
 import React from "react";
-import ConnectedNick from "../components/UserHeader";
+
+import ConnectedNick from "components/UserHeader";
+
 import { ConnectFormUpload } from "./FormUpload";
 import "./Main.css";
 

+ 1 - 0
src/pages/FormReg.js

@@ -1,4 +1,5 @@
 import React, { useState } from "react";
+
 import "./LoginReg.css";
 
 export const FormReg = ({ FormReg }) => {

+ 4 - 2
src/pages/FormUpload.js

@@ -1,7 +1,9 @@
 import { connect } from "react-redux";
-import { actionFullAva } from "../actions/actionFullAva";
 import { useDropzone } from "react-dropzone";
-import { ConnectedAvaLogo } from "../components/Ava";
+
+import { actionFullAva } from "store/actions/actionFullAva";
+import { ConnectedAvaLogo } from "components/Ava";
+
 import "./FormUpload.css";
 
 const FormUpload = ({ onUpload }) => {

+ 1 - 0
src/pages/LoginForm.js

@@ -1,4 +1,5 @@
 import { useState } from "react";
+
 import "./LoginReg.css";
 
 export const LoginForm = ({ onLogin }) => {

+ 5 - 5
src/pages/Project.js

@@ -1,11 +1,11 @@
-import { useEffect } from "react";
+import { useEffect, useState } from "react";
 import { connect } from "react-redux";
-import { actionSnippetById } from "./../actions/actionSnippetById";
-import { useState } from "react";
-import { Editor } from "../components/Editor";
-import "../components/EditorsPage.css";
 import { Link } from "react-router-dom";
 
+import { actionSnippetById } from "store/actions/actionSnippetById";
+import { Editor } from "components/Editor";
+import "components/EditorsPage.css";
+
 //  const [editors, setEditors] = useState(datas);
 //   const [title, setTitle] = useState("");
 //   const [description, setDescription] = useState("");

+ 1 - 2
src/pages/Projects.js

@@ -1,6 +1,5 @@
 import { connect } from "react-redux";
 import { Link } from "react-router-dom";
-import code from "../../src/code.png";
 
 const Projects = ({ snippets }) => {
 	return snippets ? (
@@ -23,7 +22,7 @@ const Projects = ({ snippets }) => {
 			<div className='snippet_block'>
 				{snippets?.map((key, index) => (
 					<div className='snippet'>
-						<img src={code} alt='code'></img>
+						<img src={`${process.env.PUBLIC_URL}/img/code.png`} alt='code'></img>
 						<div className='block_content'>
 							<p>{`Name: ${snippets?.[index]?.title}` || "Project without name"}</p>
 							<p>{`Description: ${snippets?.[index]?.description}` || ""}</p>

+ 5 - 4
src/pages/Search.js

@@ -1,8 +1,9 @@
-import { actionSearch } from "../actions/actionSearch";
+import { useState } from "react";
 import { Link } from "react-router-dom";
 import { connect } from "react-redux";
-import { useState } from "react";
-import code from "../../src/code.png";
+
+import { actionSearch } from "store/actions/actionSearch";
+
 import "./Main.css";
 
 const Search = ({ onSearch, snippets }) => {
@@ -35,7 +36,7 @@ const Search = ({ onSearch, snippets }) => {
 			<div className='snippet_block'>
 				{snippets?.map((key, index) => (
 					<div key={key} className='snippet'>
-						<img src={code} alt='code'></img>
+						<img src={`${process.env.PUBLIC_URL}/img/code.png`} alt='code'></img>
 						<div className='block_content'>
 							<p>{`Name: ${snippets?.[index]?.title}` || "Project without name"}</p>
 							<p>{`Description: ${snippets?.[index]?.description}` || ""}</p>

+ 4 - 3
src/pages/WorkPage.js

@@ -1,7 +1,8 @@
-import { EditorsPage } from "../components/EditorsPage";
-import { actionSnippetAdd } from "../actions/actionSnippetAdd";
 import { connect } from "react-redux";
-import Header from "../components/Header";
+
+import Header from "components/Header";
+import { EditorsPage } from "components/EditorsPage";
+import { actionSnippetAdd } from "store/actions/actionSnippetAdd";
 
 export const Home = () => {
 	return (

src/actions/actionAuthLogin.js → src/store/actions/actionAuthLogin.js


src/actions/actionAuthLogout.js → src/store/actions/actionAuthLogout.js


src/actions/actionFindUser.js → src/store/actions/actionFindUser.js


src/actions/actionFullAva.js → src/store/actions/actionFullAva.js


src/actions/actionFullLogin.js → src/store/actions/actionFullLogin.js


src/actions/actionFullRegister.js → src/store/actions/actionFullRegister.js


src/actions/actionImgFind.js → src/store/actions/actionImgFind.js


src/actions/actionLogin.js → src/store/actions/actionLogin.js


src/actions/actionPending.js → src/store/actions/actionPending.js


src/actions/actionPromise.js → src/store/actions/actionPromise.js


src/actions/actionReg.js → src/store/actions/actionReg.js


src/actions/actionRejected.js → src/store/actions/actionRejected.js


src/actions/actionResolved.js → src/store/actions/actionResolved.js


src/actions/actionSearch.js → src/store/actions/actionSearch.js


src/actions/actionSetAva.js → src/store/actions/actionSetAva.js


src/actions/actionSnippetAdd.js → src/store/actions/actionSnippetAdd.js


src/actions/actionSnippetById.js → src/store/actions/actionSnippetById.js


src/actions/actionSnippetFindByOwner.js → src/store/actions/actionSnippetFindByOwner.js


src/actions/actionUploadFile.js → src/store/actions/actionUploadFile.js


src/actions/gql.js → src/store/actions/gql.js


src/actions/requests.js → src/store/actions/requests.js


src/reducers/auth.js → src/store/reducers/auth.js


+ 2 - 0
src/reducers/index.js

@@ -1,7 +1,9 @@
 import { createStore, combineReducers, applyMiddleware } from "redux";
 import thunk from "redux-thunk";
+
 import authReducer from "./auth";
 import promiseReducer from "./promise";
+
 import { actionSnippetFindByOwner } from "../actions/actionSnippetFindByOwner";
 import { actionFindUser } from "../actions/actionFindUser";
 

src/reducers/promise.js → src/store/reducers/promise.js