Skip to content

Commit

Permalink
Merge pull request #1157 from EcrituresNumeriques/fix/articles-count
Browse files Browse the repository at this point in the history
Simplifie l'affichage du comptage d'articles
  • Loading branch information
thom4parisot authored Dec 12, 2024
2 parents 73960ea + 45ad78c commit f1bae73
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
11 changes: 5 additions & 6 deletions front/src/components/Articles.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import {
Loading,
Modal as GeistModal,
useModal,
Button as GeistButton,
} from '@geist-ui/core'
import React, { useCallback, useEffect, useMemo, useState } from 'react'
import { useTranslation } from 'react-i18next'
Expand All @@ -19,6 +18,7 @@ import ArticleCreate from './ArticleCreate.jsx'

import styles from './articles.module.scss'
import Field from './Field'
import Button from './Button.jsx'
import { useActiveUserId } from '../hooks/user'
import WorkspaceLabel from './workspace/WorkspaceLabel.jsx'
import { useActiveWorkspace } from '../hooks/workspace.js'
Expand Down Expand Up @@ -254,16 +254,15 @@ export default function Articles() {

<div className={styles.articlesTableHeader}>
{!activeWorkspaceId && (
<GeistButton
type="secondary"
className={styles.button}
<Button
primary
onClick={() => setCreateArticleVisible(true)}
>
{t('article.createAction.buttonText')}
</GeistButton>
</Button>
)}
<div className={styles.articleCounter}>
{keepArticles.length} article{keepArticles.length > 1 ? 's' : ''}
{t('article.count', { count: keepArticles.length })}
</div>
</div>

Expand Down
3 changes: 3 additions & 0 deletions front/src/locales/en/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@
"workspace.createNew.button": "Create a workspace",
"time.fewSecondsAgo": "a few seconds ago",
"search.placeholder": "Search",
"article.count_zero": "no article",
"article.count_one": "{{ count }} article",
"article.count_other": "{{ count }} articles",
"article.createModal.title": "Create an article",
"article.createAction.buttonText": "Create an article",
"article.createForm.buttonTitle": "Create a new article",
Expand Down
3 changes: 3 additions & 0 deletions front/src/locales/fr/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@
"workspace.createNew.button": "Créer un espace de travail",
"time.fewSecondsAgo": "à lʼinstant",
"search.placeholder": "Recherche",
"article.count_zero": "aucun article",
"article.count_one": "{{ count }} article",
"article.count_other": "{{ count }} articles",
"article.createModal.title": "Créer un article",
"article.createAction.buttonText": "Créer un article",
"article.createForm.buttonTitle": "Créer un nouvel article",
Expand Down

0 comments on commit f1bae73

Please sign in to comment.