aboutsummaryrefslogtreecommitdiffstats
path: root/src/components/organisms/forms
Commit message (Collapse)AuthorAgeFilesLines
* fix(styles): increase CSS specifity for some selectorsArmand Philippot2023-12-201-27/+28
| | | | | | | | | | | Since `sideEffects` has been added to activate tree shakings, the styles are imported in the wrong order in production build. There is an open issue (again) on Next.js repo. I'm not sure it will be fixed soon so in the meantime I had to increase the specifity of some selectors to avoid broken styles. I also fixed two minor layout errors: * CV page widgets should use headings of level 2 * Homepage should wrap the cards in list items
* fix(components): prevent search form overflow on small devicesArmand Philippot2023-12-191-0/+4
|
* fix(build): handle Next.js errors and warnings during buildArmand Philippot2023-12-161-1/+5
| | | | | | | | | | | | * extract Blog component from BlogPage (paginated) and extract Article component from ArticlePage to avoid `Cannot read properties` errors due to fallback route * fix sitemap build (cjs not supported) * fix eslint warnings (react/jsx-no-literals) * update `start` script since I'm using standalone output * update `postbuild` script since we need to copy public and static files to standalone directory (Next.js does not handle it itself because we should use a CDN...)
* refactor(stories): migrate stories to CSF3 formatArmand Philippot2023-12-1516-228/+160
|
* refactor(components): split Layout component in smaller componentsArmand Philippot2023-11-222-59/+66
| | | | | The previous component was too long and hardly readable. So I splitted it in different part and added tests.
* refactor(components): replace items prop in Navbar componentArmand Philippot2023-11-212-5/+44
| | | | | | | | | | | | | | * replace `items` prop with `children` prop: it is more readable this way, * handle navbar item state inside NavbarItem component: it avoid using three differents states and their methods to do exactly the same thing * remove useAutofocus hook since we can't use it anymore * add `onActivation` and `activationHandlerDelay` prop to NavbarItem component to be able to focus the search input only when the item is activated (it replicates the functioning of useAutofocus hook) * replace `ref` type in SearchForm component: it does not make sense to use an input ref for a form. Instead I use useImperativeHandle to provide different a focus method to the given ref.
* fix: generate an id for each headings in the page main contentsArmand Philippot2023-11-181-1/+1
| | | | | | | | | | | | | | | | | | | | Since #be4d907 the ids was no longer addded to headings in useHeadingsTree hook. It was a bad practice to manipulate the DOM that way. However, I did not move the implementation elsewhere... To fix this, I now use rehype-slug on both markdown contents and html string coming from WordPress. I'm not sure the dynamic imports are really useful here since the table of contents is on almost all pages but Jest was failing with regular import because of ESM. It is the only thing that makes the tests functional again so... However if we want to test the `updateContentTree` function, Jest fails for the same reason. So I decided to not test this function. I've already spend too much time on this issue. Another problem: the ToC on projects page. Currently we use the ref on the body but the page contents are imported dynamically so the hook is executed before the contents are loaded. It makes the ToC empty... We should refactor the pages so we can use the ref directly on the imported contents.
* refactor(components): rewrite CommentForm componentArmand Philippot2023-11-114-312/+304
| | | | | | * remove `Notice` prop to handle it directly in the form * replace `saveComment` prop with `onSubmit` * use `useForm` hook to handle the form
* refactor(components): rewrite ContactForm componentArmand Philippot2023-11-114-254/+308
| | | | | | * remove `Notice` props to handle it directly inside the form * replace `sendMail` prop with `onSubmit` prop * use `useForm` hook to handle fields
* refactor(components): rewrite SearchForm componentArmand Philippot2023-11-114-117/+133
| | | | | | * remove searchPage prop (the consumer should handle the submit) * change onSubmit type * use `useForm` hook to handle the form
* refactor(components): replace Toolbar with Navbar componentArmand Philippot2023-11-111-2/+4
| | | | | | | | * remove SearchModal and SettingsModal components * add a generic NavbarItem component (instead of the previous toolbar items to avoid unreadable styles...) * move FlippingLabel component logic into NavbarItem since it is only used here
* refactor(components): extract SettingsForm component form SettingsModalArmand Philippot2023-11-1132-423/+584
| | | | | | We could use an array of items and map over it instead of repeating the Switch component for each settings but with translations, it becomes quickly unreadable. So I prefer to keep separate components.
* feat(hooks): add useBoolean and useToggle hooksArmand Philippot2023-11-113-22/+29
|
* refactor(providers,hooks): rewrite PrismThemeProvider & usePrismThemeArmand Philippot2023-11-111-22/+5
| | | | | | * reuse Theme provider logic * move DOM mutation from provider to hook * add a script to init theme before page load
* feat: replace next-themes with a custom ThemeProviderArmand Philippot2023-11-111-11/+4
| | | | | | | To be honest, next-themes was working fine. However since I use a theme provider for Prism code blocks, some code is duplicated between this app and the library. So I prefer to use a custom Provider without the options I don't need.
* refactor(hooks,provider): move reduce motion setterArmand Philippot2023-11-114-69/+9
| | | | | | | | | | Since the local storage key is not meant to change between the components, it should be set directly inside the app file. So both the local storage and the data attribute should be handle in a provider. I also added a custom document because we need a script to retrieve the stored value in local storage earlier to avoid flashing on hydration.
* refactor(hooks,providers): rewrite useAckee hook and AckeeProviderArmand Philippot2023-11-114-54/+10
|
* refactor(hooks): rewrite useLocalStorage hookArmand Philippot2023-11-112-5/+13
| | | | | | | * return a tuple instead of an object * add a validator function as parameter (if the stored value is manually changed, it is not safe to cast its type) * add tests
* refactor(components): make form components compliant with Eslint rulesArmand Philippot2023-11-1118-43/+57
|
* refactor(components): rewrite List componentArmand Philippot2023-11-111-30/+27
| | | | | | | | | * change `items` prop to children * replace `kind` prop with `isHierarchical`, `isOrdered` & `isInline` props * add `hideMarker` prop * add `spacing` prop to control item spacing * move lists styles to Sass placeholders to avoid repeats because of headless WordPress
* refactor(components): rewrite Spinner componentArmand Philippot2023-10-242-60/+71
| | | | | | | * Message should be set as children * Default message is no longer available (depending on use case, the consumer might prefer aria-label instead) * It is now possible to define the message position
* feat(components): replace icons with a generic Icon componentArmand Philippot2023-10-243-28/+46
| | | | | Sizes are also predefined and can be set using the `size` prop, so the consumers should no longer adjust the size in CSS.
* refactor(components): rewrite Heading componentArmand Philippot2023-10-242-56/+72
| | | | | | | | | * remove `alignment` and `withMargin` props (consumer should handle that) * move styles to Sass placeholders to avoid repeats with headings coming from WordPress * refactor some other components that depend on Heading to avoid ESlint errors
* build: convert project to esmArmand Philippot2023-10-247-0/+7
|
* refactor(components): rewrite form componentsArmand Philippot2023-10-2437-249/+1007
|
* refactor: use named export for everything except pagesArmand Philippot2023-09-2010-76/+71
| | | | | | 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-197-22/+22
| | | | | | 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.
* fix(settings): avoid cropped tooltip on small devicesArmand Philippot2022-06-094-293/+0
| | | | | | I changed the settings disposition to make tooltip positioning easier. Jest complains about ref passed but everything seems to work as expected so I'm not sure it is relevant. Maybe a bug with cloneElement.
* test: install and configure cypressArmand Philippot2022-06-024-4/+4
| | | | I also configure Jest to avoid conflicts between Cypress and Jest.
* chore: replace the Ackee select by a toggle componentArmand Philippot2022-06-014-41/+49
|
* chore: replace the toggle componentArmand Philippot2022-06-014-21/+81
|
* fix(settings): reduce font-size on small devicesArmand Philippot2022-05-252-4/+28
| | | | | With French translation, words are a little longer so I reduce the font size on small devices to avoid line breaking.
* chore: give autofocus to the toolbar search formArmand Philippot2022-05-241-9/+15
|
* chore: complete Storybook storiesArmand Philippot2022-05-214-8/+54
|
* chore: handle settings changeArmand Philippot2022-05-182-11/+59
|
* chore: close toolbar modals on click/focus outsideArmand Philippot2022-05-184-0/+133
|
* chore: adjust articles stylesArmand Philippot2022-05-171-3/+11
| | | | | * change animation on article card hover * change comments section alignment
* chore: adjust and complete missing stylesArmand Philippot2022-05-161-8/+4
| | | | | | * add logo to topics pages and links * add Prism styles to articles * and a few other adjustements
* chore: add Article pagesArmand Philippot2022-05-153-17/+39
|
* chore: add Search pageArmand Philippot2022-05-153-13/+14
|
* chore: add a Contact pageArmand Philippot2022-05-073-7/+17
|
* refactor(storybook): reorganize design systemArmand Philippot2022-04-203-27/+79
| | | | | Add more stories for each components and change some components categories for better organization.
* refactor: support React 18Armand Philippot2022-04-164-8/+12
| | | | | | | | I replaced the deprecated VFC type with FC type and made all children explicits. Formatjs is still not compatible with React 18 so I need to skip type checking when comitting. There are some type errors because of IntlProvider in Storybook stories.
* chore: add a ContactForm componentArmand Philippot2022-04-154-0/+263
|
* chore: add a CommentForm componentArmand Philippot2022-04-154-0/+288
|
* chore: add a SearchForm componentArmand Philippot2022-04-144-0/+165