🚨 Shai-Hulud Strikes Again:834 Packages Compromised.Technical Analysis →
Socket
Book a DemoInstallSign in
Socket

oresome-md-ui

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

oresome-md-ui

Extended Material UI components

latest
Source
npmnpm
Version
1.0.1
Version published
Maintainers
1
Created
Source

oresome-md-ui

Extended Material UI components

NPM JavaScript Style Guide

Install

npm install --save oresome-md-ui

Usage

Refer to the example (https://github.com/Leong21/oresome-md-ui/tree/master/example)

import React, { Component } from 'react'
import { MuiThemeProvider, CssBaseline, createMuiTheme } from '@material-ui/core';
import Routes, { navigationRoutes } from './Routes';
import {Provider as AppProvider, defaultContext} from './AppProvider';

import { MainLayout, MenuItems, TopBarActions, Colours } from 'oresome-md-ui';

const Logo = props => (
  <div>Logo</div>
);

export default class App extends Component {
  constructor(props) {
    super(props);

    this.state = {
      ...defaultContext
    }
  }

  handleConfigChange = (name, value) => {
    this.setState({
      [name]: value
    });
  }

  render() {
    const theme = createMuiTheme({
      palette: {...Colours[this.state.colour], type: this.state.type},
      
    })

    return (
      <AppProvider
        value={{
          ...this.state,
          handleConfigChange: this.handleConfigChange
        }}>
        <MuiThemeProvider theme={theme}>
          <CssBaseline />
          <MainLayout
            menuItems={<MenuItems navigationRoutes={navigationRoutes} />}
            topBarActions={TopBarActions}
            logo={Logo}
            updateTheme={this.handleConfigChange}
            colour={this.state.colour}
          >
            <Routes />
          </MainLayout>
        </MuiThemeProvider>
      </AppProvider>
    )
  }
}

License

MIT © Leong21

FAQs

Package last updated on 04 Sep 2018

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