Socket
Socket
Sign inDemoInstall

@appbaseio/dejavu-browser

Package Overview
Dependencies
Maintainers
6
Versions
33
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@appbaseio/dejavu-browser

Dejavu monorepo data browser components


Version published
Maintainers
6
Created
Source

batteries

Public pluggable modules for use within reactivesearch.io dashboard, dejavu, and reactive apps.

Setup

  1. Setup the submodule:
git submodule init
git submodule sync
git submodule update --recursive --remote
  1. Installation:
yarn add emotion react-emotion antd @appbaseio/reactivesearch react-expand-collapse codesandbox react-element-to-jsx-string appbase-js react-ace brace recharts moment lodash reselect redux-thunk react-joyride
yarn add -D babel-plugin-emotion babel-plugin-import

Add babel-plugin-import:

// .babelrc or babel-loader option
{
	"plugins": [
		[
			"import",
			{ "libraryName": "antd", "libraryDirectory": "es", "style": "css" }
		]
	]
}

You will need to setup css-loader in your webpack config for react-select

  1. Setup redux
import {
 createStore, combineReducers,
} from 'redux';

// import your root reducer (optional)
import rootReducer from '../reducers';

// import batteries reducers
import batteriesReducers from 'batteries/modules/reducers';

// use it for creating the store:
createStore(combineReducers({ ...rootReducer, ...batteriesReducers })),
  1. Import:
  • Desired actions from batteries/modules/actions
  • Selectors from batteries/modules/selectors

and connect your component to the redux store powered by batteries.

Usage

BaseContainer

Use this component to provide the basic data to batteries components. By default it executes the following tasks.

  • Sets the app name & app id in redux store.
  • Fetches the basic app information
  • Fetches the app plan

Props

PropRequiredTypeDefault ValueDescription
appNameyesstring-Name of the app.
appIdnostring-App id
shouldFetchAppPlannobooleantrueTo define that whether the component should fetch app plan or not
shouldFetchAppInfonobooleantrueTo define that whether the component should fetch app information or not
componentnofunction-Render prop function

Example

import Analytics from 'batteries/components/Analytics'
...
<BaseContainer appName="movies-xyz">
  <Analytics/>
</BaseContainer>

SearchSandbox

Use this component to display the SearchPreview component.

Props

PropRequiredTypeDefault ValueDescription
appNameyesstring-Name of the app.
appIdnostring-App id
isDashboardnobooleanfalsePrefrences handling and profile view
useCategorySearchnobooleanfalseIf true renders CategorySearch else DataSearch
showCodeSandboxnobooleantrueIf false hides Open in CodeSandbox button
customPropsnoobject{}To pass props directly to Reactive Components like ReactiveList, MultiList, CategorySearch, DataSearch
attributionnoobject-Pass text and link key in object to be displayed at bottom right in codesandbox

Example

import SearchSandbox from 'batteries/components/SearchSandbox';
import Editor from 'batteries/components/SearchSandbox/containers/Editor';
...
<SearchSandbox
	appId={appId}
	appName={appName}
	credentials={credentials}
	isDashboard
	useCategorySearch={false}
	attribution={{
		text: 'Powered by Appbase',
		link: 'appbase.io'
	}}
	showCodeSandbox
	customProps={{
		ReactiveList: {
			onData: res => (
				<div style={{ background: 'aqua' }}>{JSON.stringify(res)}</div>
			),
			style: { background: 'red' },
		},
		DataSearch: {
			renderSuggestions: res => (
				<div style={{ background: 'yellow' }}>{JSON.stringify(res)}</div>
			),
		},
	}}
>
	<Editor />
</SearchSandbox>

FAQs

Package last updated on 18 May 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc