Skip to content

Commit

Permalink
[FIX] Errors
Browse files Browse the repository at this point in the history
  • Loading branch information
DylanSettbon committed Jul 19, 2019
1 parent 9ff3802 commit f32f226
Show file tree
Hide file tree
Showing 28 changed files with 133 additions and 44 deletions.
17 changes: 17 additions & 0 deletions client/build/asset-manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 1,17 @@
{
"files": {
"main.css": "/static/css/main.b46fcc6a.chunk.css",
"main.js": "/static/js/main.dc6c6fca.chunk.js",
"main.js.map": "/static/js/main.dc6c6fca.chunk.js.map",
"runtime~main.js": "/static/js/runtime~main.c5541365.js",
"runtime~main.js.map": "/static/js/runtime~main.c5541365.js.map",
"static/css/2.5dbdccff.chunk.css": "/static/css/2.5dbdccff.chunk.css",
"static/js/2.50a2472e.chunk.js": "/static/js/2.50a2472e.chunk.js",
"static/js/2.50a2472e.chunk.js.map": "/static/js/2.50a2472e.chunk.js.map",
"index.html": "/index.html",
"precache-manifest.0973af343b3a5e7951a39c1e0a8d249a.js": "/precache-manifest.0973af343b3a5e7951a39c1e0a8d249a.js",
"service-worker.js": "/service-worker.js",
"static/css/2.5dbdccff.chunk.css.map": "/static/css/2.5dbdccff.chunk.css.map",
"static/css/main.b46fcc6a.chunk.css.map": "/static/css/main.b46fcc6a.chunk.css.map"
}
}
Binary file added client/build/bg.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions client/build/index.html
Original file line number Diff line number Diff line change
@@ -0,0 1 @@
<!doctype html><html lang="en"><head><meta charset="utf-8"/><link rel="shortcut icon" href="/favicon.ico"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#000000"/><link rel="manifest" href="/manifest.json"/><title>React App</title><link href="/static/css/2.5dbdccff.chunk.css" rel="stylesheet"><link href="/static/css/main.b46fcc6a.chunk.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div><script>!function(l){function e(e){for(var r,t,n=e[0],o=e[1],u=e[2],f=0,i=[];f<n.length;f )t=n[f],p[t]&&i.push(p[t][0]),p[t]=0;for(r in o)Object.prototype.hasOwnProperty.call(o,r)&&(l[r]=o[r]);for(s&&s(e);i.length;)i.shift()();return c.push.apply(c,u||[]),a()}function a(){for(var e,r=0;r<c.length;r ){for(var t=c[r],n=!0,o=1;o<t.length;o ){var u=t[o];0!==p[u]&&(n=!1)}n&&(c.splice(r--,1),e=f(f.s=t[0]))}return e}var t={},p={1:0},c=[];function f(e){if(t[e])return t[e].exports;var r=t[e]={i:e,l:!1,exports:{}};return l[e].call(r.exports,r,r.exports,f),r.l=!0,r.exports}f.m=l,f.c=t,f.d=function(e,r,t){f.o(e,r)||Object.defineProperty(e,r,{enumerable:!0,get:t})},f.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},f.t=function(r,e){if(1&e&&(r=f(r)),8&e)return r;if(4&e&&"object"==typeof r&&r&&r.__esModule)return r;var t=Object.create(null);if(f.r(t),Object.defineProperty(t,"default",{enumerable:!0,value:r}),2&e&&"string"!=typeof r)for(var n in r)f.d(t,n,function(e){return r[e]}.bind(null,n));return t},f.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return f.d(r,"a",r),r},f.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},f.p="/";var r=window.webpackJsonp=window.webpackJsonp||[],n=r.push.bind(r);r.push=e,r=r.slice();for(var o=0;o<r.length;o )e(r[o]);var s=n;a()}([])</script><script src="/static/js/2.50a2472e.chunk.js"></script><script src="/static/js/main.dc6c6fca.chunk.js"></script></body></html>
26 changes: 26 additions & 0 deletions client/build/precache-manifest.0973af343b3a5e7951a39c1e0a8d249a.js
Original file line number Diff line number Diff line change
@@ -0,0 1,26 @@
self.__precacheManifest = (self.__precacheManifest || []).concat([
{
"revision": "9e1061330f65ce1f7a61a04ba7908a3c",
"url": "/index.html"
},
{
"revision": "8b19c5b01171397f6ed0",
"url": "/static/css/2.5dbdccff.chunk.css"
},
{
"revision": "028d9071d4081097ff3e",
"url": "/static/css/main.b46fcc6a.chunk.css"
},
{
"revision": "8b19c5b01171397f6ed0",
"url": "/static/js/2.50a2472e.chunk.js"
},
{
"revision": "028d9071d4081097ff3e",
"url": "/static/js/main.dc6c6fca.chunk.js"
},
{
"revision": "fdfcfda2d9b1bf31db52",
"url": "/static/js/runtime~main.c5541365.js"
}
]);
39 changes: 39 additions & 0 deletions client/build/service-worker.js
Original file line number Diff line number Diff line change
@@ -0,0 1,39 @@
/**
* Welcome to your Workbox-powered service worker!
*
* You'll need to register this file in your web app and you should
* disable HTTP caching for this file too.
* See https://goo.gl/nhQhGp
*
* The rest of the code is auto-generated. Please don't update this file
* directly; instead, make changes to your Workbox build configuration
* and re-run your build process.
* See https://goo.gl/2aRDsh
*/

importScripts("https://storage.googleapis.com/workbox-cdn/releases/4.3.1/workbox-sw.js");

importScripts(
"/precache-manifest.0973af343b3a5e7951a39c1e0a8d249a.js"
);

self.addEventListener('message', (event) => {
if (event.data && event.data.type === 'SKIP_WAITING') {
self.skipWaiting();
}
});

workbox.core.clientsClaim();

/**
* The workboxSW.precacheAndRoute() method efficiently caches and responds to
* requests for URLs in the manifest.
* See https://goo.gl/S9QRab
*/
self.__precacheManifest = [].concat(self.__precacheManifest || []);
workbox.precaching.precacheAndRoute(self.__precacheManifest, {});

workbox.routing.registerNavigationRoute(workbox.precaching.getCacheKeyForURL("/index.html"), {

blacklist: [/^\/_/,/\/[^\/] \.[^\/] $/],
});
2 changes: 2 additions & 0 deletions client/build/static/css/2.5dbdccff.chunk.css

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions client/build/static/css/2.5dbdccff.chunk.css.map

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions client/build/static/css/main.b46fcc6a.chunk.css

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions client/build/static/css/main.b46fcc6a.chunk.css.map

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions client/build/static/js/2.50a2472e.chunk.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions client/build/static/js/2.50a2472e.chunk.js.map

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions client/build/static/js/main.dc6c6fca.chunk.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions client/build/static/js/main.dc6c6fca.chunk.js.map

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions client/build/static/js/runtime~main.c5541365.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions client/build/static/js/runtime~main.c5541365.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion client/src/components/Advice/AdviceCard.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 13,7 @@ export default function AdviceCard(props) {
<Container>
<div className="columns">
<div className="column col-6">
<img className="float-left" src={userImg}/>
<img className="float-left" alt="" src={userImg}/>
<h4 style={{marginLeft: 16, display: "inline-block"}}>{props.advice.title}</h4>
</div>
<BookNotation className="column col-6 float-right" notation={notation} readonly/>
Expand Down
13 changes: 5 additions & 8 deletions client/src/components/Advice/GiveAdviceCard.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 14,8 @@ export default function GiveAdviceCard(props) {
useEffect(() => { // ComponentDidMount
init(); // Fix
const userId = JSON.parse(sessionStorage.getItem('logged'));
const advice = props.advices.filter(advice => advice.userId == userId)[0]
if(!(advice == undefined)){
const advice = props.advices.filter(advice => advice.userId === userId)[0]
if(!(advice === undefined)){
setId(advice._id)
setTitle(advice.title);
setText(advice.description);
Expand All @@ -39,6 39,8 @@ export default function GiveAdviceCard(props) {
case 'text':
setText(newValue)
break;
default:
break;
}
};

Expand Down Expand Up @@ -66,7 68,7 @@ export default function GiveAdviceCard(props) {
<Container className="card" style={{width: "100%"}}>
<form className="card-body" onSubmit={handleSubmit}>
<div className="form-group">
<img src={userImg} width="84px" className="p-centered mb-2"/>
<img src={userImg} alt="" width="84px" className="p-centered mb-2"/>
<BookNotation style={{width: "fit-content", margin: "24px auto"}} setScore={setScore} score={score}/>
<input className="form-input mb-2" type="text" id="title" name="title" onChange={handleChange} value={title} placeholder="Titre d'avis" required/>
<textarea placeholder="Decrivez votre experience de lecture" className="form-input mb-2" value={text} type="text" id="text" name="text" onChange={handleChange} required/>
Expand All @@ -83,8 85,3 @@ const Container = styled.div`
overflow: hidden;
`

const Title = styled.h2`
`

const Description = styled.div`
`
6 changes: 3 additions & 3 deletions client/src/components/Advice/PersonnalAdviceCard.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 14,7 @@ export default function PersonnalAdviceCard(props) {
useEffect(() => { // ComponentDidMount
context.findBook(advice.bookId);
ref.current = true;
}, []);
}, [advice.bookId]);

const notation = {
note: advice.score,
Expand All @@ -25,12 25,12 @@ export default function PersonnalAdviceCard(props) {
<Container>
{!(advice == null)?
<>
{!(context.book.book == undefined)?
{!(context.book.book === undefined)?
<BookImage img={context.book.book.image}></BookImage>: null
}
<div className="columns">
<div className="column col-6">
<img className="float-left" src={userImg}/>
<img className="float-left" alt="" src={userImg}/>
<h4 style={{marginLeft: 16, display: "inline-block"}}>{advice.title}</h4>
</div>
<BookNotation className="column col-6 float-right" notation={notation} note={advice.note} readonly/>
Expand Down
2 changes: 1 addition & 1 deletion client/src/components/Book/Attribute/AddToFavorite.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 11,7 @@ export default function AddToFavorite({ book }) {
if (user.like) {
if (user.like.includes(book._id)) setLiked(true);
} else setLiked(false);
}, []);
}, [book._id]);

const handleFavorite = () => {
context.handleFavorite(book._id,liked);
Expand Down
4 changes: 2 additions & 2 deletions client/src/components/Book/Attribute/BookNotation.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 28,8 @@ export default function BookNotation(props) {
<Div style={{marginTop: 12, float: "left"}}>
<Rating
name="Rating"
emptySymbol={<img src={starEmpty} className="icon" />}
fullSymbol={<img src={starFull} className="icon" />}
emptySymbol={<img src={starEmpty} alt="" className="icon" />}
fullSymbol={<img src={starFull} alt="" className="icon" />}
onChange={handleChange}
initialRating = {rating}
readonly = {isReadOnly}/>
Expand Down
7 changes: 4 additions & 3 deletions client/src/components/Book/Book.js
Original file line number Diff line number Diff line change
@@ -1,4 1,4 @@
import React,{useContext,useEffect,useRef} from 'react';
import React,{useContext,useEffect} from 'react';
import BookContext from '../../context/BookContext'
import BookCard from './BookCard';
import styled from 'styled-components';
Expand All @@ -10,7 10,8 @@ export default function Book({ match }) {

useEffect(() => { // ComponentDidMount
context.findBook(match.params.id)
}, []);
}, [match.params.id]);


if(context.book.book === undefined) return <div></div>

Expand All @@ -25,7 26,7 @@ export default function Book({ match }) {
</div>
</div>
<div style={{marginTop: 40}} className="divider"/>
<div style={{marginTop: 32}} className="columns" style={{width: "100%"}}>
<div style={{marginTop: 32,width: "100%"}} className="columns">
<div className="columns" style={{width: "100%"}}>
<div style={{marginTop: 32}} className="column col-12 mb-2">
<h3>Avis des utilisateurs</h3>
Expand Down
2 changes: 1 addition & 1 deletion client/src/components/Book/BookList.js
Original file line number Diff line number Diff line change
@@ -1,4 1,4 @@
import React,{useContext,useEffect, useState} from 'react';
import React,{} from 'react';
import styled from 'styled-components'
import BookCard from '../Book/BookCard'

Expand Down
Loading

0 comments on commit f32f226

Please sign in to comment.