MenuControl.jsx

50 lines | 1.129 kB Blame History Raw Download



class MenuControl extends React.Component {

    constructor(props) {
        super(props);
        console.log('MenuControl start');

        //this.state = { counter: 0 };
        this.userServices = new UserServices();

        this.OnAuthChange = this.OnAuthChange.bind(this);
    }

    OnAuthChange() {
        this.forceUpdate();
    }

    render() {
        return (
            <div>

                <table>
                    <tr>
                        <th>Menu:</th>
                        <th>
                            <Link to={`/`}>
                                <button>FS</button>
                            </Link>
                        </th>

                        {this.userServices.IsAuth()
                            ?
                            <th>
                                <Link to={`/Admin`}>
                                    <button>Admin</button>
                                </Link>
                            </th>
                            : ""
                        }                        
                    </tr>
                </table>

            </div>
        );
    }
}