feat: create button variant

This commit is contained in:
Vinicius Souza 2024-10-24 11:14:34 -03:00
parent 5dec1645bd
commit e2072c9c85
2 changed files with 29 additions and 5 deletions

View file

@ -3,26 +3,33 @@ import { ComponentProps } from "react";
type Props = ComponentProps<typeof GSButton> & { type Props = ComponentProps<typeof GSButton> & {
title: string, title: string,
variant?: 'solid' | 'outline',
isLoading?: boolean, isLoading?: boolean,
} }
export function Button({ title, isLoading = false, ...others }: Props) { export function Button({
title,
isLoading = false,
variant = 'solid',
...others
}: Props) {
return ( return (
<GSButton <GSButton
w="$full" w="$full"
h="$14" h="$14"
bg="$green700" bg={variant === 'solid' ? '$green700' : 'transparent'}
rounded="$sm" rounded="$sm"
borderWidth={variant === 'solid' ? '$0' : '$1'}
borderColor="$green500" borderColor="$green500"
$active-bg="$green500" $active-bg={variant === 'solid' ? '$green500' : '$gray500'}
disabled={isLoading} disabled={isLoading}
{...others} {...others}
> >
{ isLoading ? ( { isLoading ? (
<ButtonSpinner color="$white" /> <ButtonSpinner color={ variant === 'solid' ? '$white' : '$green500'} />
) : ( ) : (
<Text <Text
color="$white" color={ variant === 'solid' ? '$white' : '$green500'}
fontFamily="$heading" fontFamily="$heading"
fontSize="$sm" fontSize="$sm"
> >

View file

@ -47,6 +47,23 @@ export function SignIn() {
title="Acessar" title="Acessar"
/> />
</Center> </Center>
<Center
flex={1}
justifyContent="flex-end"
mt="$4"
>
<Text
color="$gray100"
fontSize="$sm"
mb="$3"
fontFamily="$body"
>
Ainda não tem acesso?
</Text>
<Button title="Criar Conta" variant="outline" />
</Center>
</VStack> </VStack>
</VStack> </VStack>
) )