📦 NEW: Profil dernières citations proposées

This commit is contained in:
Divlo
2020-04-22 22:01:18 +02:00
parent 43add978b6
commit 032ef566c7
8 changed files with 84 additions and 53 deletions

View File

@ -135,28 +135,28 @@ const manageCategories = (props) => {
</div>
<div className="row justify-content-center">
<div className="container-fluid">
<div className="col-24 Admin__table-column">
<table className="Admin__table">
<div className="col-24 table-column">
<table className="table">
<thead>
<tr>
<th className="Admin__table-row Admin__table-head-row" scope="col">id</th>
<th className="Admin__table-row Admin__table-head-row" scope="col">name</th>
<th className="Admin__table-row Admin__table-head-row" scope="col">color</th>
<th className="Admin__table-row Admin__table-head-row" scope="col">createdAt</th>
<th className="Admin__table-row Admin__table-head-row" scope="col">updatedAt</th>
<th className="Admin__table-row Admin__table-head-row" scope="col">Modifier</th>
<th className="Admin__table-row Admin__table-head-row" scope="col">Supprimer</th>
<th className="table-row" scope="col">id</th>
<th className="table-row" scope="col">name</th>
<th className="table-row" scope="col">color</th>
<th className="table-row" scope="col">createdAt</th>
<th className="table-row" scope="col">updatedAt</th>
<th className="table-row" scope="col">Modifier</th>
<th className="table-row" scope="col">Supprimer</th>
</tr>
</thead>
<tbody>
{categories.map((category) => {
return (
<tr key={category.id} style={{ backgroundColor: category.color }}>
<td className="Admin__table-row">{category.id}</td>
<td className="Admin__table-row">{category.name}</td>
<td className="Admin__table-row">{category.color}</td>
<td className="Admin__table-row">{date.format(new Date(category.createdAt), 'DD/MM/YYYY à HH:mm', true)}</td>
<td className="Admin__table-row">{date.format(new Date(category.updatedAt), 'DD/MM/YYYY à HH:mm', true)}</td>
<td className="table-row">{category.id}</td>
<td className="table-row">{category.name}</td>
<td className="table-row">{category.color}</td>
<td className="table-row">{date.format(new Date(category.createdAt), 'DD/MM/YYYY à HH:mm', true)}</td>
<td className="table-row">{date.format(new Date(category.updatedAt), 'DD/MM/YYYY à HH:mm', true)}</td>
<td style={{ cursor: 'pointer' }} onClick={() => handleEditCategory({ name: category.name, color: category.color, id: category.id })}>
<FontAwesomeIcon icon={faPen} style={{ width: '1.5rem' }} />
</td>

View File

@ -67,32 +67,32 @@ const manageQuotes = (props) => {
</div>
<div className="row" style={{ marginBottom: '30px' }}>
<div className="col-24 Admin__table-column">
<table className="Admin__table">
<div className="col-24 table-column">
<table className="table">
<thead>
<tr>
<th className="Admin__table-row" scope="col">Citation/Proverbe</th>
<th className="Admin__table-row" scope="col">Auteur</th>
<th className="Admin__table-row" scope="col">Proposée par</th>
<th className="Admin__table-row" scope="col">Valider</th>
<th className="Admin__table-row" scope="col">Supprimer</th>
<th className="table-row" scope="col">Citation/Proverbe</th>
<th className="table-row" scope="col">Auteur</th>
<th className="table-row" scope="col">Proposée par</th>
<th className="table-row" scope="col">Valider</th>
<th className="table-row" scope="col">Supprimer</th>
</tr>
</thead>
<tbody>
{quotesData.rows.map((currentQuote, index) => {
const quoteJSX = (
<Fragment>
<td className="Admin__table-row text-center">{currentQuote.quote}</td>
<td className="Admin__table-row text-center">{currentQuote.author}</td>
<td className="Admin__table-row text-center">
<td className="table-row text-center">{currentQuote.quote}</td>
<td className="table-row text-center">{currentQuote.author}</td>
<td className="table-row text-center">
<Link href={"/profile/[name]"} as={`/profile/${currentQuote.user.name}`}>
<a>{currentQuote.user.name}</a>
</Link>
</td>
<td onClick={() => handleValidationQuote(currentQuote.id, true)} className="Admin__table-row text-center" style={{ cursor: 'pointer' }}>
<td onClick={() => handleValidationQuote(currentQuote.id, true)} className="table-row text-center" style={{ cursor: 'pointer' }}>
<FontAwesomeIcon icon={faCheck} style={{ width: '1.5rem' }} />
</td>
<td onClick={() => handleValidationQuote(currentQuote.id, false)} className="Admin__table-row text-center" style={{ cursor: 'pointer' }}>
<td onClick={() => handleValidationQuote(currentQuote.id, false)} className="table-row text-center" style={{ cursor: 'pointer' }}>
<FontAwesomeIcon icon={faTrash} style={{ width: '1.5rem' }} />
</td>
</Fragment>