Skip to content
This repository was archived by the owner on Mar 9, 2023. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions .github/pull_request_template.md
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
45 changes: 45 additions & 0 deletions components/InputSpinner/index.tsx
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>
)
}
Original file line number Diff line number Diff line change
@@ -1,16 +1,21 @@
import NextButton from '../../components/NextButton'
import NextButton from '../NextButton'
import type { FunctionComponent } from 'react'
import type { HeadlineComponent, LinkComponent } from '../Default'

interface WelcomeContentProps {
newContractPath: string,
t: Function,
Headline: HeadlineComponent,
Link: LinkComponent,
newContractPath: string

Copy link
Copy Markdown
Contributor

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)

Copy link
Copy Markdown
Member Author

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

t: Function
Headline: HeadlineComponent
Link: LinkComponent
}
export type WelcomeContentComponent = FunctionComponent<WelcomeContentProps>

function WelcomeContent({ newContractPath, t, Headline, Link }: WelcomeContentProps) {
export function WelcomeContent({
newContractPath,
t,
Headline,
Link,
}: WelcomeContentProps) {
Comment thread
Madeuss marked this conversation as resolved.
return (
<>
<Headline title={t('title')} subtitle={t('subtitle')} />
Expand All @@ -20,5 +25,3 @@ function WelcomeContent({ newContractPath, t, Headline, Link }: WelcomeContentPr
</>
)
}

export default WelcomeContent
11 changes: 3 additions & 8 deletions lib/index.ts
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'
Comment thread
Madeuss marked this conversation as resolved.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"lint": "next lint"
},
"dependencies": {
"@chakra-ui/icons": "^2.0.12",

Copy link
Copy Markdown

Choose a reason for hiding this comment

The 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

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The 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",
Expand Down
19 changes: 19 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,20 @@
dependencies:
"@chakra-ui/shared-utils" "2.0.2"

"@chakra-ui/icon@3.0.12":
version "3.0.12"
resolved "https://registry.yarnpkg.com/@chakra-ui/icon/-/icon-3.0.12.tgz#04f5b38591c4ff1cc922c14f814ce6b5d67525d9"
integrity sha512-VbUqgMcoZ26P1MtZdUqlxAKYDi1Bt8sSPNRID8QOwWfqyRYrbzabORVhKR3gpi6GaINjm7KRHIXHarj3u6EWdA==
dependencies:
"@chakra-ui/shared-utils" "2.0.3"

"@chakra-ui/icons@^2.0.12":
version "2.0.12"
resolved "https://registry.yarnpkg.com/@chakra-ui/icons/-/icons-2.0.12.tgz#5b4dd53512c2543c0617d4b348bf7bd1d9284e4a"
integrity sha512-lZyB96Yic5qM3gWp/QlQuD8WyS+V+19mjNxFW7IVmcn7fm+bLsnPrVPv2Qmpcs6/d4jsUyc1broyuyM+Urtg8Q==
dependencies:
"@chakra-ui/icon" "3.0.12"

"@chakra-ui/image@2.0.11":
version "2.0.11"
resolved "https://registry.yarnpkg.com/@chakra-ui/image/-/image-2.0.11.tgz#eb880ecd2fce47f22ef50bbbba66cbb027c0304c"
Expand Down Expand Up @@ -640,6 +654,11 @@
resolved "https://registry.yarnpkg.com/@chakra-ui/shared-utils/-/shared-utils-2.0.2.tgz#1df08133194c12ac4df9302604ec37784c2bb026"
integrity sha512-wC58Fh6wCnFFQyiebVZ0NI7PFW9+Vch0QE6qN7iR+bLseOzQY9miYuzPJ1kMYiFd6QTOmPJkI39M3wHqrPYiOg==

"@chakra-ui/shared-utils@2.0.3":
version "2.0.3"
resolved "https://registry.yarnpkg.com/@chakra-ui/shared-utils/-/shared-utils-2.0.3.tgz#97cbc11282e381ebd9f581c603088f9d60ead451"
integrity sha512-pCU+SUGdXzjAuUiUT8mriekL3tJVfNdwSTIaNeip7k/SWDzivrKGMwAFBxd3XVTDevtVusndkO4GJuQ3yILzDg==

"@chakra-ui/skeleton@2.0.17":
version "2.0.17"
resolved "https://registry.yarnpkg.com/@chakra-ui/skeleton/-/skeleton-2.0.17.tgz#737e08f771980f5b73060dc6c940691e7759d044"
Expand Down