Updating usage of Link fabric component

This commit is contained in:
Neha Gupta 2019-04-04 18:07:08 -07:00
Родитель 224df4ec66
Коммит c98bd6921a
2 изменённых файлов: 8 добавлений и 9 удалений

Просмотреть файл

@ -1,6 +1,6 @@
import React, { Component } from 'react';
import { Switch, Route } from 'react-router-dom';
import { Link } from 'office-ui-fabric-react';
import { Switch, Route, Link } from 'react-router-dom';
import { Link as FabricLink } from 'office-ui-fabric-react';
import './App.css';
import { PrivateRoute } from './components/PrivateRoute';
@ -31,11 +31,11 @@ getCurrentSample(id)
return (
<div className="maincontent">
maincontent
<Link href='/contribute'>Contributions</Link>
<FabricLink as={Link} to='/contribute'>Contributions</FabricLink>
</div>
);
}}
/>
/>
<Route exact path='/login' component={Login} />
<PrivateRoute exact path='/contribute' component={Contribute} />
</Switch>

Просмотреть файл

@ -1,7 +1,6 @@
import React, { Component } from 'react';
import { Redirect } from 'react-router-dom';
import { Link } from 'office-ui-fabric-react';
import { Link as FabricLink } from 'office-ui-fabric-react';
class Login extends Component {
constructor(props) {
@ -29,11 +28,11 @@ class Login extends Component {
return (
<div>
<p>You must log in to view the page at {from.pathname}</p>
<Link href={`/api/user/login?returnUrl=${from.pathname}`}>Sign in using Fabric Link</Link>
<FabricLink href={`/api/user/login?returnUrl=${from.pathname}`}>Sign in using Fabric Link</FabricLink>
<br/>
<Link href={'/api/user/logout'}>Sign out</Link>
<FabricLink href={'/api/user/logout'}>Sign out</FabricLink>
<br/>
<button onClick={this.newLogin}>Sign in</button>
<button onClick={this.onLogin}>Sign in</button>
</div>
)
}