easy-email-editor
easy-email-editor copied to clipboard
More documentation
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?
https://github.com/zalify/easy-email/pull/237 Check here. The latest version includes the feature you want.
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'
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!
Thank you! I’ll see if I can add some documentation when I’m a bit more familiar with the project and the codebase.
I fixed the type error. You only need to update to the latest version.
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'.
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