0.0.4 • Published 5 years ago

@deriv/dashboard v0.0.4

Weekly downloads
6
License
ISC
Repository
-
Last release
5 years ago

Index

  • General - Contains general philosophy and overview of this package
  • Modules docs - Contains implementation guides (i.e., adding types, use observer, etc.)

Requirements

  • node
  • npm

Editor helpers

🚀 Quick start

  1. Install your dependencies:

    npm run bootstrap
  2. To build publish file:

    npm run build:publish dashboard
  3. Libary usage:

    ```jsx
    import React from 'react'
    import Dashboard from '@deriv/dashboard';
    
    const Component = ({client, ServerTIme, ui, WS, config}) => {
        return <Dashboard client={client} server_time={ServerTime} ui={ui} ws={WS} config={config} />;
    }
    Component.propTypes = {
        client: PropTypes.shape({
            is_logged_in: PropTypes.bool.isRequired,
            loginid: PropTypes.string.isRequired,
        }).isRequired,
        config: {
            asset_path: PropTypes.string.isRequired,
            has_router: PropTypes.bool.isRequired,
            is_deriv_crypto: PropTypes.bool.isRequired,
            routes: PropTypes.shape({
                home: PropTypes.string.isRequired,
                about_us: PropTypes.string.isRequired,
                explore: PropTypes.string.isRequired,
                resources: PropTypes.string.isRequired,
            }).isRequired,
        },
        ui: PropTypes.shape({
            height_offset: PropTypes.string,
            is_dark_mode_on: PropTypes.bool.isRequired,
            language: PropTypes.string.isRequired,
            components: PropTypes.shape({
                LoginPrompt: any,
                Page404: any,
            }).isRequired,
    }).isRequired,

};

```

```
  1. File Structure
src
    ├── assets/
    │   ├── images/
    ├── components/
    │   ├── ...
    ├── constants/
    │   ├── ...
    ├── stores/
    │   ├── ...
    ├── types/
    │   ├── ...
    ├── index.js

index.js // publish file
webpack.config.js
package.json