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

RENAN MARINHO SANTOS #7

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
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
41 changes: 14 additions & 27 deletions src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,31 +1,18 @@
import {
Center,
ChakraProvider,
Input,
Box,
Button
} from '@chakra-ui/react'
import { login } from './services/login';
import { Box, Button } from "@chakra-ui/react";
import Header from "./components/Header/Header";
import { showWelcomeMessage } from "./components/messange";
import LoginForm from "./components/Form";

function App() {


const HomePage: React.FC = () => {
return (
<ChakraProvider>
<Box minHeight='100vh' backgroundColor='#9413dc' padding='25px'>
<Box backgroundColor='#FFFFFF' borderRadius='25px' padding='15px' >
<Center>
<h1>Faça o login</h1>
</Center>
<Input placeholder="email" />
<Input placeholder="password" />
<Center>
<Button onClick={login} colorScheme='teal' size='sm' width='100%' marginTop='5px'>
Button
</Button>
</Center>
</Box>
</Box>
</ChakraProvider>
<Box textAlign="center" p={4}>
<Header />
<LoginForm />
<Button onClick={showWelcomeMessage}>Login</Button>
</Box>
);
}
};

export default App;
export default HomePage;
21 changes: 21 additions & 0 deletions src/components/Form.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import { Box, Input, FormControl, FormLabel, Heading } from "@chakra-ui/react";

const LoginForm: React.FC = () => {
return (
<Box borderWidth="1px" borderRadius="lg" p={6} width="300px" mx="auto">
<Heading as="h2" size="md" mb={4} textAlign="center">
Login
</Heading>
<FormControl id="email" mb={4}>
<FormLabel>Email</FormLabel>
<Input type="email" placeholder="Digite seu email" />
</FormControl>
<FormControl id="password" mb={6}>
<FormLabel>Senha</FormLabel>
<Input type="password" placeholder="Digite sua senha" />
</FormControl>
</Box>
);
};

export default LoginForm;
20 changes: 12 additions & 8 deletions src/components/Header/Header.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
import './Header.css'
import { Box, Heading } from "@chakra-ui/react";

export const Header = () => {
return(
<div className='header'>
Dio Bank
</div>
)
}
const Header: React.FC = () => {
return (
<Box as="header" bg="teal.500" py={4} textAlign="center" >
<Heading as="h1" color="white">
Minha Aplicação
</Heading>
</Box>
);
};

export default Header;
12 changes: 0 additions & 12 deletions src/components/Layout.tsx

This file was deleted.

18 changes: 18 additions & 0 deletions src/components/button.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { Button as ChakraButton } from "@chakra-ui/react";



interface ButtonProps {
onClick: () => void;
label: string;
}

const Button: React.FC<ButtonProps> = ({ onClick, label }) => {
return (
<ChakraButton colorScheme="teal" onClick={onClick}>
{label}
</ChakraButton>
);
};

export default Button;
3 changes: 3 additions & 0 deletions src/components/messange.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export const showWelcomeMessage = () => {
alert("Bem-vindo à aplicação!");
};