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

❓ About Zimlet deploy position #251

Open
astatonn opened this issue Aug 20, 2024 · 0 comments
Open

❓ About Zimlet deploy position #251

astatonn opened this issue Aug 20, 2024 · 0 comments

Comments

@astatonn
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant