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:
tuanOts 2025-05-25 02:11:19 +07:00
parent a32097fb4a
commit 37f11dc23a
6 changed files with 8 additions and 7 deletions

View File

@ -116,8 +116,8 @@ const Header = () => {
let pathname = location.pathname; let pathname = location.pathname;
const exclusionArray = [ const exclusionArray = [
"/reactjs/template/dream-pos/index-three", "/reactjs/dream-pos/index-three",
"/reactjs/template/dream-pos/index-one", "/reactjs/dream-pos/index-one",
]; ];
if (exclusionArray.indexOf(window.location.pathname) >= 0) { if (exclusionArray.indexOf(window.location.pathname) >= 0) {
return ""; return "";

View File

@ -257,7 +257,7 @@ const ThemeSettings = () => {
/> />
<label htmlFor="rtl" className="checktoggles"> <label htmlFor="rtl" className="checktoggles">
<Link <Link
to="https://dreamspos.dreamstechnologies.com/react/template-rtl/" to="https://dreamspos.dreamstechnologies.com/react/"
target="_blank" target="_blank"
> >
<ImageWithBasePath <ImageWithBasePath

View File

@ -16,7 +16,7 @@ const ImageWithBasePath = (props) => {
} }
// For debugging - remove in production // For debugging - remove in production
// console.log('Image path:', fullSrc); // console.log('Base path:', base_path, 'Src:', props.src, 'Full path:', fullSrc);
return ( return (
<img <img

View File

@ -1,5 +1,6 @@
// For development environment // 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) // For production with a subdirectory (uncomment and modify as needed)
// export const base_path = "/react/"; // export const base_path = "/react/";

View File

@ -172,7 +172,7 @@ const RightSideBar = () => {
<input type="checkbox" id={1} className="check" /> <input type="checkbox" id={1} className="check" />
<label htmlFor={1} className="checktoggle"> <label htmlFor={1} className="checktoggle">
<Link <Link
to="https://dreamspos.dreamguystech.com/react/template-rtl/dashboard" to="https://dreamspos.dreamguystech.com/react/dashboard"
className="layout-link" className="layout-link"
> >
checkbox checkbox

View File

@ -25,7 +25,7 @@ if (rootElement) {
root.render( root.render(
<React.StrictMode> <React.StrictMode>
<Provider store={store} > <Provider store={store} >
<BrowserRouter basename={base_path}> <BrowserRouter basename={process.env.PUBLIC_URL}>
<AllRoutes /> <AllRoutes />
</BrowserRouter> </BrowserRouter>