Skip to content

Update examples app layout #218

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

Closed
wants to merge 47 commits into from
Closed

Update examples app layout #218

wants to merge 47 commits into from

Conversation

shawnbot
Copy link
Contributor

@shawnbot shawnbot commented Aug 17, 2018

This refactors our app layout with a sticky top nav and undoes the x0 Library styling with a simpler implementation that uses flexbox without min-height: 100vh and independent scrolling on the sidenav and content. The tile ("Grid") view is gone (for now) too, in favor of some basic introductions on the Components and Demos landing pages. Fixes #217.

Before:
image

After:
image

I've also simplified all of our example exports to just use the export default {} form so that we don't have to name them, and made a bunch of other tweaks to our example code while I was in there. There are a bunch more code snippets that could use some nicer formatting, but that can happen later.

@shawnbot shawnbot changed the base branch from release-2.0.0-beta to master August 17, 2018 18:37
@broccolini
Copy link
Member

I checked this out on pages preview, but when I click on the components in the list they show a blank page, example: https://primer-0bb1136e55.drafts.github.io/primer-react/primer-react/components/Avatar

I want us to make quite a few changes to the IA etc. so I'm not sure whether it makes sense to ship this without us discussing the broader docs design 🤔

const ComponentPage = () => {
const basename = process.env.NODE_ENV === 'development' ? '/components' : '/primer-react/components'
export default function Components(props) {
const basename = process.env.NODE_ENV === 'development' ? '/components/' : '/primer-react/components/'
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think these changes might what's be breaking showing the components when clicking on them in the sidebar. x0 is very finicky with these things

@shawnbot
Copy link
Contributor Author

Okay, so I think I fixed the linking problem. Turns out either with the updated x0 or the simplified Library component in this PR, we don't need to conditionally prefix the basename with /primer-react/ anymore; I think it just respects the x0.basename in our package.json now. I've tested this both locally and on Pages, and the links all seem to work.

The only thing that's funky is that the selected state of the top and side nav isn't applied when you link directly to, say, /demos/MergeBox/. However, this seems to be an improvement over what's currently deployed on master, which doesn't work at all. 😱

@broccolini
Copy link
Member

I think it would be good to sync back up about this after having a better idea of where we want to head with docs - could discuss in the component api review tomorrow?

@shawnbot shawnbot mentioned this pull request Aug 21, 2018
8 tasks
@shawnbot
Copy link
Contributor Author

Closing in favor of #221 so we can review all that work in one place.

@shawnbot shawnbot closed this Aug 22, 2018
@shawnbot shawnbot deleted the fewer-scrollbars branch August 22, 2018 20:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants