Skip to content

Add initial site layout component #15

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

Merged
merged 7 commits into from
Apr 20, 2020
Merged

Add initial site layout component #15

merged 7 commits into from
Apr 20, 2020

Conversation

jamaljsr
Copy link
Member

Closes #4 & #7

This PR adds the initial shared layout component which contains the navigation bar and will wrap all the different screens on the site. It will continue to evolve as more components are created, but this should be enough get started.

I also installed and configured the Storybook dev tool which will make building and testing UI components much easier. Just run yarn storybook in the app/ folder to view the stories in a browser.

@jamaljsr jamaljsr linked an issue Apr 18, 2020 that may be closed by this pull request
@jamaljsr jamaljsr requested review from a team and guggero and removed request for a team April 18, 2020 04:41
@jamaljsr
Copy link
Member Author

I added a couple of commits just to improve and refactor the styles

@jamaljsr
Copy link
Member Author

I refactored the code a bit more to clean it up a bit for mobx, storyboard and unit tests.

Copy link
Member

@guggero guggero left a comment

Choose a reason for hiding this comment

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

Nice, looks good to me. Just one nit about the commit structure/diff size.
Pretty cool for me to see a project grow from zero, I feel like I'm learning modern React from scratch 😂

@@ -0,0 +1,20 @@
import React from 'react';
Copy link
Member

Choose a reason for hiding this comment

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

These example stories are deleted in the next commit. Can we just not add them at all to reduce the diff size?

Copy link
Member Author

Choose a reason for hiding this comment

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

Sorry about that. I will be mindful of this in the future. Thanks for the feedback.

Copy link
Member

Choose a reason for hiding this comment

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

No problem! It's always a question of how much time is worth putting into editing commits. On a new and not-yet-published project we probably don't have to be as strict in reviewing as in lnd for example and it's more important to get things moving.

import Sidebar from './Sidebar';

const Styled = {
Background: styled.div`
Copy link
Member

Choose a reason for hiding this comment

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

This is pretty cool! Just out of curiosity: I noticed that this creates random class names in the rendered code, which makes it pretty hard to debug/inspect. Is there an easy debug mode that can be enabled that creates more verbose class names?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, it is possible to add more descriptive labels in the class names generated by emotionjs. It will require adding a babel plugin which is only possible by also adding the customize-cra package, since create-react-app prevents babel configuration changes by default. I will make this change today.

Copy link
Member Author

@jamaljsr jamaljsr Apr 20, 2020

Choose a reason for hiding this comment

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

After looking into this a bit more, I realize that it is does add the labels into the css classes without needing any additional third-party dependencies. Unfortunately, there is currently a bug when using emotionjs with a typed theme prop. This is why the labels aren't showing up in our app. The bug fix will be released in the next version, so I think it would be better to wait for their next release instead of adding more deps.

Copy link
Member

Choose a reason for hiding this comment

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

Sure, this isn't a blocker at all. I think from context it should still be possible to debug CSS issues, it might just be a bit more tricky. But since the app isn't too complicated yet it shouldn't be an issue.

@jamaljsr jamaljsr merged commit aa5c1e9 into master Apr 20, 2020
@jamaljsr jamaljsr deleted the feat/storybook branch April 20, 2020 20:04
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.

Create site layout with a sidebar nav Add storybook explorer for UI components
2 participants