diff --git a/static/js/shop/BacklogGroups.jsx b/static/js/shop/BacklogGroups.jsx
new file mode 100644
index 0000000..592d68e
--- /dev/null
+++ b/static/js/shop/BacklogGroups.jsx
@@ -0,0 +1,44 @@
+import {ProductItem} from "./ProductItem";
+import React from "react";
+import {useShopStore} from "./shop_store";
+
+export function BacklogGroups() {
+ const data = useShopStore((state) => state.groups);
+ const items = useShopStore((state) => state.cards);
+
+ const ordered_groups = data.categories.map(groupItem => ({
+ name: groupItem.name,
+ items: groupItem.itemIds.map(itemId => items[itemId])
+ }));
+ let item_index = -1;
+ const groups = ordered_groups.map((group, g_index) => {
+ return (
+
+
+
+
+
+
+ {group.items.map(item => {
+ item_index++;
+ return (
+
+ )
+ })}
+
+
+
+ );
+ }
+ );
+ return (
+
+ {groups}
+
+ )
+}
\ No newline at end of file
diff --git a/static/js/shop/BacklogSearchResult.jsx b/static/js/shop/BacklogSearchResult.jsx
new file mode 100644
index 0000000..77b4dd0
--- /dev/null
+++ b/static/js/shop/BacklogSearchResult.jsx
@@ -0,0 +1,16 @@
+import React from 'react';
+import {useShopStore} from "./shop_store";
+import {ProductItem} from "./ProductItem";
+
+
+export function BacklogSearchResult() {
+ const cards_to_display = useShopStore((state) => state.listed_cards);
+ return ( <>
+ {cards_to_display.map((item, _) => {
+ return (
+
+ )
+ })}
+ >
+ )
+}
\ No newline at end of file
diff --git a/static/js/shop/SearchBar.jsx b/static/js/shop/SearchBar.jsx
new file mode 100644
index 0000000..7285a0e
--- /dev/null
+++ b/static/js/shop/SearchBar.jsx
@@ -0,0 +1,19 @@
+import React from 'react';
+import {useShopStore} from "./shop_store";
+
+export function SearchBar() {
+ const search_bar_value = useShopStore((state) => state.search_bar_value);
+ const updateSearchBar = useShopStore((state) => state.updateSearchBar);
+
+ return (
+
+ updateSearchBar(event.target.value)}
+ aria-label="Search"/>
+
+ )
+}
\ No newline at end of file
diff --git a/static/js/shop/shop_store.js b/static/js/shop/shop_store.js
index 05c5e28..b98d3a1 100644
--- a/static/js/shop/shop_store.js
+++ b/static/js/shop/shop_store.js
@@ -29,6 +29,21 @@ const useBacklog = ((set, get) => ({
cardIndexById: card_id => get().cards_list.findIndex((element) => (card_id === element))
}));
+const useSearch = ((set, get) => ({
+ search_index: Array.from(Object.values(shared_data.items)
+ .map((card, _) => (
+ [(card.name + " " + card.name_number + " " + card.name_codename).toLowerCase(), card.id]
+ ))),
+ search_bar_value: "",
+ listed_cards: [],
+ updateSearchBar: text => set(state => ({
+ search_bar_value: text,
+ listed_cards: text.length > 0 ? Array.from(get().search_index
+ .filter((card, _) => card[0].includes(text.toLowerCase()))
+ .map(([index, card_id], _) => get().cards_list.findIndex(elem => elem === card_id))) : []
+ }))
+}));
+
const useCrateModes = ((set, get) => ({
crate_modes: shared_data.crateModes,
modes_order: shared_data.crateModeOrder,
@@ -569,6 +584,7 @@ const useCart = ((set, get) => ({
export const useShopStore = createWithEqualityFn((...params) => ({
...useBacklog(...params),
+ ...useSearch(...params),
...useCrateModes(...params),
...useCart(...params),
...useSubmitForm(...params),