Skip to content

Commit

Permalink
fix(articles): unifie formulaire modale pour la création d'article
Browse files Browse the repository at this point in the history
  • Loading branch information
thom4parisot committed Dec 12, 2024
1 parent 73960ea commit 126d508
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 15 deletions.
14 changes: 1 addition & 13 deletions front/src/components/ArticleCreate.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ export default function ArticleCreate({ onSubmit }) {

return (
<section>
<form onSubmit={handleSubmit} className={styles.form}>
<form onSubmit={handleSubmit} className={styles.form} id="article-create-form">
<Field
ref={titleInputRef}
{...titleBindings}
Expand All @@ -111,18 +111,6 @@ export default function ArticleCreate({ onSubmit }) {
</ul>
</div>
)}
<ul className={styles.actions}>
<li>
<Button
type="secondary"
className={styles.button}
title={t('article.createForm.buttonTitle')}
onClick={handleSubmit}
>
{t('article.createForm.buttonText')}
</Button>
</li>
</ul>
</form>
</section>
)
Expand Down
4 changes: 4 additions & 0 deletions front/src/components/Articles.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import Article from './Article'
import ArticleCreate from './ArticleCreate.jsx'

import styles from './articles.module.scss'
import buttonStyles from './button.module.scss'
import Field from './Field'
import { useActiveUserId } from '../hooks/user'
import WorkspaceLabel from './workspace/WorkspaceLabel.jsx'
Expand Down Expand Up @@ -282,6 +283,9 @@ export default function Articles() {
>
{t('modal.close.text')}
</GeistModal.Action>
<GeistModal.Action type="submit" form="article-create-form" className={buttonStyles.primary}>
{t('article.createForm.buttonText')}
</GeistModal.Action>
</GeistModal>

{isLoading ? (
Expand Down
4 changes: 2 additions & 2 deletions front/src/components/button.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,8 @@ a.icon:not(.primary) {
.primary {
@extend .button;

background-color: #000;
color: #fff;
background-color: #000 !important;
color: #fff !important;
border: 1px solid #000;

&:disabled {
Expand Down

0 comments on commit 126d508

Please sign in to comment.