Issue #20 Solucionados errores mostrados por consola
This commit is contained in:
@@ -5,8 +5,8 @@ import queryString from "query-string";
|
||||
import {auth, logout} from "../services/auth_service";
|
||||
import {useStateValue} from "../services/State";
|
||||
|
||||
export const AuthMiddleware = (props) => {
|
||||
const match = useRouteMatch('*')
|
||||
export const AuthMiddleware = () => {
|
||||
useRouteMatch('*');
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -20,8 +20,6 @@ export const AuthLogin = (props) => {
|
||||
|
||||
const params = queryString.parse(props.location.search);
|
||||
auth(params).then((response) => {
|
||||
console.debug(response, window.localStorage);
|
||||
|
||||
if(response.status === 'redirect_to_code'){
|
||||
// Se va o ya se redirigió hacia la pagina que obtiene el código, no hay nada que hacer.
|
||||
return null;
|
||||
@@ -42,16 +40,16 @@ export const AuthLogin = (props) => {
|
||||
return null;
|
||||
}
|
||||
|
||||
export const AuthLogout = (props) => {
|
||||
export const AuthLogout = () => {
|
||||
const [context, dispatch] = useStateValue();
|
||||
|
||||
if (!context.user.auth) {
|
||||
return <Redirect to='/'/>
|
||||
return <Redirect to={'/'}/>;
|
||||
}
|
||||
|
||||
logout(context.user.access_token).then(result => {
|
||||
console.log(result);
|
||||
logout(context.user.access_token).then(() => {
|
||||
dispatch({type: 'logout', user: {auth: false}})
|
||||
});
|
||||
|
||||
dispatch({type: 'logout', user: {auth: false}})
|
||||
return <Redirect to='/'/>
|
||||
return <Redirect to={'/'}/>;
|
||||
}
|
||||
|
||||
@@ -6,14 +6,14 @@ import Faker from 'faker';
|
||||
import './Comments.scss'
|
||||
|
||||
const Comment = (props) => (
|
||||
<div class='comment'>
|
||||
<div class='avatar-container'>
|
||||
<div className='comment'>
|
||||
<div className='avatar-container'>
|
||||
<img className='avatar' src={props.avatar} alt='Avatar'/>
|
||||
</div>
|
||||
<div className='body'>
|
||||
<span className='username'>{props.user}</span>
|
||||
<p>{props.text}</p>
|
||||
<div class='buttons'>
|
||||
<div className='buttons'>
|
||||
<button><FaThumbsUp/></button>
|
||||
<button><FaThumbsDown/></button>
|
||||
<button><FaLaughSquint/></button>
|
||||
|
||||
@@ -13,11 +13,11 @@ const EntityHeader = (props) => {
|
||||
const EntityPlaceholder = (props) => {
|
||||
return (
|
||||
<li className={'entity-item ' + (props.cover ? '' : 'pulsating')}>
|
||||
<div class="entity-container">
|
||||
<Link to={props.link}>
|
||||
<div className="entity-container">
|
||||
<Link to={'#'}>
|
||||
{props.cover && <div className='cover pulsating'/>}
|
||||
<div className='body'>
|
||||
<span class='title'> </span>
|
||||
<span className='title'> </span>
|
||||
<span className='subtitle'> </span>
|
||||
</div>
|
||||
</Link>
|
||||
@@ -30,16 +30,16 @@ const EntityItem = (props) => {
|
||||
const item = props.item;
|
||||
return (
|
||||
<li className={'entity-item ' + (item.selected ? 'selected' : '')} id={item.id}>
|
||||
<div class="entity-container">
|
||||
<div className="entity-container">
|
||||
<Link to={item.link}>
|
||||
{item.cover && item.cover}
|
||||
<div className='body'>
|
||||
<span class='title'>{item.title}</span>
|
||||
<span className='title'>{item.title}</span>
|
||||
<span className='subtitle'>{item.subtitle}</span>
|
||||
</div>
|
||||
</Link>
|
||||
{ item.widget &&
|
||||
<div class="widget">
|
||||
<div className="widget">
|
||||
{item.widget}
|
||||
</div>
|
||||
}
|
||||
@@ -59,7 +59,7 @@ export const EntityList = (props) => {
|
||||
}else{
|
||||
let mapped = props.list.map(group => {
|
||||
let header = group.header ? <EntityHeader title={group.header}/> : null;
|
||||
let items = group.items.map(item => <EntityItem item={item}/>);
|
||||
let items = group.items.map((item, index) => <EntityItem key={index} item={item}/>);
|
||||
items.unshift(header);
|
||||
return items;
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user