0.0.19 • Published 2 years ago

ml-topbar-apps v0.0.19

Weekly downloads
-
License
MIT
Repository
-
Last release
2 years ago

Ml Topbar Apps

Propriedades

Properties

PropriedadesAtributosDescriçãoTipoDefault
iconsColoricons-colorstring'#000'
showAppsshow-appsbooleantrue
showNotificationsshow-notificationsbooleantrue
showUsershow-userbooleantrue
user--IUserundefined

Como usar esse componente

React

  • Instalar o pacote no seu projeto. Ex: npm install ml-topbar-apps
  • Se o seu projeto foi criado utilizando o create-react-app você precisará executar a função defineCustomElements() no seu index.js. Caso a sua aplicação necessite ser executada no IE é necessário executar o applyPolyfills() também. Veja o exemplo abaixo.
import React from 'react';
import ReactDOM from 'react-dom';
import './index.css';
import App from './App';
import registerServiceWorker from './registerServiceWorker';

import { applyPolyfills, defineCustomElements } from 'ml-topbar-apps/loader';

ReactDOM.render(<App />, document.getElementById('root'));
registerServiceWorker();

applyPolyfills().then(() => {
  defineCustomElements();
});
  • Para o correto funcionamento é necessário encapsular o componente dentro de um componente React como o exemplo abaixo:
import React, { useRef, useEffect } from 'react'

const TopbarApps = ({ apps, user, iconsColor }) => {
  const elementRef = useRef(null)

  useEffect(() => {
    elementRef.current.user = user
    elementRef.current.iconsColor = iconsColor
  }, [apps, user])

  return <ml-topbar-apps ref={elementRef}></ml-topbar-apps>
}

export default TopbarApps
0.0.18

2 years ago

0.0.19

2 years ago

0.0.10

3 years ago

0.0.11

3 years ago

0.0.12

3 years ago

0.0.13

2 years ago

0.0.14

2 years ago

0.0.15

2 years ago

0.0.9

3 years ago

0.0.16

2 years ago

0.0.8

3 years ago

0.0.17

2 years ago

0.0.5

3 years ago

0.0.7

3 years ago

0.0.6

3 years ago

0.0.4

3 years ago

0.0.3

3 years ago

0.0.2

3 years ago

0.0.1

3 years ago