Is there anyway to merge 2 ReactJs project into one? - javascript

I have 2 projects React web app, one for the desktop site, one for the 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 behaviour to Facebook Tiktok, they have a responsive UI for PC and can switch with the mobile-like UI if access from the tablet.

Try adding a hook like this and include the desired component depending on screen width

Related

Ionic 2 , appear white blank screen after splash screen and before main page

Currently I am developing ionic 2 project for both android and ios.
I saw the white blank screen after splash screen and before main page. This blank page take 9 or 8 sec to finish. I use the following command
ionic start CoeTutorial tutorial --v2
ionic resources
ionic platform add android
ionic run android
Why did the white blank screen come out and how to make it faster?
here is my project link:
https://drive.google.com/file/d/0B8MgjhwD8M3UTVprWEd1cEk2dW8/view?usp=sharing
need to type
npm install
after downloading this sample project.
I had a similar issue when developing an app for Ionic and using IBM mobileFirst. It would happen because the splash screen would auto-hide itself before mobileFirst or my controllers would load. What I did to fix this:
I disabled autohide splash screen from my code
I programmatically hid the splash screen using a timeout
Made sure that in my index page mobilefirst would load before controllers and Ionic.
You don't describe what framework you are using (worklight, mobileFirst, Phonegap) but you can do something similar to fix this.
Here's the link to my issue on stack overflow.
Good luck!

Horizontal Orientation not working with Ionic and JavaScript

I am trying to lock my screen orientation to horizontal view for the whole app always. I added a config.xml line that reads
but it doesn't have any affect when I test it. Does this need to be in a certain place in the xml, before or after other things? Also, I am testing using the Ionic lab view in the browser and the Ionic view app on my phone, could either of these not implement the xml?
Further more, I have also tried the cordova screen orientation plugin with no luck. Is this also because Ionic view app doesn't use the plug in for some reason? I end up with a white screen if I try my app with the plugin and Ionic view app. The code for that is just: screen.lockOrientation('landscape');
So finally, to sum up the questions:
config.xml doesn't work with the preference stated above, why?
Is Ionic view app not supporting my code fully? (ie. do they implement the app weird from there end)
in AndroidManifest.xml, declare your Activity like so: <activity ... android:screenOrientation="landscape" .../>

Custom App start Screen

I am trying to create a mobile app with HTML5, CSS, and JavaScript and want to use Phonegap Build for compiling it for the mobile devices.
So most mobile apps in an App Store have custom start Screen when you start the app it shows you at the beginning the Company logo or game logo. So how is it possible to do it with HTML5, CSS, and JavaScript.
I already searching use the search engines with may keyword combine with Phonegap or Titanium to get an example or an idea how to do that.
But nothing, so many maybe you could give me any advice.
The documentation for the splashscreen is in the link below. Not used phonegap build but I assume you configure it in the same way.
It is done by an image rather than html & css.
http://docs.phonegap.com/en/3.5.0/config_ref_images.md.html

How to trigger a lightbox from inside a SWF?

I am using the magnific-popup (http://dimsemenov.com/plugins/magnific-popup/) but I don't need to use this one. I have just used it before and it worked well.
My questions is how to actually trigger different lightboxes from inside a SWF?
We have one SWF that has images and animation located at six different sections of the screen. It's sort of a launch page and each section has an image with some animation and when the users clicks on a section another web page will load.
This application will be hosted on a computer with a touch screen and we were using a kiosk app to run the app and it had a small navigation bar built in but now we are using a different operating system that works better with the touch screen hardware (OSX to Windows 8) but does not work with the same kiosk app. I also can't seem to find any kiosk apps that do the same thing for Windows 8.
Instead of using a Kiosk app I would like to just use Chrome in Kiosk/Fullscreen mode and have each section open in a new lightbox window instead of using a navigation bar. However, I can't seem to trigger the lightbox event from within the SWF itself.
Any help greatly appreciated.
In as2 something like this getURL("javascript: lightbox(maybe-attributes);"); or using flash.external.ExternalInterface class. I don't know in as3 if there's another class/method
Christian find perfect match with this jquery/flash.external.ExternalInterface
http://grasshopperpebbles.com/jquery/actionscript-using-lightbox-with-flash/

a good cross browser javascript library for building desktop/os styled web applications?

basically I want to create a browser form (it will load an external page by iframe. but around the iframe is something that resembles a desktop operating system actual browser. Complete with icons, addressbar, file menus. ex. IE6 themed browser component inside the browser. Also should be very responsive, almost as if they were using a flash application.
Something like GWT, Vaadin.
It also would be great to have some windows GUI kit to build the ui's by dragging and dropping, double clicking on it to add events and stuff like that.
Trying to build something like http://www.lfsworld.net/. Click on login as Guest and see the desktop in your browser.
If you want to implement drag and drop why don't you check gwt-dnd?
You can add doubleClick,drag and drop handlers. This library is well documented and there are plenty of demos to play with.

Categories