Sharepoint Online / 365 integration (uploading files) in the React app, which is hosted on Azure and WebApi C # .Net Core 2.2

I've been having trouble interacting / automating a way to upload files from a Web application created in React and upload files to a Sharepoint online site in a particular folder for several weeks. The WebApp is hosted in Azure and uses a C # .Net Core 2.2 as the backend.

I'm trying to use a kind of REST API to help me with this task. (May be activated in the frontend or in C # Core or C # MS FW .Net for the backend.)
I'm looking for a way to do this on the internet, but all tests have failed.

Anyone can give me insights, tips or advice on how to do this?

I'm trying:

  • Use code from Microsoft WebPage (Using jQuery).

  • When using PnP, but on my local host, a CORS issue is displayed (I am trying to interact with the client ID and the secret ID with Sharepoint).

React – I can not center the title

For some reason, I did not try to center the title using React Native and React Navigation.

Tries:

  1. align Self
export default class First extends React.Component {
    static navigationOptions = {
        title: 'Start',
        headerStyle: {
            backgroundColor: '#000080',
        },
        headerTintColor: '#ffffff',
        headerTitleStyle: {
            fontWeight: 'bold',
            fontSize: 20,
            alignSelf: 'center',
        },
    }
  1. textAlign
export default class First extends React.Component {
    static navigationOptions = {
        title: 'Start',
        headerStyle: {
            backgroundColor: '#000080',
        },
        headerTintColor: '#ffffff',
        headerTitleStyle: {
            fontWeight: 'bold',
            fontSize: 20,
            textAlign: 'center',
        },
    }
  1. Both
export default class First extends React.Component {
    static navigationOptions = {
        title: 'Start',
        headerStyle: {
            backgroundColor: '#000080',
        },
        headerTintColor: '#ffffff',
        headerTitleStyle: {
            fontWeight: 'bold',
            fontSize: 20,
            alignSelf: 'center',
            textAlign: 'center',
        },
    }

I also tried using empty headerRight / headerLeft, but nothing happened.

react.js – language localization react

I made this language localization for React Native (it can also work for React Js). It should receive the device language, but the user should also be able to change it.

import React, { useState, useContext } from 'react'
import { Platform, NativeModules } from 'react-native'
import PropTypes from 'prop-types'

const languageJson = require('../../language.json')

const deviceLanguage =
    Platform.OS === 'ios'
        ? NativeModules.SettingsManager.settings.AppleLocale
        : NativeModules.I18nManager.localeIdentifier

export const LanguageContext = React.createContext(deviceLanguage)

export const T = ({ children }) => {
    const { language } = useContext(LanguageContext)
    if (!children) return ''
    let res =
        languageJson(children) && languageJson(children)(language)
            ? languageJson(children)(language)
            : languageJson(children)('en_US')
    return res
}

export const t = string =>
    languageJson(string) && languageJson(string)(deviceLanguage)
        ? languageJson(string)(deviceLanguage)
        : languageJson(string)('en_US')

export default function Language({ children }) {
    const (language, setLanguage) = useState(deviceLanguage)

    const t = key => {
        let string =
            languageJson(key) && languageJson(key)(language)
                ? languageJson(key)(language)
                : languageJson(key)('en_US')

        if (string) return string
        throw Error(`Key ${key} not found`)
    }

    return (
        
            {children}
        
    )
}

Language.propTypes = {
    children: PropTypes.node,
}

Is there a way to improve it without using existing packages?

One thing you can notice is that the function t (this is outside the component) will not change if you change the device language of the context, this will be very bad, but at the same time I'm not sure if I'm working to make it better and fix it.

reactjs – Remove horizontal edges in bootstrap with react

I want to leave the left and right margins at 0, but that will not let me go. I've been looking for different ways, but it does not allow me to leave the border the way I want. The white displayed above is the navigation that occupies the entire view of the browser and the form does not. I want the form to also use the entire browser space horizontallyWhat you see above is the navigation that occupies the entire horizontal space of the browser while the form does not. I would like to know how to solve this problem since the form should also occupy the entire horizontal space of the browser (if it is not understood) I want to remove all the white space that is seen and that the black shape starts there.

Here I have my code:

render(){
return(
    
Solicite una cotizaciĆ³n gratis
)}

PD: I'm dealing with React and Reacstrap and React Bootstrap

java – Error adding frontend Maven plugin to use React in a Spring project

var path = require('path');

module.exports = {
    entry: './src/main/js/app.js',
    devtool: 'sourcemaps',
    cache: true,
    mode: 'development',
    output: {
        path: __dirname,
        filename: './src/main/resources/static/built/bundle.js'
    },
    module: {
        rules: (
            {
                test: path.join(__dirname, '.'),
                exclude: /(node_modules)/,
                use: ({
                    loader: 'babel-loader',
                    options: {
                        presets: ("@babel/preset-env", "@babel/preset-react")
                    }
                })
            }
        )
    }
};

Javascript – How to Structure this React Application: Button Functionality to Avoid Complexity

I currently have two main "two views" in this application. One is This is a component that indicates that it is the main page and another This is a component that makes up other components that display the second page. It depends on whether you press a button or if some changes have been made.

class PreApp extends React.Component{
  state = { TestIsOn: false }

    handleStateUp = (testInOn) => {
        this.setState({ TestIsOn: testInOn })
    }

  render(){
    return (
      
         
        {this.state.TestIsOn ?  : }
        {this.state.TestIsOn ?  : 
} ); } } class App extends React.Component{ state = {ButtonClicked: false} handleSubmit = (ButtonClicked) => { this.setState({ ButtonClicked: ButtonClicked }) } render(){ return (
{this.state.ButtonClicked ? : }
) } } export default App;

I am not happy because the application is currently structured because the functionality of the buttons is now anchored to "conditional". I want you to just work with a "simple" onClick "to bring you to the component.

At the moment, the problem I wanted to solve is that there is a condition that depends on whether the CREATE ACCOUNT button is pressed to render the component , But It is what is shown. But of course, I'd like to add functions to the second button ("MAKE A TEST") so I can not put them into the ternary condition any more, as they obviously only allow two.

When I do that, for example, it makes me obviously the two things of any condition:

class App extends React.Component{
  state = {ButtonClicked: false}

  handleSubmit = (ButtonClicked) => {
    this.setState({ ButtonClicked: ButtonClicked })
  }
  handleLogin = (EnteredLogin) => {
    this.setState({EnteredLogin: EnteredLogin})
  }
  render(){
    return (
      
{this.state.ButtonClicked ? : } {this.state.EnteredLogin ? : }
) } } export default App;

The landing component with the two buttons that I refer to:

Class Landing extends React.Component {

render () {
back (
        
       
       
       
       )
}
}

design – React frontend with Node.js backend running on Nginx, Linux EC2 server

I'm trying to set up a production application with React for the front end and Node.js for my API (two separate repos) on a single computer (Linux EC2 server). I set up nginx on the server and set up my nginx configuration file on the build folder of my frontend app. This works as expected, but I still need to set up the API for Nginx to do this as well.

Is this setup broken in any way? How should I decide if I should run the API so that the frontend can communicate with it?