Zimbra / zimlet-cli

Client tool to Develop, Build, and Package Zimbra X compatible zimlets for development and production.
GNU General Public License v3.0
13 stars 5 forks source link

❓ About Zimlet deploy position #251

Open astatonn opened 2 months ago

astatonn commented 2 months ago

Hi everyone,

I don't know if this is the correct repository to ask about zimlets development but I created my zimlet using zimlet-cli but in my UI, my Zimlet isn't in the group of list item, it show as span tag. How can I join my zimlet as list item ?

image

My index.js is like this:

` import { createElement } from 'preact'; import { Text } from 'preact-i18n'; import { SLUG } from './constants'; import { withIntl } from './enhancers'; import App from './components/app'; import { MenuItem } from '@zimbra-client/components'; import { useClientConfig } from '@zimbra-client/hooks';

export default function Zimlet(context) { const { plugins } = context; const exports = {};

    // Register a new route with the preact-router instance
    function Router() {
            const { slugs } = useClientConfig({ slugs: 'routes.slugs' });
            return [<App path={`/${SLUG}`} />];
    }

    // Create a main nav menu item.
    // withIntl should be used on every component registered via plugins.register(). You will see this in t>
    const CustomMenuItemInner = () => {
            const { slugs } = useClientConfig({ slugs: 'routes.slugs' });
            return (
                    // List of components can be found in zm-x-web, zimlet-manager/shims.js, and more can b>
                    <MenuItem
                            responsive
                            icon='users'
                            href={`/${slugs.email}/${SLUG}`}
                    >
                    </MenuItem>
            );
    };

    const CustomMenuItem = withIntl()(CustomMenuItemInner);

    exports.init = function init() {
            // The zimlet slots to load into, and what is being loaded into that slot
            // (CustomMenuItem and Router are both defined below)
            plugins.register('slot::vertical-menu-item', CustomMenuItem);

            // Only needed if you need to create a new url route, like for a menu tab, or print, etc
            plugins.register('slot::routes', Router);
    };

    return exports;

}

`

My apologies if I created this issue at the wrong place.