Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/adamweeks/spark-widget-custom-menu
https://github.com/adamweeks/spark-widget-custom-menu
Last synced: 27 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/adamweeks/spark-widget-custom-menu
- Owner: adamweeks
- Created: 2018-01-15T17:45:50.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2018-01-26T21:23:57.000Z (almost 7 years ago)
- Last Synced: 2024-10-03T16:28:33.438Z (about 1 month ago)
- Language: JavaScript
- Size: 14.6 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-webex - custom-menu - Creating custom activities (by adamweeks). (Code samples / Web SDK & Widgets samples)
README
# Creating Custom Activities
This is a basic example of how to instantiate a [Cisco Spark Space Widget](https://github.com/ciscospark/react-ciscospark/tree/master/packages/node_modules/%40ciscospark/widget-space)
with a custom activity menu option.**Note: This option is currently only available when using the [browser global](https://github.com/ciscospark/react-ciscospark/tree/master/packages/node_modules/%40ciscospark/widget-space#browser-globals) method.
## Initialization Params
```js
window.ciscospark.widget(widgetEl).spaceWidget({
accessToken: myAccessToken,
customActivityTypes: [
{
// Menu Item Name
displayName: 'Custom',
// Internal Name
name: 'custom',
// Style for menu button
buttonClassName: 'custom-activity',
// Icon name from react-component-icon
iconClassName: 'icon-call_camera_32',
// React component to display when selected
component: CustomActivity,
// Types of spaces to support
spaceTypes: ['direct', 'group'],
// Type of widget (secondary type coming soon)
type: 'ACTIVITY_TYPE_PRIMARY'
}
],
toPersonEmail: toPersonEmail
});
```## Issues
- `react-component-icon` is bad on npm and requires you to use class name string directly [package](https://github.com/ciscospark/react-ciscospark/tree/master/packages/node_modules/%40ciscospark/react-component-icon)
- Custom icons/buttons
- `ACTIVITY_TYPE_PRIMARY` strings aren't exported anywhere
- Secondary Activities
- No way to get button actions (cannot hide once opened)
- Could use a wrapper function