Skip to content

Commit

Permalink
fix: minor refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
narayan954 committed Dec 9, 2023
1 parent 07ea065 commit 9124d3d
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 12 deletions.
20 changes: 10 additions & 10 deletions src/App.jsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,4 @@
import "./index.css";

import { Darkmode, ErrorBoundary } from "./reusableComponents";
import {
DeleteAccount,
SettingsSidebar,
SoundSetting,
} from "./components/SettingsComponents";
import { Outlet, Route, Routes, useNavigate } from "react-router-dom";
import React, { useEffect, useState } from "react";

Expand Down Expand Up @@ -36,6 +29,15 @@ const HelpCenter = React.lazy(() => import("./pages/FooterPages/HelpCenter"));
const Notifications = React.lazy(() => import("./components/Notification"));
const SideBar = React.lazy(() => import("./components/SideBar"));
const Navbar = React.lazy(() => import("./components/Navbar"));
const DeleteAccount = React.lazy(() =>
import("./components/SettingsComponents/DeleteAccount"),
);
const SettingsSidebar = React.lazy(() =>
import("./components/SettingsComponents/Sidebar"),
);
const SoundSetting = React.lazy(() =>
import("./components/SettingsComponents/Sounds"),
);

export function getModalStyle() {
const top = 0;
Expand Down Expand Up @@ -68,7 +70,7 @@ export const useStyles = makeStyles((theme) => ({
},
}));

function App() {
export default function App() {
const [user, setUser] = useState(null);
const [rowMode, setRowMode] = useState(false);

Expand Down Expand Up @@ -299,8 +301,6 @@ function App() {
);
}

export default App;

function Wrapper({ user, setUser, setRowMode }) {
const [showScroll, setShowScroll] = useState(false);
const scrollTop = () => {
Expand Down
2 changes: 1 addition & 1 deletion src/components/SideBar/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@ import { getModalStyle, useStyles } from "../../App";
import { useLocation, useNavigate } from "react-router-dom";

import { AiOutlineClose } from "react-icons/ai";
import ImgUpload from "../ImgUpload";
import { auth } from "../../lib/firebase";
import blankImg from "../../assets/blank-profile.webp";
import getUserSessionData from "../../js/userData";
import { playSuccessSound } from "../../js/sounds";
import { useSnackbar } from "notistack";

const Footer = React.lazy(() => import("./Footer"));
const ImgUpload = React.lazy(() => import("../ImgUpload"));

function SideBar() {
const classes = useStyles();
Expand Down
3 changes: 2 additions & 1 deletion src/pages/Profile/index.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import "./index.css";

import { Avatar, Box, Button, Typography } from "@mui/material";
import { EditProfile, StoryView } from "../../components";
import { ErrorBoundary, Loader, ViewsCounter } from "../../reusableComponents";
import { Link, useNavigate, useParams } from "react-router-dom";
import { auth, db, storage } from "../../lib/firebase";
Expand Down Expand Up @@ -33,6 +32,8 @@ import { setUserSessionData } from "../../js/userData";
import { useSnackbar } from "notistack";

const SideBar = lazy(() => import("../../components/SideBar"));
const EditProfile = lazy(() => import("../../components/EditProfile"));
const StoryView = lazy(() => import("../../components/Story"));

function Profile() {
const navigate = useNavigate();
Expand Down

0 comments on commit 9124d3d

Please sign in to comment.