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

feat: updated component directory structure #163

Closed
wants to merge 5 commits into from

Conversation

dayhaysoos
Copy link

@dayhaysoos dayhaysoos commented Aug 4, 2020

For full context, refer to this link: https://www.notion.so/echobind/RFC-Different-approach-for-component-structure-dd0d2d308c4c4a60a58849acb4e65f8f

Overview

Component structure has been updated to get away from having directories that represent components. The previous structure looked something like:

Image 2020-08-04 at 2 01 17 PM

Which has now been switched to:

Image 2020-08-04 at 2 02 25 PM

It's worth mentioning that the storybook files have been moved to the storybook directory.

Lemme know if you have any trouble spinning this up or any other questions!

@dayhaysoos dayhaysoos requested review from cball and ryanpatk August 4, 2020 17:57
Copy link
Contributor

@isaiahgrey93 isaiahgrey93 left a comment

Choose a reason for hiding this comment

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

Looks good, as long as story book still runs I say we merge this!

@@ -23,7 +22,7 @@ interface ScreenProps {
/** The content to render within the screen */
children?: ReactNode;
/** Whether to force the topInset. Use to prevent screen jank on tab screens */
forceTopInset?: Boolean;
Copy link
Contributor

Choose a reason for hiding this comment

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

noice

Copy link
Member

Choose a reason for hiding this comment

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

@dayhaysoos I'm assuming react-navigation fixed something here and this is no longer required?

Copy link
Author

Choose a reason for hiding this comment

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

@cball I actually have no idea why that went missing. I think @isaiahgrey93 knows why it's gone

@ryanpatk ryanpatk changed the title updated structure feat: updated component directory structure Aug 6, 2020
@ryanpatk ryanpatk force-pushed the nick/rfc-component-structure branch from 74ba02e to 1a81069 Compare August 6, 2020 18:15
Copy link
Member

@cball cball left a comment

Choose a reason for hiding this comment

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

Changes:

  • I don't think we want a yarn.lock in template/?

A few questions:

  • does AppNav render ok without a real user?

And notes:

  • I added a link to the eslint plugin for import sorting. If we're doing that we definitely need it to be in the plugin rather than relying on manual changes

@@ -21,7 +21,7 @@ const App = (): ReactElement | null => {

const renderNavigation = (): ReactElement => {
// replace with actual user profile data once loaded, or fallback to guest nav
const currentUser = false;
const currentUser = true;
Copy link
Member

Choose a reason for hiding this comment

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

I'm assuming neither of these matter as they are meant to be replaced, but does AppNav render properly without a real user?

Copy link
Author

Choose a reason for hiding this comment

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

Correct

import { colors } from '../styles';
import { Container } from './Container';
import { Text } from './Text';
import { Touchable } from './Touchable';
Copy link
Member

Choose a reason for hiding this comment

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

If we're going to sort these now, let's make sure to add import/order plugin to our react-native eslint plugin (I've created a followup issue here: echobind/eslint-plugin-echobind#141)

@@ -1,7 +1,7 @@
import { storiesOf } from '@storybook/react-native';
import React from 'react';

import { Text } from './Text';
import { Text } from '../../src/components/Text';
Copy link
Member

Choose a reason for hiding this comment

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

this feels a bit odd including src in the import, but not a big deal

Copy link
Author

Choose a reason for hiding this comment

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

Yeah, I didn't want to move the storybook folder from the root level, do you think we should add it to src?

The reason why I did this is because I would do this with tests as well, tests would replicate the src directory in structure but have nothing but test files.

@dayhaysoos dayhaysoos closed this Jan 26, 2021
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.

3 participants