Skip to content

Commit

Permalink
Merge pull request #700 from AI4Bharat/css-fix
Browse files Browse the repository at this point in the history
change css logic
  • Loading branch information
aparna-aa authored Sep 11, 2023
2 parents 9c2814e + 33d97d7 commit da5fed6
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 22 deletions.
7 changes: 4 additions & 3 deletions src/ui/Layout.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React, { Suspense, useEffect, useState } from "react";

import { useSelector } from "react-redux";
import { useNavigate } from "react-router-dom";
import { useLocation, useNavigate } from "react-router-dom";
// import { useHistory } from "react-router-dom";
import { ThemeProvider, } from "@mui/material";
// import Header from "./components/common/Header";
Expand All @@ -26,6 +26,7 @@ const Layout= (props) => {
const [show, setShow] = useState(false);
const [popUp, setPopup] = useState(true);
const apiStatus = useSelector((state) => state.apiStatus);
const location = useLocation();

const classes = GlobalStyles();
// const history = useHistory();
Expand Down Expand Up @@ -92,7 +93,7 @@ const Layout= (props) => {
return (
<ThemeProvider theme={themeDefault}>
<div
className={ loggedInUserData?.prefer_cl_ui=== true && (localStorage.getItem("enableChitrlekhaUI") === "true")?classes.Audioroot:classes.root}
className={location.pathname.includes("AudioTranscriptionLandingPage") ? classes.Audioroot : classes.root}
>
<Suspense fallback={<div>Loading....</div>}>
<Header
Expand All @@ -102,7 +103,7 @@ const Layout= (props) => {
/>
</Suspense>
<div
className={ loggedInUserData?.prefer_cl_ui=== true && (localStorage.getItem("enableChitrlekhaUI") === "true") ?classes.Audiocontainer:classes.container}
className={location.pathname.includes("AudioTranscriptionLandingPage") ? classes.Audiocontainer : classes.container}
>
{/* {renderSpinner()}
{renderError()} */}
Expand Down
11 changes: 1 addition & 10 deletions src/ui/pages/component/Project/SuperCheckerTasks.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -199,15 +199,6 @@ const SuperCheckerTasks = (props) => {
}
}, [NextTask]);

useEffect(() => {
if (location.pathname === `projects/${id}/task/${NextTask?.id}`) {
localStorage.setItem("enableChitrlekhaUI", true);
} else {
localStorage.setItem("enableChitrlekhaUI", false);
}
localStorage.setItem("SuperCheckerStage", props.type);
},[]);

useEffect(() => {
dispatch(SetTaskFilter(id, selectedFilters, props.type));
if (currentPageNumber !== 1) {
Expand Down Expand Up @@ -277,7 +268,7 @@ const SuperCheckerTasks = (props) => {
} else {
setTasks([]);
}
}, [taskList]);
}, [taskList, userDetails?.prefer_cl_ui]);

useEffect(() => {
const newCols = columns.map((col) => {
Expand Down
2 changes: 1 addition & 1 deletion src/ui/pages/component/Project/TaskTable.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -488,7 +488,7 @@ const TaskTable = (props) => {
} else {
setTasks([]);
}
}, [taskList, ProjectDetails.project_mode]);
}, [taskList, ProjectDetails.project_mode, userDetails?.prefer_cl_ui]);

useEffect(() => {
const newCols = columns.map((col) => {
Expand Down
8 changes: 3 additions & 5 deletions src/ui/pages/component/common/Header.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import SettingsOutlinedIcon from "@mui/icons-material/SettingsOutlined";
import { useDispatch, useSelector } from "react-redux";
import APITransport from "../../../../redux/actions/apitransport/apitransport";
import FetchLoggedInUserDataAPI from "../../../../redux/actions/api/UserManagement/FetchLoggedInUserData";
import { useNavigate } from "react-router-dom";
import { useLocation, useNavigate } from "react-router-dom";
import CustomButton from "../common/Button";
import MobileNavbar from "./MobileNavbar";
import { useTheme } from "@emotion/react";
Expand Down Expand Up @@ -58,6 +58,7 @@ const Header = () => {

const dispatch = useDispatch();
let navigate = useNavigate();
const location = useLocation();
const classes = headerStyle();


Expand Down Expand Up @@ -658,10 +659,7 @@ const Header = () => {
return (
<Grid container direction="row">
<Box
className={
loggedInUserData?.prefer_cl_ui=== true &&
localStorage.getItem("enableChitrlekhaUI") === "true"
? classes.AudioparentContainers
className={location.pathname.includes("AudioTranscriptionLandingPage") ? classes.AudioparentContainers
: classes.parentContainer
}
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,6 @@ const AudioTranscriptionLandingPage = () => {
getAnnotationsTaskData(taskId);
getProjectDetails();
getTaskData(taskId);
localStorage.setItem("enableChitrlekhaUI", true);
}, []);

const getProjectDetails = () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -478,7 +478,6 @@ const ReviewAudioTranscriptionLandingPage = () => {
getAnnotationsTaskData(taskId);
getProjectDetails();
getTaskData(taskId);
localStorage.setItem("enableChitrlekhaUI", true);
console.log(
localStorage.getItem("Stage") === "review",
"StageStageStageStage"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,6 @@ const SuperCheckerAudioTranscriptionLandingPage = () => {
getAnnotationsTaskData(taskId);
getProjectDetails();
getTaskData(taskId);
localStorage.setItem("enableChitrlekhaUI", true);
console.log(
localStorage.getItem("Stage") === "review",
"StageStageStageStage"
Expand Down

0 comments on commit da5fed6

Please sign in to comment.