not inital commit

This commit is contained in:
nora 2021-09-20 08:53:10 +02:00
parent 3fb040df54
commit 0cd2146f3d
8 changed files with 3369 additions and 10 deletions

View file

@ -1,10 +1,32 @@
import React from 'react';
import {Container} from "react-bootstrap";
import React, { useRef, useState } from "react";
import { Button, CardGroup, Container, FormControl, FormGroup, FormLabel, Row } from "react-bootstrap";
import client from "./ApiClient";
function App() {
const searchRef = useRef<HTMLInputElement>(null);
const [bands, setBands] = useState<any[]>([]);
const search = () => {
const input = searchRef.current?.value;
if (!input) {
return;
}
client.searchBand(input).then((res) => setBands(res.bands));
};
return (
<Container>
hi
<Row>
<FormGroup>
<FormLabel>Search Band</FormLabel>
<FormControl name="searchBand" type="text" ref={searchRef} />
</FormGroup>
<Button onClick={search}>Search</Button>
</Row>
<Row>
<CardGroup>{bands && bands.map((band) => <div>{band}</div>)}</CardGroup>
</Row>
</Container>
);
}