mercredi 20 mai 2020

Is there anyway to merge 2 ReactJs project into one?

I have 2 project React web app, one for desktop site, one for tablet site.Shared backend, the logic is almost the same but the UI,function and route are separate. Now I want to combine them into one project, just run only command npm start.

Assuming that the big screen will be the desktop site, the medium screen will be the tablet site.

Similar behavior to Facebook, they have a classic UI and can switch with the new beta UI.

I know this is similar to responsive, but I don't have time to redo all with responsive, some functionality is also not available on the tablet site.

I need some solution like

if (screen-width > = 1024px){
    src/ = srcDesktop/ 
} else {
    src/ = srcTablet/
}


if (switchButtonState = true) {
    src/ = srcDesktop/
} else {
    src/ = srcTablet/
}



Aucun commentaire:

Enregistrer un commentaire