Giter Site home page Giter Site logo

michaelangerman / mui-menu Goto Github PK

View Code? Open in Web Editor NEW

This project forked from stormmui/mui-menu

0.0 0.0 0.0 5.33 MB

Material-UI Simple Menus

Home Page: https://stormasm.github.io/mui-menu/

License: MIT License

HTML 7.09% JavaScript 92.91%
material-ui

mui-menu's Introduction

mui-menu

This demo displays a simple example of how to use Material-UI menus in concert with react-router and react-redux.

This demo displays the same concept as mui-drawer except the navigation is a function of menus instead of drawers.

The concept

When you read a text book in school the author breaks all of the information into higher levels called chapters and then within those chapters are more fine grained knowledge called sections. This demo simulates that concept by building a framework to enable electronic navigation of information broken down into chapters and sections. You can navigate around using the chapter menu drop down in the upper left hand corner of the screen and then within those chapters individual sections which are the menu items. Play around with the demo to see how it works.

The only thing that is displayed on the screen is your location. But that is enough to show that the navigation is working. It is up to the developer to expand this concept if they so choose by adding in more information to your E-book.

Precursor to Github Worlds

You will see when you get into Github Worlds Menu that the menu items are the views instead of the sections and the chapters are actually the Github repository you wish to view.

Adding Dynamic Routes

Inside this demo is a proof of concept for how to add dynamic routes to your application. In this demo, the core route which is a chapter is the first part of the URL and the section is the second part of the URL. The combination of these two items is what drives the react router to its final destination. Having the ability to dynamically modify the routes by adding in chapters is accomplished via the Admin icon which is between the Section menu and the Github Icon.

Keeping things in Sync

The KeyContainer is responsible for handling route changes by

  • changing the redux state via the Picker
  • and pushing the new route onto the History API

By doing this the new route URL will show up in the address bar.

React Router Redux

This project has been deprecated and currently there is not a good well known solution to keep the History API and the Redux state in sync so I have forked the above repo and placed it inside this demo and ghw-menu.

Future work

Eventually we will persist the new routes or chapters to localStorage and add in another button to clear out the localStorage and reset the redux state machine.

But for now each application refresh in the browser resets the redux state machine.

mui-menu's People

Contributors

stormasm avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.