ReactJs select page to show to the user - javascript

i want to make a react app that shows specific page due to what i (the owner) chose to the user
EXAMPLE: User is in Home and reacts with my app and the app requires response from the owner/server
i choose to show him the contact page and the app shows the contact page.
I do not know how to explain better sorry

Related

How to redirect to another site automatically in Next.js

I am trying to make my progressive web app automatically redirect to another site when the user clicks on the icon on their desktop.
As of right now when the user clicks on the icon it opens up a landing page where the user can link on the link to be redirected.
I'm using Next.js and JavaScript. I appreciate any help you can give me.

Mesibo Javascript Popup Integration for one to many chat

I have integrated Javascript Messenger & Popup https://github.com/mesibo/messenger-javascript/
I want use Popup Integration or Multitab-Popup for more than one user like Javascript Messenger where we can chat with multiple user (one-to-many)
For that I have display list of users on Page and on clicking on user I am loading popup in iframe with destination user mobile no, destination name and logged in user access token from mesibo.
It is working fine for single user while I am loading second user in iframe then first user getting logged out.
Can anyone please help me with this?
Thanks
You should initialize mesibo only once and not every-time you open a new pop-up. The best place for mesibo initialization is when your page loads.
Your popup code should only have send and receive functionalities. If you are using mesibo popup.html example, you should extract initialization and move it to your main page.

How to hide a logged area content from Chrome inspect if not logged in

Basically I have an Angular 7 project, it is a website for a home and a logged area.
The content of the logged area, accessible via OAuth, must be visible only to logged users.
The problem is that, from the home page, if I inspect I can't find the logged content in the HTML part (and this is correct), but if I navigate to main.js under source, I can find that content in a module.export.
What I am doing right now is that:
I have a component called LoggedComponent that appears on the main component only if the *ngIf='logged' is satisfied.
logged is taken from a service and it is updated correctly if the user is logged in or not.
If logged is true, then the component is loaded.
But how can I hide the content of the LoggedComponent from a user that can inspect my code from chrome?
My website is all under a homepage, I did not use Router, is it the solution?
Can you please help me with it?

How to prevent the user from manually going to the url, requiring that they click a link to get there

I have a website about a factory of chocolates, I'm working in Laravel and PHP. In my website I have a login, and different types of users.
Until there is every ok. If I login as an admin. The website shows the administration control panel as home page. In this site I have a menu with many operations for only admin users.
For example I have a menu about add new users. The url of the menu in the top bar navigation is:
localhost/BestChoco/NewUsers
And in this menu I have a button that redirect to another view that is a form to add new users.
Now th url is:
localhost/BestChoco/NewUsers/create
Is in this case, for example, I want to prevent the user, type in the top bar that url.
If the user type localhost/BestChoco/NewUsers/create in the top navigation bar, without visited the page of users, the website redirect automatically to the home page.
The home page is called index.blade.php Is the same for all user but the content changes depending on the user logged in. How can I do it?
No. The page cannot control default browser navigation bar behaviour.
You should be using a permissions-based method to kick unauthorized users out of that page if they manage to navigate there. You must manage this via your PHP code.

get data before sharing on facebook + popups

I'd like my users to share some content generated on the server, but would like NOT to generate that content before user clicks the Share button.
There are three routes to take:
a social button - I need some kind of event before the popup opens since the data is still not there. Is there such an event?
add button/link that fetches the data and then calls FB.ui({ method: 'share' ... }) - when FB.ui() is called, the browser asks the user to allow popups from the website because it's no longer user-triggered. Is there a way to use the fact that the user clicked the button in the first place?
make the user click a button to submit the info I need, get the results and only then display the Share button with the data from server - seems the default way to go but hits usability by making the user press 2 buttons (and wait in between)
I DON'T want the user to give the app any permissions (and then share directly via the api), it's too much for what the app is doing.
So the question is:
Is there a way to implement the functionality using route 1 or 2, or is there a better way, or is 3 the only route to go?

Categories