Tutorial Part 2
I am currently implementing the authentication error alert
Here is the error.
Here is my code for app.js
import {useMoralis} from "react-moralis";
import {
Alert,
AlertDescription,
AlertIcon,
AlertTitle,
Box,
Button,
CloseButton,
Container,
Heading
} from "@chakra-ui/react";
function App() {
const {authenticate, isAuthenticated, isAuthenticating, authError, logout} = useMoralis();
if(isAuthenticated){
return (
<Container>
<Heading>Welcome to HexAbout</Heading>
<Button onClick={() => logout()}>Logout</Button>
</Container>
)
}
return (
<div>
HexAbout
{authError && (
<Alert status="failed">
<AlertIcon />
<Box flex="1">
<AlertTitle>Authentication Failed</AlertTitle>
<AlertDescription display="block">
{authError.message}
</AlertDescription>
</Box>
<CloseButton position="absolute" right="8px" top="8px" />
</Alert>
)}
<Button onClick={() => authenticate()} isLoading={isAuthenticating}>Authenticate</Button>
</div>
);
}
export default App;
My theory is that it has to do with deleting the .css file in the beginning of the series correct? Shouldn’t Chakra-UI Override in built the react color settings? Is it something else?