Dealing with two different layouts for the Front End and Admin End has presented a challenge for me. I have been including CSS files in the render function for both layouts, but unfortunately, they conflict with each other.
For the Front End layout:
import React, { Component } from "react";
import { Switch, Redirect, Route } from "react-router-dom";
import Header from "components/FrontEnd/Header/Header";
import Footer from "components/FrontEnd/Footer/Footer";
import Menu from "components/FrontEnd/Menu/Menu";
class Frontend extends Component {
render() {
require("../../assets/fonts/frontEnd.css");
return (
<div className="section-frontEnd">
<Header {...this.props} />
<div id="main-panel" className="" ref="mainPanel">
<Switch>
//Routes Swichting ...
</Switch>
<Footer />
</div>
</div>
);
}
}
export default Frontend;
For the Admin End layout:
import React, { Component } from "react";
import { Switch, Redirect } from "react-router-dom";
import Header from "components/Admin/Header/Header";
import Footer from "components/Admin/Footer/Footer";
import Sidebar from "components/Admin/Sidebar/Sidebar";
class Dashboard extends Component {
render() {
require('bootstrap/dist/css/Admin.css')
return (
<div className="wrapper">
<Sidebar />
<div id="main-panel" className="main-panel" ref="mainPanel">
<Header />
<Switch>
//Routes Swichting ...
</Switch>
<Footer />
</div>
</div>
);
}
}
export default Dashboard;
I am seeking a more effective solution to resolve this issue. I should mention that I am not utilizing a webpack file in my project.
Folder Structure: