2.0.1 • Published 5 years ago

@blueeast/bluerain-plugin-taskbar v2.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
5 years ago

Bluerain Plugin Taskbar

Adds Taskbar plugin .https://blueeast.gitbook.io/bluerain-plugin-taskbar

🌏 Web🖥 Electron📱 React Native
✔️✔️✔️
TypeExample 1Example 2
Webtaskbartaskbar
ElectronTBDTBD
NativeTBDTBD

Installation

Run the following command in the plugin directoy:

yarn add @blueeast/bluerain-plugin-taskbar

Hooks

This plugin provides flexibility of adding Internationalisation in App

bluerain.system.app.layout

This hook gives the ability to modify the main System App component that gets wrapped in react-router-redux's ConnectedRouter.

Parameters:

NameTypeDescription
schemaReact.Componentprovides taskbar in schema

Returns:

NameTypeDescription
schemaReact.ComponentAdds the taskbar component in the system layout

Example

ctx.Filters.add('bluerain.system.app.layout', function taskbar(schema) {
 schema.children.unshift({ component: withSystemNav(Taskbar) });
  return schema;
});

ctx.Filters.add('bluerain.redux.reducers.bluerain', function  
 AddSystemNavReducers(reducers) {
  return Object.assign({}, reducers, {
  systemNav: reducer
});
});

bluerain.redux.reducers.bluerain

This hook gives the ability to add redux reducer in App for handling taskbar true and false conditions

Parameters

NameTypeDescription
reducerobjecttakes bluerain reducer

Returns

NameTypeDescription
reducerReact.ComponentAdds systemNav in reducer for toggling taskbar

bluerain.intl.messages

This hook adds translations in App.

Parameters:

NameTypeDescription
messagesobjectIt takes messages as param

Returns:

NameTypeDescription
messagesobjectIt adds and return messages

Example

ctx.Filters.add('bluerain.intl.messages', function eng(messages) {
    const en = require('./lang/en.ts');
    const ur = require('./lang/ur.ts');
    messages.en =  Object.assign(messages.en ? messages.en : {}, en);
    messages.ur = Object.assign(messages.ur ? messages.ur : {}, ur);
  return messages;
 });

bluerain.redux.initialState

This hook provides initialstate of taskbar.

Parameters:

NameTypeDescription
stateobjectIt takes messages as param

Returns:

NameTypeDescription
stateobjectIt adds taskbar state in the bluerain state

Example :

ctx.Filters.add('bluerain.redux.initialState', function ActivateTaskbar(state) {
   const size = ctx.Plugins.get('window-info');
   const taskbarState = getResponsiveState(size);
 return Object.assign({}, state, {
   bluerain: {
     systemNav: taskbarState
     }
});
});

plugin.window_info.resize

This hook provides windows size of plugin.

Parameters:

NameTypeDescription
stateobjectIt takes messages as param

Returns:

NameTypeDescription
stateobjectIt adds taskbar state in the bluerain state

Events

Make sure you have access to the BlueRain context. Then do this:

 ctx.Events.on('plugin.window_info.resize', (size, prevSize) => {
 const state = getResponsiveState(size);
  ctx.refs.store.dispatch(setStateSystemNav(state));
});

Components

This plugin registers following components in the Component registry, so they can be reused later by other apps and plugins:

NavHeader

Props

NameDefaultTypeDescription
to'/'stringThis is used to pass redirection path
logostringThis is used for adding logo in taskbar header
stylestringThis is used for adding styles on AppBar Component in taskbar header
widthnumberThis is used for adding width of taskbar listItem in header

NavItem

Props

NameDefaultTypeDescription
labelstringThis is used for adding label in items
iconnullstringIcon name specific to material design icons
avatarUrlnullstringThis is used for adding image in Avatar
buttonbooleanThis is used for making ListItem in NavItem behave like button
onClickfunctionGets called when ListItem is pressed
tostringThis is used to pass redirection path
mobilebooleanUsed to decide either to show ListItemText or not

NavUserInfoButton

Props

NameDefaultTypeDescription
itemsarray of objectsItems for Menu
onClickfunctionExecutes function on any MenuItem click
mobilebooleanUsed to decide either to show ListItemText or not

NavOpenCloseButton

Props

NameDefaultTypeDescription
mobilebooleanUsed to decide either to show ListItemText or not

HamburgerButton

Props

NameDefaultTypeDescription
styleobjectButton style

API

TaskbarPluginConfigurations

Properties

Extends Plugin

A BlueRain Plugin built on materia-ui drawer to view taskbar in React apps.

Properties

2.0.1

5 years ago

2.0.0

5 years ago

2.0.0-beta.1

5 years ago

1.3.6

6 years ago

1.3.5

6 years ago

1.3.4

6 years ago

1.3.3

6 years ago

1.3.2

6 years ago

1.3.1

6 years ago

1.3.0

6 years ago

1.2.1

6 years ago

1.2.0

6 years ago

1.1.1

6 years ago

1.1.0

6 years ago

1.0.5

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago

0.5.0

7 years ago

0.4.8

7 years ago

0.4.6

7 years ago

0.4.5

7 years ago

0.0.0

7 years ago