Skip to content

Commit

Permalink
Stucture refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
alexandyrzph committed Aug 5, 2022
1 parent a7ddfc9 commit ba07a12
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 22 deletions.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { useUserAuth } from "../../context/UserAuthContext";
import { useUserAuth } from "../../../context/UserAuthContext";
import { Formik, Form, Field } from "formik";
import { CreateEditPostSchema } from "../../utils/formValidators";
import { CreateEditPostSchema } from "../../../utils/formValidators";
import { useEffect, useRef, useState } from "react";
import { AiOutlineCloudUpload } from "react-icons/ai";
import { BsShieldFillExclamation } from "react-icons/bs";
import { useNavigate } from "react-router-dom";
import { db, storage } from "../../firebase";
import { db, storage } from "../../../firebase";
import { addDoc, collection, serverTimestamp } from "firebase/firestore";
import { ref, uploadBytes, getDownloadURL } from "firebase/storage";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { useUserAuth } from "../../context/UserAuthContext";
import { useUserAuth } from "../../../context/UserAuthContext";
import { useEffect, useRef, useState } from "react";
import { Link, useNavigate, useParams } from "react-router-dom";
import { HiDotsHorizontal } from "react-icons/hi";
import { ToastContainer } from "react-toastify";
import { getPostById } from "../../api/PostsAPI";
import { toastError } from "../../utils/Toast";
import { db } from "../../firebase";
import { getPostById } from "../../../api/PostsAPI";
import { toastError } from "../../../utils/Toast";
import { db } from "../../../firebase";
import {
addDoc,
collection,
Expand All @@ -17,7 +17,7 @@ import {
serverTimestamp,
} from "firebase/firestore";
import { uuidv4 } from "@firebase/util";
import Comment from "../Comment/Comment";
import Comment from "../../Comment/Comment";
import { Transition } from "@tailwindui/react";

const PostDetails = () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import { useUserAuth } from "../../context/UserAuthContext";
import { useUserAuth } from "../../../context/UserAuthContext";
import { Formik, Form, Field } from "formik";
import { CreateEditPostSchema } from "../../utils/formValidators";
import { CreateEditPostSchema } from "../../../utils/formValidators";
import { useEffect, useRef, useState } from "react";
import { AiOutlineCloudUpload } from "react-icons/ai";
import { Navigate, useNavigate, useParams } from "react-router-dom";
import { db, storage } from "../../firebase";
import { db, storage } from "../../../firebase";
import { doc, updateDoc } from "firebase/firestore";
import { ref, uploadBytes, getDownloadURL } from "firebase/storage";
import { BsShieldFillExclamation } from "react-icons/bs";
import { getPostById } from "../../api/PostsAPI";
import { getPostById } from "../../../api/PostsAPI";

const PostEditForm = () => {
const [image, setImage] = useState();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ import { useEffect, useRef, useState } from "react";
import { Link, useNavigate } from "react-router-dom";
import { HiDotsHorizontal } from "react-icons/hi";
import { deleteDoc, doc } from "firebase/firestore";
import { db } from "../../firebase";
import { db } from "../../../firebase";
import { Transition } from "@tailwindui/react";
import Like from "../Like/Like";
import Like from "../../Like/Like";

const PostItem = ({
ownerUsername,
Expand Down
4 changes: 2 additions & 2 deletions pixelplace/src/components/Profile/Profile.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { useCollection } from "react-firebase-hooks/firestore";
import { BeatLoader } from "react-spinners";
import { useUserAuth } from "../../context/UserAuthContext";
import { db } from "../../firebase";
import PostItem from "../PostItem/PostItem";
import PostItem from "../Posts/PostItem/PostItem";

const Profile = () => {
const { user } = useUserAuth();
Expand Down Expand Up @@ -39,7 +39,7 @@ const Profile = () => {
<BeatLoader size={"5rem"} color={"#1e1e1e"} />
</div>
)}
{values?.empty && (<p className="text-2xl">You don't have any posts yet</p>)}
{values?.empty && <p className="text-2xl">You don't have any posts yet</p>}
</div>
</div>
</div>
Expand Down
12 changes: 6 additions & 6 deletions pixelplace/src/components/index.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
export { default as Comment } from "./Comment/Comment";
export { default as PostCreate } from "./Forms/PostCreateForm";
export { default as PostEdit } from "./Forms/PostEditForm";
export { default as SignIn } from "./Forms/SignIn";
export { default as SignUp } from "./Forms/SignUp";
export { default as PostCreate } from "./Posts/PostCreateForm/PostCreateForm";
export { default as PostEdit } from "./Posts/PostEditForm/PostEditForm";
export { default as SignIn } from "./Auth/SignIn";
export { default as SignUp } from "./Auth/SignUp";
export { default as Home } from "./Home/Home";
export { default as Like } from "./Like/Like";
export { default as Navbar } from "./Navbar/Navbar";
export { default as PostDetails } from "./PostDetails/PostDetails";
export { default as PostItem } from "./PostItem/PostItem";
export { default as PostDetails } from "./Posts/PostDetails/PostDetails";
export { default as PostItem } from "./Posts/PostItem/PostItem";
export { default as Posts } from "./Posts/Posts";
export { default as Profile } from "./Profile/Profile";
export { default as ProtectedRoute } from "./ProtectedRoute/ProtectedRoute";

0 comments on commit ba07a12

Please sign in to comment.