Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Task_8_solution #321

Open
wants to merge 16 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
feat: added unknown sort of flowers
RamanMukhin committed Sep 8, 2021
commit 3ecbb3abaff9b183af23daea2e3fcfc143b736bf
Binary file added src/assets/img/unknown.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
19 changes: 19 additions & 0 deletions src/components/pages/PageProducts/components/Products.tsx
Original file line number Diff line number Diff line change
@@ -13,6 +13,16 @@ import axios from "axios";
import API_PATHS from "constants/apiPaths";
// import productList from "./productList.json";

const knownSorts = [
"avalansh",
"dzhumiliya",
"fiesta",
"kenya",
"missPiggi",
"redNaomi",
"vau",
];

const useStyles = makeStyles((theme) => ({
card: {
height: "100%",
@@ -41,6 +51,15 @@ export default function Products() {
// setProducts(productList);
}, []);

products.map((product) => {
if (knownSorts.includes(product.sort)) {
return product.sort;
} else {
product.sort = "unknown";
return product.sort;
}
});

return (
<Grid container spacing={4}>
{products.map((product: Product, index: number) => (