Add react-bootstrap.

Now we're strappin'
This commit is contained in:
Eli Ribble 2024-08-26 16:07:43 -07:00
parent 7cd1a9cd97
commit d1746b6d17
3 changed files with 241 additions and 2 deletions

View file

@ -1,6 +1,29 @@
import React from 'react';
import React, { ReactNode, useState } from 'react';
import logo from './logo.svg';
import './App.css';
import Toast from 'react-bootstrap/Toast';
import Button from 'react-bootstrap/Button';
interface Props {
children?: ReactNode
}
const ExampleToast = ({ children }: Props) => {
const [show, toggleShow] = useState(true);
return (
<>
{!show && <Button onClick={() => toggleShow(true)}>Show Toast</Button>}
<Toast show={show} onClose={() => toggleShow(false)}>
<Toast.Header>
<strong className="mr-auto">React-Bootstrap</strong>
</Toast.Header>
<Toast.Body>{children}</Toast.Body>
</Toast>
</>
);
};
function App() {
return (
@ -18,6 +41,8 @@ function App() {
>
Learn React
</a>
<Button onClick={() => {console.log("hey")}}>Hey</Button>
<ExampleToast/>
</header>
</div>
);