Skip to content

Commit

Permalink
fix: selected category id and run prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
jimcase committed Sep 24, 2024
1 parent 2ff86ba commit 403f7e7
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
8 changes: 7 additions & 1 deletion ui/summit-2024/src/pages/Categories/Categories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,8 @@ const Categories: React.FC<CategoriesProps> = ({ embedded }) => {
}, [fadeChecked, selectedCategory]);

const handleClickMenuItem = (category: string) => {
console.log("handleClickMenuItem");
console.log(category);
setFadeChecked(false);
// @ts-ignore
setSelectedCategory(category);
Expand Down Expand Up @@ -239,7 +241,11 @@ const Categories: React.FC<CategoriesProps> = ({ embedded }) => {
return;
}

const category = categoriesData.find((c) => c.name === selectedCategory);
const category = categoriesData.find(
(c) =>
c.name === selectedCategory ||
c.id === selectedCategory?.toUpperCase().replace(/\s+/g, "_"),
);

const proposalId = category?.proposals?.find(
(p) => p.id === selectedNominee,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import ArrowUpwardOutlinedIcon from "@mui/icons-material/ArrowUpwardOutlined";
import { STATE, ViewReceiptProps } from "./ViewReceipt.type";
import { CustomAccordion } from "../../../components/common/CustomAccordion/CustomAccordion";
import { JsonView } from "../../../components/common/JsonView/JsonView";
import {useAppDispatch, useAppSelector} from "../../../store/hooks";
import { useAppDispatch, useAppSelector } from "../../../store/hooks";
import {
getReceipts,
setVoteReceipt,
Expand All @@ -40,7 +40,6 @@ const ViewReceipt: React.FC<ViewReceiptProps> = ({ categoryId, close }) => {
const receipts = useAppSelector(getReceipts);
const receipt = receipts[categoryId];


const handleCopy = async (data: string) => {
await copyToClipboard(data);
eventBus.publish(EventName.ShowToast, "Copied to clipboard successfully");
Expand Down Expand Up @@ -380,7 +379,7 @@ const ViewReceipt: React.FC<ViewReceiptProps> = ({ categoryId, close }) => {
})();

const actionButton =
receipt?.status === STATE.FULL
receipt?.status === STATE.FULL
? {
action: viewOnChainVote,
iconBottom: <LinkOutlinedIcon />,
Expand Down

0 comments on commit 403f7e7

Please sign in to comment.