Fix asset paths and routing issues
- Fix asset paths from /react/templateassets/ to /react/assets/ - Fix missing slash in asset paths (/reactassets/ to /react/assets/) - Update environment.jsx to ensure base_path always has trailing slash - Fix BrowserRouter basename configuration - Update Header.jsx exclusionArray paths - Fix themeSettings and rightSidebar asset paths
This commit is contained in:
parent
a32097fb4a
commit
37f11dc23a
@ -116,8 +116,8 @@ const Header = () => {
|
||||
let pathname = location.pathname;
|
||||
|
||||
const exclusionArray = [
|
||||
"/reactjs/template/dream-pos/index-three",
|
||||
"/reactjs/template/dream-pos/index-one",
|
||||
"/reactjs/dream-pos/index-three",
|
||||
"/reactjs/dream-pos/index-one",
|
||||
];
|
||||
if (exclusionArray.indexOf(window.location.pathname) >= 0) {
|
||||
return "";
|
||||
|
||||
@ -257,7 +257,7 @@ const ThemeSettings = () => {
|
||||
/>
|
||||
<label htmlFor="rtl" className="checktoggles">
|
||||
<Link
|
||||
to="https://dreamspos.dreamstechnologies.com/react/template-rtl/"
|
||||
to="https://dreamspos.dreamstechnologies.com/react/"
|
||||
target="_blank"
|
||||
>
|
||||
<ImageWithBasePath
|
||||
|
||||
@ -16,7 +16,7 @@ const ImageWithBasePath = (props) => {
|
||||
}
|
||||
|
||||
// For debugging - remove in production
|
||||
// console.log('Image path:', fullSrc);
|
||||
// console.log('Base path:', base_path, 'Src:', props.src, 'Full path:', fullSrc);
|
||||
|
||||
return (
|
||||
<img
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
// For development environment
|
||||
export const base_path = process.env.PUBLIC_URL || "/react/";
|
||||
const publicUrl = process.env.PUBLIC_URL || "/";
|
||||
export const base_path = publicUrl.endsWith('/') ? publicUrl : publicUrl + '/';
|
||||
|
||||
// For production with a subdirectory (uncomment and modify as needed)
|
||||
// export const base_path = "/react/";
|
||||
|
||||
@ -172,7 +172,7 @@ const RightSideBar = () => {
|
||||
<input type="checkbox" id={1} className="check" />
|
||||
<label htmlFor={1} className="checktoggle">
|
||||
<Link
|
||||
to="https://dreamspos.dreamguystech.com/react/template-rtl/dashboard"
|
||||
to="https://dreamspos.dreamguystech.com/react/dashboard"
|
||||
className="layout-link"
|
||||
>
|
||||
checkbox
|
||||
|
||||
@ -25,7 +25,7 @@ if (rootElement) {
|
||||
root.render(
|
||||
<React.StrictMode>
|
||||
<Provider store={store} >
|
||||
<BrowserRouter basename={base_path}>
|
||||
<BrowserRouter basename={process.env.PUBLIC_URL}>
|
||||
<AllRoutes />
|
||||
|
||||
</BrowserRouter>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user