How to hide the form from unauthorized users

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP


How to hide the form from unauthorized users



The form of adding information to the page works regardless of whether the user is authorized or not, how can I hide the form from unauthorized users?
An unauthorized user can not use the form, but it is still visible to him.



index.js


import React, { Component } from 'react';
import HolidayItemsList from './holidays/holidays_list'
import HolidaysForm from './holidays/holidays_form'

export default class Holidays extends Component {
render() {
return (
<div>
<h3>Holidays</h3>

<HolidayItemsList />

<HolidaysForm />
</div>
);
}
}



index_form.js


........

render() {
return (
<div className='col-sm-4'>
<Formsy.Form onSubmit={ this.handleSubmit.bind(this) }>
<div className="form-group">
<label for="name">Name:</label>
<input
onChange={ this.handleChange.bind(this, 'name') }
className="form-control"
id="name"
required
/>
</div>

<div className="form-group">
<label for="date">Date:</label>
<FormDatePicker
handleChange={ this.handleChange.bind(this) }
selected={ this.state.item.date }
name="date"
required
/>
</div>

<button
type="submit"
className="btn btn-primary"
>Submit</button>
</Formsy.Form>
</div>
);
}
}









By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Popular posts from this blog

Arduino Mega cannot recieve any sketches, stk500_recv() programmer is not responding

Better method to check all objects' parameters with a single call

Visual Studio Code: How to configure includePath for better IntelliSense results