Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor/modal #1048

Merged
merged 1 commit into from
Aug 6, 2024
Merged

Refactor/modal #1048

merged 1 commit into from
Aug 6, 2024

Conversation

MartinWeb
Copy link
Contributor

Related issue

Bug

Person(s) for reviewing proposed changes

@arnaudforaison @samuel-gomez @JLou @buddyvegas

Important

This pull request introduces breaking changes :

  • the isOpen property has been removed to match the way of using the dialog element. We do not change visibility of the element anymore, we directly call the showModal or close functions to open and close the dialog
  • related to that, i didn't find a way to continue the export of Modal.Header, Modal.Body, etc.... because of the usage of forwardRef. Instead i directly use Header, Body, etc... If someone has a way to make it work i am open to suggestion :)

@@ -5,7 +5,7 @@ import '../packages/all/dist/style/af-toolkit-core.css';
import '../packages/core/dist/assets/fonts/icons/af-icons.css';
import './storybook.css';

export const decorators = [addReadme];
// export const decorators = [addReadme];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why comment an export and not delete it if it's no longer used ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

import { useRef } from 'react';

export const YourComponent = () => {
const ref = useRef < HTMLDialogElement > null;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
const ref = useRef < HTMLDialogElement > null;
const ref = useRef<HTMLDialogElement>(null);


### Use
export const YourComponent = () => {
const ref = useRef < HTMLDialogElement > null;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
const ref = useRef < HTMLDialogElement > null;
const ref = useRef<HTMLDialogElement>(null);

@MartinWeb MartinWeb changed the base branch from release/3.0.0 to master April 11, 2024 13:25
@MartinWeb MartinWeb force-pushed the refactor/modal branch 3 times, most recently from 424b469 to c2404f2 Compare April 12, 2024 09:07
@MartinWeb MartinWeb merged commit 7043988 into AxaFrance:master Aug 6, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants