Create a Preview Pane Control in React - reactjs

I need to create a React Component similar to a preview pane. These are search result so what I need the component to do is when the user clicks the "Preview" link or button a smaller panel opens up to show a preview. I have the URL text that I need to send to the control to generate the preview (these are search results from a SharePoint REST api call).
What I need to know since I am new to react, is what kind of component do I need to create. I am working in Visual Studio 2017 and have had success creating generic React components using this code :
import React, { Component } from 'react';
directive, so I am familiar with creating the Components, I just don't know which components to use. Can someone help with with the types of component I should use to build a simple preview? I am not necessarily looking for code, just a list of components to use or a link to tutorial
Thanks

I was able to create the control using an IFrame to host the "preview" url. The problem was with the URL that was being passed in.

Related

Discover name of Salesforce Lightning component to embed in custom component

I am trying to embed Salesforce's own "Log Email Or Event" component in a custom component I am building.
Lightning App Builder
From the Lightning App Builder I can see this component in the left nav when editing the default email pane. However, I cannot work out the name of the component to embed in a custom Aura component (or LWC).
Using Chrome's inspector I can see that the HTML element has data-fqn="lightningInbox:logItemButtonContainer", but trying to embed <lightningInbox:logItemButtonContainer /> in an Aura component gives the error "No COMPONENT named lightningInbox:logItemButtonContainer found", so I'm sure that's the wrong name or method of embedding.
Using Salesforce's Lightning Inspector hasn't been successful because there are too many components when viewing in the Lightning App Builder to be able to inspect that specific component, and its highlighting breaks past the iframe that Salesforce uses in its own builder.
Any help would be appreciated. Thank you!

React Native Export Whole Content of Scroll View into PDF

I am currently working on a react-native project and I am facing the following problem:
I have a ScrollView with dynamic size. I would like to be able to export the content of the ScrollView into a PDF on click of a button. It is like creating a screenshot that scrolls through my whole view before saving the image into a pdf. How can I achieve that ?
I know that there is a component called "react-pdf" that I can use to render my own pdf. Is this the way to go ?
I have also seen that there is a component called "react-native-view-shot" which takes a picture of a view. But in my case it is a ScrollView so I don't think that it will work

Can't Drag Components To Editor In AEM 6.5

I have been trying to make my own component in React to be used in AEM. I am currently following this tutorial here: https://www.youtube.com/watch?v=nec_MDPzMYk&t=86s
I am able to build the component and deploy it to my local instance of AEM, but I am unable to drag the component to the editor in AEM. The only components I seem to be able to drag and drop are Container and Text. I've added a public Dropbox folder with three screenshots to help describe my issue: https://www.dropbox.com/sh/aiifh6aahf28esu/AADZxqo1apo2NLXquz1ZNhbia?dl=0
I have edited the SPA Page policy in AEM (see first screenshot: “edit template”) to include all of the components listed here, including the new component (Basic Component) that I have added with React (see next screenshot: available components), yet when I go to drag the components to the editor, I can’t do that (see screenshot: editor).
Does anyone see what I could be doing wrong?
In case you will click on 'Drag Component here' and try do add ur component via '+' is your component in the list or not? Might be that you have changed the policy for a different responsive grid.
Also check the error.log, might be there you will find some clues. (http://:/system/console/slinglog/tailer.txt?tail=1000&grep=*&name=%2Flogs%2Ferror.log)
And component should have _cq_dialog or_cq_editConfig. Only in this case AEM allows to add components

Push modal box ontocurrent page with reactjs

I'm making various asynchronous http calls in my reactjs app. Errors from the server are streamlined and I would like to show an error dialog box in react regardless of the current page. I'm currently using the alert but I really would like a styled modal error box.
How do I detect the current page and inject the modal box and display it?
Thanks!
I think you should create the dialog dynamically. It means that you will create and mount the Dialog component right after the error appears. You can refer this approach from ant.design team. https://github.com/ant-design/ant-design/blob/master/components/modal/confirm.tsx

ReactJS component hiding for React developer tools

I know the some of the websites using reactJS for the front-end part but they're using some advance technique to hide the component structuring. So we not able to view the component part using the react developer tool.
example site - facebook site
Can you please let me know what facebook uses to hide the component structuring?
Try using below code in production
<script>
if (typeof window.__REACT_DEVTOOLS_GLOBAL_HOOK__ === 'object') {
__REACT_DEVTOOLS_GLOBAL_HOOK__.inject = function() {};
}
</script>
Refer react-devtools issue here #191
Usually when I want to hone my view in the Component tree I will go to the View Settings Menu, which is the gear icon located by the search component tree bar in the top left:
In the View Settings Menu, you can access Component Tree options. One extremely useful feature is the Hide Components Where... filter. You can enter a regex expression if you wish to exclude a lot of noise from the component tree. In the example below, I have entered a regex that hides everything except my component named "ContractForm":
That yields the following result in the components pane:

Resources