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(component): add column and section #46

Merged
merged 17 commits into from
Jul 4, 2022

Conversation

niloysikdar
Copy link
Member

This Pull Request covers:

  • New components Column and Section
  • Stories for newly added components

Resolves #39

Signed-off-by: Niloy Sikdar [email protected]

add column component

resolves #39

Signed-off-by: Niloy Sikdar <[email protected]>
add section component

resolves #39

Signed-off-by: Niloy Sikdar <[email protected]>
fixed email component with updated tags

resolves #39

Signed-off-by: Niloy Sikdar <[email protected]>
fix email stories with the updated component structure

resolves #39

Signed-off-by: Niloy Sikdar <[email protected]>
add missing stories for column component

resolves #39

Signed-off-by: Niloy Sikdar <[email protected]>
add stories for section component

resolves #39

Signed-off-by: Niloy Sikdar <[email protected]>
@niloysikdar niloysikdar added the GSoC 2022 Issues and Pull Requests under Google Summer of Code 2022 label Jun 30, 2022
fix storybook.yml script to only deploy when push to main branch

Signed-off-by: Niloy Sikdar <[email protected]>
@agentmilindu
Copy link
Contributor

Seems you assume users will use Email (div table) then use Section (tr) and then Column(td), right? What if users want to have one column in first raw and two columns in second raw? The cells will get messy. How about having Email (div) then use Section (table tr) and then Column(td)?

Copy link
Member Author

@niloysikdar niloysikdar left a comment

Choose a reason for hiding this comment

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

My pov:

Email will be the outermost component with the div -> table structure

If we are creating the Column component, then it should be something that will wrap its children vertically, which basically means, all of the children which are inside the Column should be aligned to create a column. For this purpose, I have taken tbody which can wrap our trs to form the vertical alignment.

Now Section will work like each row, which means users can have multiple sections inside a column, and all of the sections then will be placed vertically one after each other. For the Section component, I have taken tr.
Now we can include one or more components inside one Section. Components will be wrapped with td.

This is the same widget tree structure that Flutter also follows.

So our overall structure will look like this:

    <!-- Email -->
    <div>
      <table>
        <!-- Column -->
        <tbody>
          <!-- Section -->
          <tr>
            <td>This is 1</td>
          </tr>
          <!-- Section -->

          <!-- Section -->
          <tr>
            <td>This is 2</td>
            <td>This is 3</td>
          </tr>
          <!-- Section -->
        </tbody>
        <!-- Column -->
      </table>
    </div>
    <!-- Email -->

But this can have some styling issues if we don't maintain proper items count for the sections in the right way, that's why I also thought of multiple table nesting, but wasn't quite sure about that approach, that's why wanted to discuss with you about these approaches and texted you regarding the same @agentmilindu

@agentmilindu
Copy link
Contributor

How about you implement like we discussed initially? Email (div) then use Section (table tr) and then
Column(td)?

DDC082E8-49C8-4E2B-9089-8B1B1BAF49E7

@niloysikdar
Copy link
Member Author

If we follow these rules, then it won't work.
If we make Column as td, then how can we include more than one element? Also, it won't get aligned in a column in this case.

<tr>
  <td>
    <Element 1/>
    <Element 2/>
    <Element 3/>
  <td />
<tr />

Now in this case, Element 1, Element 2, and Element 3 won't get aligned in a vertical way.

@agentmilindu

fix the structure of Email, Section and Column components

resolves #39

Signed-off-by: Niloy Sikdar <[email protected]>
fix Email stories with the new structure

resolves #39

Signed-off-by: Niloy Sikdar <[email protected]>
fix Section stories with new structure

resolves #39

Signed-off-by: Niloy Sikdar <[email protected]>
fix Column stories

resolves #39

Signed-off-by: Niloy Sikdar <[email protected]>
export props for components from the library

resolves #39

Signed-off-by: Niloy Sikdar <[email protected]>
fix Email component with classes

resolves #39

Signed-off-by: Niloy Sikdar <[email protected]>
fix types using Record and add styles to the prop for Email component

resolves #39

Signed-off-by: Niloy Sikdar <[email protected]>
fix types to use Record and add styles props for Column component
fix stories for Column with styles

resolves #39

Signed-off-by: Niloy Sikdar <[email protected]>
fix types with extends BaseStyleProp and adding classes to the props list

resolves #39

Signed-off-by: Niloy Sikdar <[email protected]>
@niloysikdar niloysikdar force-pushed the feat/39-add-component-column-and-section branch from d23db71 to f8368a7 Compare July 4, 2022 03:48
@agentmilindu agentmilindu merged commit c89ad5e into main Jul 4, 2022
@agentmilindu agentmilindu deleted the feat/39-add-component-column-and-section branch July 4, 2022 03:52
github-actions bot pushed a commit that referenced this pull request Jul 5, 2022
# [1.1.0](v1.0.1...v1.1.0) (2022-07-05)

### Features

* **component:** add button component ([#47](#47)) ([c846451](c846451)), closes [#40](#40) [#40](#40) [#40](#40) [#40](#40)
* **component:** add column and section ([#46](#46)) ([c89ad5e](c89ad5e)), closes [#39](#39) [#39](#39) [#39](#39) [#39](#39) [#39](#39) [#39](#39) [#39](#39) [#39](#39) [#39](#39) [#39](#39) [#39](#39) [#39](#39) [#39](#39) [#39](#39) [#39](#39)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
GSoC 2022 Issues and Pull Requests under Google Summer of Code 2022
Projects
None yet
Development

Successfully merging this pull request may close these issues.

add component: Column and Section
2 participants