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

More documentation #249

Open
thijs-qv opened this issue Feb 22, 2023 · 7 comments
Open

More documentation #249

thijs-qv opened this issue Feb 22, 2023 · 7 comments
Labels
documentation Improvements or additions to documentation good first issue Good for newcomers

Comments

@thijs-qv
Copy link

Can there please be more documentation added to the project? There are all sorts of cool options and things available but it's difficult to find information on them.

e.g.
I'd like to hide the "subject" and "subtitle" input boxes in the AttributesPanel. I can see that the Page block of the AttributesPanel has the following props}

interface PageProps { hideSubTitle?: boolean; hideSubject?: boolean}

How would I pass these options via the EmailEditor / EmailEditorProvider props?

@m-Ryan
Copy link
Collaborator

m-Ryan commented Feb 22, 2023

#237
Check here.
The latest version includes the feature you want.

@thijs-qv
Copy link
Author

Great, thanks! I don't want to sound ungrateful, but is this documented somewhere? I had to look through the pull request comments in order to figure it out. I'm also getting a type error so maybe I'm still doing something wrong? (the inputs are hidden now though so that's great)

I'm setting the config as follows:

const DefaultPageConfigPanel = BlockAttributeConfigurationManager.get(
  BasicType.PAGE
);
BlockAttributeConfigurationManager.add({
  // @ts-ignore
  [BasicType.PAGE]: () => <DefaultPageConfigPanel hideSubject hideSubTitle />,
});

the type error I get is

Type '() => JSX.Element' is not assignable to type 'ReactNode'

@wilau2 wilau2 added enhancement New feature or request good first issue Good for newcomers labels Feb 22, 2023
@wilau2
Copy link
Collaborator

wilau2 commented Feb 22, 2023

Hey @thijs-qv,
I'll double-check the typing issue this PM with my project I did not have it running the demo.

Feel free to open a PR for additional documentation; contributions are always welcomed!

@thijs-qv
Copy link
Author

Thank you! I’ll see if I can add some documentation when I’m a bit more familiar with the project and the codebase.

@m-Ryan
Copy link
Collaborator

m-Ryan commented Feb 24, 2023

I fixed the type error. You only need to update to the latest version.

image

@wilau2 wilau2 added documentation Improvements or additions to documentation and removed enhancement New feature or request labels Feb 24, 2023
@applibs
Copy link

applibs commented Apr 4, 2023

When I use this config I see message:

TS2322: Type '{ hideSubject: true; hideSubTitle: true; }' is not assignable to type 'IntrinsicAttributes'.   Property 'hideSubject' does not exist on type 'IntrinsicAttributes'.

@makavelithadon
Copy link

Hi,

I managed to fix the issue by setting the returned type of BlockAttributeConfigurationManager.get(...) to typeof DefaultPageConfigPanel that comes from easy-email-extensions, here's an example :

const MyDefaultPageConfigPanel: typeof DefaultPageConfigPanel =
	BlockAttributeConfigurationManager.get(BasicType.PAGE);
BlockAttributeConfigurationManager.add({
	[BasicType.PAGE]: () => <DefaultPageConfigPanel hideSubject hideSubTitle />,
});

Hope this helps

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

5 participants