aboutsummaryrefslogtreecommitdiffstats
path: root/src/components/organisms/layout/comment.tsx
Commit message (Collapse)AuthorAgeFilesLines
* refactor(components): split Comment component into 3 componentsArmand Philippot2023-11-111-189/+0
| | | | | | | | | * add ApprovedComment, PendingComment and ReplyCommentForm components * let consumer handle reply form visibility * move structured data into article page (each article already has the comments data and already handle json ltd schema so I prefered to move the schema in the final consumer instead of adding a script element foreach comment)
* refactor(components): rewrite CommentForm componentArmand Philippot2023-11-111-9/+9
| | | | | | * remove `Notice` prop to handle it directly in the form * replace `saveComment` prop with `onSubmit` * use `useForm` hook to handle the form
* feat(hooks): add useBoolean and useToggle hooksArmand Philippot2023-11-111-9/+4
|
* refactor(components): rewrite Card componentArmand Philippot2023-11-111-53/+68
| | | | | | | | | | | | | * make the component more generic * merge `<Summary />` and `<Comment />` styles into card component to avoid repeating the same structure * remove most of the props to use composition However the CSS is a bit complex because of the two variants... Also, the component should be refactored when the CSS pseudo-class `:has` has enough support: the provider and the `cover` and `meta` props should be removed.
* feat(components): add a Time componentArmand Philippot2023-11-111-18/+2
| | | | | | Instead of using helpers functions to format the date each time we need to use a time element, it makes more sense to create a new component dedicated to this task.
* refactor(components): replace Meta component with MetaListArmand Philippot2023-11-111-9/+32
| | | | | | It removes items complexity by allowing consumers to use any label/value association. Translations should also be defined by the consumer. Each item can now be configured separately (borders, layout...).
* refactor(components): rewrite DescriptionList componentArmand Philippot2023-11-111-22/+21
| | | | | | | | | | | | | * add a `spacing` prop * replace `layout` prop with `isInline` prop * remove `items` prop (and classNames props) in favor of new components: Description, Group, Term * remove `withSeparator` prop (CSS content is announced by screen readers and Firefox/Safari have no support for alternative text so the consumer should add itself an element with `aria-hidden` if it need a separator) Be aware, Meta component and its consumers can be visually broken, they should be refactored before using them in production.
* refactor: use named export for everything except pagesArmand Philippot2023-09-201-15/+12
| | | | | | Next expect a default export for pages so only those components should use default exports. Everything else should use named exports to reduce the number of import statements.
* refactor(build): replace paths aliases with relative pathsArmand Philippot2023-09-191-5/+5
| | | | | | Using paths aliases starting with "@" can be confusing and can lead to conflict with existings modules. I prefer to use relative paths to avoid extra configuration in tools because of these aliases.
* chore: make Links and Images compliant with Next.js 13Armand Philippot2023-01-231-6/+11
|
* fix(comments): load all comments on a postArmand Philippot2022-08-211-2/+2
| | | | | | | | | Previously, only the first 10 comments was loaded. So I update the fetching method to retrieve all the comments on a post. Also, I choose to order comments on client side because of a bug with WPGraphQL. Finally, I renamed the Comment type to SingleComment to avoid conflict with existing types.
* test: fix theme toggle and comment testsArmand Philippot2022-05-241-25/+2
|
* refactor: reduce the number of data transformationArmand Philippot2022-05-231-49/+49
|
* chore: add Article pagesArmand Philippot2022-05-151-6/+8
|
* refactor: rewrite DescriptionList and Meta componentsArmand Philippot2022-05-091-31/+52
| | | | | | The meta can have different layout. The previous implementation was not enough to easily change the layout. Also, I prefer to restrict the meta types and it prevents me to repeat myself for the labels.
* chore: add a CommentsList componentArmand Philippot2022-04-221-4/+0
|
* chore: add a Comment componentArmand Philippot2022-04-211-0/+175