Skip to content

Commit a049df6

Browse files
committed
Moved Pet status list to container
1 parent 08897fc commit a049df6

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

src/components/SelectStatus.js

+1-6
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
11
import React from "react";
22
import { Col, Form } from "react-bootstrap";
3-
export const SelectStatus = ({ defaultValue, onSelect }) => {
4-
const petStatus = [
5-
{ key: 1, id: null, name: "All" },
6-
{ key: 2, id: "AVAILABLE", name: "Available" },
7-
{ key: 3, id: "CHECKEDOUT", name: "Checked Out" },
8-
];
3+
export const SelectStatus = ({ petStatus, defaultValue, onSelect }) => {
94
const setSelect = (e) => {
105
e.preventDefault();
116
let index = e.target.options.selectedIndex;

src/pages/list/ListContainer.js

+6
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@ import { Logout } from "./../../components/Logout";
77
import { PetsProvider } from "../../providers/refetchProvider";
88

99
export const ListContainer = () => {
10+
const petStatus = [
11+
{ key: 1, id: null, name: "All" },
12+
{ key: 2, id: "AVAILABLE", name: "Available" },
13+
{ key: 3, id: "CHECKEDOUT", name: "Checked Out" },
14+
];
1015
const [selectedStatus, setSelectedStatus] = useState(() => null);
1116

1217
const { loading, error, data, refetch } = usePetsQuery(
@@ -30,6 +35,7 @@ export const ListContainer = () => {
3035
<Form>
3136
<Form.Row>
3237
<SelectStatus
38+
petStatus={petStatus}
3339
onSelect={onSelectStatus}
3440
defaultValue={selectedStatus}
3541
/>

0 commit comments

Comments
 (0)