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: Add OutOfStock component #1314

Merged
merged 10 commits into from
May 26, 2022
Merged

Conversation

ArthurTriis1
Copy link
Contributor

@ArthurTriis1 ArthurTriis1 commented May 23, 2022

Signed-off-by: Arthur Andrade arthurfelandrade@gmail.com

What's the purpose of this pull request?

This PR is part of the Component Placement project, to bring some components from base.store.

How it works?

Component in FastStore

Screen Shot 2022-05-23 at 16 05 16

Component in BaseStore

Screen Shot 2022-05-23 at 16 32 24

The OutOfStock component works together with its own others components:

  • Input
  • Button

How to test it?

Unit tests through Jest: yarn test packages/ui/src/organisms/OutOfStock/OutOfStock.test.tsx

Starters Deploy Preview

References

Component Placement - FSSS-249

Signed-off-by: Arthur Andrade <arthurfelandrade@gmail.com>
@ArthurTriis1 ArthurTriis1 requested a review from a team as a code owner May 23, 2022 18:45
@vercel
Copy link

vercel bot commented May 23, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
faststore ✅ Ready (Inspect) Visit Preview May 26, 2022 at 3:15PM (UTC)

@codesandbox-ci
Copy link

codesandbox-ci bot commented May 23, 2022

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit c728136:

Sandbox Source
Store UI Typescript Configuration

Signed-off-by: Arthur Andrade <arthurfelandrade@gmail.com>
Signed-off-by: Arthur Andrade <arthurfelandrade@gmail.com>
expect(outOfStockMessage.tagName).toEqual('P')
})

it('`outOfStockTitle` component should be an `paragraph`', () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not sure about the title being a paragraph/div 🤔
The user could just use an heading tags.

Copy link
Member

Choose a reason for hiding this comment

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

good point!

Copy link
Contributor

@filipewl filipewl left a comment

Choose a reason for hiding this comment

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

Looking good! Pre-approved but left some points for discussion.

packages/ui/src/organisms/OutOfStock/OutOfStock.test.tsx Outdated Show resolved Hide resolved
packages/ui/src/organisms/OutOfStock/OutOfStock.tsx Outdated Show resolved Hide resolved
packages/ui/src/organisms/OutOfStock/OutOfStock.tsx Outdated Show resolved Hide resolved
packages/ui/src/organisms/OutOfStock/OutOfStock.tsx Outdated Show resolved Hide resolved
packages/ui/src/organisms/OutOfStock/OutOfStock.test.tsx Outdated Show resolved Hide resolved
packages/ui/src/organisms/OutOfStock/OutOfStock.test.tsx Outdated Show resolved Hide resolved
packages/ui/src/organisms/OutOfStock/OutOfStock.test.tsx Outdated Show resolved Hide resolved
packages/ui/src/organisms/OutOfStock/OutOfStock.test.tsx Outdated Show resolved Hide resolved
expect(outOfStockMessage.tagName).toEqual('P')
})

it('`outOfStockTitle` component should be an `paragraph`', () => {
Copy link
Member

Choose a reason for hiding this comment

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

good point!

packages/ui/src/organisms/OutOfStock/OutOfStock.tsx Outdated Show resolved Hide resolved
ArthurTriis1 and others added 3 commits May 25, 2022 14:40
Co-authored-by: Filipe W. Lima <filipe.lima@vtex.com.br>
Co-authored-by: Filipe W. Lima <filipe.lima@vtex.com.br>
Co-authored-by: Eduardo Formiga <eduardo.formiga@gmail.com>
Signed-off-by: Arthur Andrade <arthurfelandrade@gmail.com>
Copy link
Contributor

@hellofanny hellofanny left a comment

Choose a reason for hiding this comment

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

I'm happy with this version that we came up 🤩
It favors the use of headings tags and avoid unnecessary/extra nodes in the DOM.
Well doneeeee Arthur!! 🌟

I've left a few suggestions, can you check it please :)

Copy link
Contributor

@saranicoly saranicoly left a comment

Choose a reason for hiding this comment

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

Great job!

Copy link
Contributor

@filipewl filipewl left a comment

Choose a reason for hiding this comment

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

I liked the change to the Component.InnerComponent pattern, but I'm unsure if this is the right moment to introduce it. Other components use a different pattern (e.g. ComponentInnerComponent). Maybe we open a discussion what which style to use? I feel like there are more pros to the former (e.g., only 1 import, autocomplete?), but I'm curious to know if there is any reason it hasn't been adopted from the start.

Signed-off-by: Arthur Andrade <arthurfelandrade@gmail.com>
@ArthurTriis1
Copy link
Contributor Author

I liked the change to the Component.InnerComponent pattern, but I'm unsure if this is the right moment to introduce it. Other components use a different pattern (e.g. ComponentInnerComponent). Maybe we open a discussion what which style to use? I feel like there are more pros to the former (e.g., only 1 import, autocomplete?), but I'm curious to know if there is any reason it hasn't been adopted from the start.

Is a good point, a like this patter with dot, but while we don't have an opinion about this, I will change the pattern

Signed-off-by: Arthur Andrade <arthurfelandrade@gmail.com>
@ArthurTriis1 ArthurTriis1 merged commit 37eac86 into main May 26, 2022
@ArthurTriis1 ArthurTriis1 deleted the feat/FSSS-249-Add-OutOfStock branch May 26, 2022 16:36
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.

5 participants