👌 IMPROVE: Commentaires sur profil en Markdown

This commit is contained in:
Divlo 2020-05-07 11:55:53 +02:00
parent 6c8e57540b
commit a2ee5e4f44
2 changed files with 8 additions and 3 deletions

View File

@ -10,6 +10,8 @@ import Modal from '../../components/Modal';
import redirect from '../../utils/redirect';
import htmlParser from 'html-react-parser';
import Loader from '../../components/Loader';
import ReactMarkdown from 'react-markdown';
import CodeBlock from "../../components/CodeBlock";
import api from '../../utils/api';
import { API_URL } from '../../utils/config/config';
import '../../public/css/pages/profile.css';
@ -179,18 +181,18 @@ const Profile = (props) => {
<div className="col-24 text-center">
<h2>Derniers <span className="important">commentaires</span> :</h2>
</div>
<div className="col-24 text-center">
<div className="col-24">
{props.commentsArray.map((comment) => (
<div key={comment.id} className="row Profile__row Profile__comment">
<div className="col-20">
<p>
<p style={{ textAlign: 'center', marginTop: '30px' }}>
Posté sur la fonction&nbsp;
<Link href={(comment.function.type === 'form' || comment.function.type === 'article') ? "/functions/[slug]" : `/functions/${comment.function.slug}`} as={`/functions/${comment.function.slug}`}>
<a>{comment.function.title}</a>
</Link>
&nbsp;le {date.format(new Date(comment.createdAt), 'DD/MM/YYYY à HH:mm', true)}
</p>
<p>"{comment.message}"</p>
<ReactMarkdown source={comment.message} renderers={{ code: CodeBlock }} />
</div>
</div>
))}

View File

@ -43,6 +43,9 @@ const Register = () => {
<div className="row Register-Login__row justify-content-center">
<div className="col-20">
<h1 className="Register-Login__title">S'inscrire</h1>
<div className="text-center">
<p>En vous inscrivant, vous accéderez à de nombreuses fonctionnalités : publier des commentaires, ajouter des fonctions aux favoris, utiliser certaines fonctions disponibles qu'aux membres (exemple: La To Do list) etc.</p>
</div>
<form onSubmit={handleSubmit}>
<div className="form-group">
<label className="form-label" htmlFor="name">Nom :</label>