File size: 1,792 Bytes
f5071ca |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 |
import React from 'react';
import {
Box,
Heading,
HStack,
Text,
useColorModeValue,
VStack,
} from '@chakra-ui/react';
import { PrimaryBtn, SecondaryBtn } from '../utils/Buttons';
import { useNavigate } from 'react-router-dom';
const Hero = ({ display, btnWidth, p, m, onClose }) => {
const navigate = useNavigate();
const changeRoute = (type) => {
if (type === 'create') {
navigate('/create-account');
} else {
navigate('/login');
}
onClose();
};
return (
<VStack w='100%' p={p || '1rem'} display={display} m={m}>
<HStack align='flex-start' mb={5}>
<Box>
<Heading fontSize='1.3rem'>
<Heading
as='span'
color={useColorModeValue('light.primary', 'dark.primary')}
fontSize='1.3rem'
>
DEV Community π©βπ»π¨βπ»
</Heading>{' '}
is a community of 878,258 amazing developers
</Heading>
<Text
pt={2}
color={useColorModeValue('light.linkColor', 'dark.linkColor')}
>
We're a place where coders share, stay up-to-date and grow
their careers.
</Text>
</Box>
</HStack>
<VStack w='100%'>
<PrimaryBtn
w={btnWidth || '50%'}
onClick={() => changeRoute('create')}
>
Create Account
</PrimaryBtn>
<SecondaryBtn w={btnWidth || '50%'} onClick={changeRoute}>
Log in
</SecondaryBtn>
</VStack>
</VStack>
);
};
export default Hero;
|