This repository was archived by the owner on Mar 9, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Ms create input spinner #9
Open
Madeuss
wants to merge
14
commits into
main
Choose a base branch
from
ms-create-input-spinner
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
a5e2f53
feat: created input spinner component
Madeuss 68c79e9
refactor: refactor the index export file using * to export all from t…
Madeuss 2f9ab4d
feat: added chakra-ui icons lib
Madeuss 145f5f8
feat: added pr template md file
Madeuss 2496856
refactor: refactor props order
Madeuss 85b4609
fix: fix input and welcome component exporting
Madeuss 8ed8107
fix: refactor props use way
Madeuss 1059d8c
refactor: remove checkboxes from pr template
Madeuss ade19ff
feat: added input elements left and right as prop options
Madeuss 9cf149b
fix: removing useless props of add icon default component
Madeuss 3228cb2
fix: remove useless prop
Madeuss ea2cdee
fix: remove specific color props
Madeuss 00b2d79
Update components/InputSpinner/index.tsx
Madeuss 4b3e60c
Update components/InputSpinner/index.tsx
Madeuss File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| # O que esse PR faz? | ||
|
|
||
| ## Qual o problema encontrado? | ||
|
|
||
| - descrição do problema | ||
| - **screenshots** se possível | ||
| - exemplo de `código` se necessário | ||
| - mensagem de erro (log, excessão, alert) | ||
|
|
||
| ## Qual a solução aplicada? | ||
|
|
||
| - descrição da solução | ||
| - **screenshots** se possível | ||
| - exemplo de `código` se necessário | ||
|
|
||
| ## Screenshots |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,45 @@ | ||
| import { | ||
| HStack, | ||
| Input, | ||
| InputGroup, | ||
| InputLeftElement, | ||
| InputRightElement, | ||
| NumberInputProps, | ||
| useNumberInput, | ||
| } from '@chakra-ui/react' | ||
| import { AddIcon, MinusIcon } from '@chakra-ui/icons' | ||
|
|
||
| interface Props { | ||
| minusIcon?: React.ReactNode | ||
| addIcon?: React.ReactNode | ||
| } | ||
|
|
||
| export function InputSpinner(props: Props & NumberInputProps) { | ||
| const { step, defaultValue, min, width, minusIcon, addIcon } = props | ||
|
|
||
| const { getInputProps, getIncrementButtonProps, getDecrementButtonProps } = | ||
| useNumberInput({ | ||
| step: step || 1, | ||
| defaultValue: defaultValue || 0, | ||
| min: min || 0, | ||
| ...props, | ||
| }) | ||
|
|
||
| const inc = getIncrementButtonProps() | ||
| const dec = getDecrementButtonProps() | ||
| const input = getInputProps() | ||
|
|
||
| return ( | ||
| <HStack maxW={width || '224px'}> | ||
| <InputGroup> | ||
| <InputLeftElement ml={3} mt={1} {...dec}> | ||
| {minusIcon || <MinusIcon fontSize="small" />} | ||
| </InputLeftElement> | ||
| <Input textAlign="center" height={12} {...input} /> | ||
| <InputRightElement mr={3} mt={1} {...inc}> | ||
| {addIcon ? addIcon : <AddIcon fontSize="small" />} | ||
| </InputRightElement> | ||
| </InputGroup> | ||
| </HStack> | ||
| ) | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,8 +1,3 @@ | ||
| import WelcomeContent from '../components/Welcome/WelcomeContent' | ||
| import NextButton from '../components/NextButton' | ||
| import type { WelcomeContentComponent } from '../components/Welcome/WelcomeContent' | ||
| import type { NextButtonComponent } from '../components/NextButton' | ||
|
|
||
|
|
||
| export { WelcomeContent, NextButton } | ||
| export type { WelcomeContentComponent, NextButtonComponent } | ||
| export * from '../components/Welcome' | ||
| export * from '../components/NextButton' | ||
| export * from '../components/InputSpinner' | ||
|
Madeuss marked this conversation as resolved.
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -14,6 +14,7 @@ | |
| "lint": "next lint" | ||
| }, | ||
| "dependencies": { | ||
| "@chakra-ui/icons": "^2.0.12", | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Acho que você não precisa adicionar @chakra-ui/icons , senão me engano ele esta dentro do @chakra-ui/react
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. achei que estaria também, mas não estava lá na node_modules e ele ficou pedindo pra adicionar |
||
| "@chakra-ui/react": "^2.3.6", | ||
| "@emotion/react": "^11.10.4", | ||
| "@emotion/styled": "^11.10.4", | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
foi seu editor que removeu as leading commas? se formos começar a ter estes ruídos de code formatting, acho que já seria bom colocar um .prettierrc no projeto com um conjunto qqer de preferencias só para nao dar diff entre colaboradores com editores e code formatters diferentes, padronizar estas regrinhas (ser com ou sem por mim tanto faz)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
acho bom fazer, mas que seria melhor criar essa config de prettier/eslint em um novo PR pra nao fugir muito da ideia desse aqui e nem atrasar