Skip to content

Component side tray#71

Merged
chelshaw merged 14 commits intomasterfrom
component-side-tray
Jul 19, 2019
Merged

Component side tray#71
chelshaw merged 14 commits intomasterfrom
component-side-tray

Conversation

@chelshaw
Copy link
Copy Markdown
Contributor

SUMMARY
Add a sidetray component that calls closeCallback when:

  • You click outside the sidetray
  • You click the esc key

Has props for header and footer nodes, and content between them automatically flexGrows

Copy link
Copy Markdown
Contributor

@mdespuits mdespuits left a comment

Choose a reason for hiding this comment

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

Couple of small things. Liking the use of hooks!

Comment thread src/components/SideTray/index.js Outdated
Comment thread src/components/SideTray/index.js Outdated
Comment thread src/components/SideTray/index.js Outdated
Comment thread src/components/SideTray/index.js
Comment thread src/components/SideTray/style.css Outdated
Comment thread src/components/SideTray/index.js
Comment thread src/components/SideTray/index.js Outdated
Comment thread src/components/SideTray/story.js Outdated
Comment thread src/components/SideTray/test.js
Comment thread src/components/SideTray/style.css Outdated
Comment thread src/components/SideTray/style.css
Comment thread src/components/SideTray/README.md Outdated
Comment thread example/yarn.lock
Comment thread src/components/SideTray/story.js Outdated
@pixelbandito pixelbandito self-requested a review July 18, 2019 19:43
@pixelbandito
Copy link
Copy Markdown
Contributor

I committed a change to add a SideTray to the example page. Would you verify it doesn't break your subsequent changes?

Also, I tested in IE11 and Edge - looking good!!

Comment thread src/components/SideTray/Body/index.js Outdated
Comment thread src/components/SideTray/Body/index.js Outdated
Comment thread src/components/SideTray/Footer/index.js Outdated
Comment thread src/components/SideTray/Header/index.js Outdated
Comment thread src/stories.js
Comment thread src/components/SideTray/style.css Outdated
@@ -1,5 +1,5 @@
.sideTray {
width: var(--rvr-side-tray-width);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Why are we losing the variable here?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Hey @mdespuits,

I suggested this. I figured that:

  1. The sidetray width isn't intended for re-use among components.
  2. There's nothing magical about 400 px in our sizing system.
  3. It's not part of the theme.

I could see us standardizing on some sizes for modals / popovers / etc. in the future, but for now I thought this was cleaner than having a block of sidebar-specific properties in our global variables.

Copy link
Copy Markdown
Contributor

@mdespuits mdespuits left a comment

Choose a reason for hiding this comment

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

A couple of thoughts and a question or two

@pixelbandito
Copy link
Copy Markdown
Contributor

Good catch on the imports in stories.i think that's because storybook used a different webpack config and therefore different css loader module options,

Importing shared css directly for now in stories is great.

Comment thread src/components/SideTray/index.js Outdated
children: PropTypes.node.isRequired,
};

const Header = props => <div {...props} className={style.SideTray__Header} />;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Soooo close - but we should still support consumer-driven additional classes, I think.

So {...props} className={`${style.SideTray__Header} ${props.className}`}

@pixelbandito
Copy link
Copy Markdown
Contributor

I'm drunk with power and seeing if I can dismiss @mdespuits review, but only because I already verified that @chelshaw made the changes requested.

@pixelbandito pixelbandito dismissed mdespuits’s stale review July 19, 2019 15:41

@chelsea made the changes requested.

Copy link
Copy Markdown
Contributor

@mdespuits mdespuits left a comment

Choose a reason for hiding this comment

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

🍔🌹

@chelshaw chelshaw merged commit 080e293 into master Jul 19, 2019
@chelshaw chelshaw deleted the component-side-tray branch July 19, 2019 15:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants