Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(sidebar state): moved onto TinaCMS #649

Merged
merged 1 commit into from
Jan 22, 2020

Commits on Jan 21, 2020

  1. refactor(sidebar state): moved onto TinaCMS

    This change reifies the sidebar state and places
    it on the TinaCMS class as a property. It also
    removes the need for the `SidebarContext`
    in the React app, instead relying on the
    pre-existinig CMSContext.
    
    Here is how it would be used.
    
    Checking sidebar state:
    
        cms.sidebar.isOpen
    
    Changing sidebar state:
    
        cms.sidebar.isOpen = true
    
    Subscribing Option 1
    
        import { useCMS, useSubscribable } from "tinacms"
        const cms = useCMS()
    
        useSubscribable(cms.sidebar)
    
    Subscribing Option 2:
    
        const sidebar = useSidebar()
    ncphillips committed Jan 21, 2020
    Configuration menu
    Copy the full SHA
    cc8b9ad View commit details
    Browse the repository at this point in the history