Skip to content

Commit

Permalink
Remove unnecessary code movement change
Browse files Browse the repository at this point in the history
  • Loading branch information
thsparks committed Sep 24, 2024
1 parent 7b5a829 commit d228a56
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions teachertool/src/components/CriteriaInstanceDisplay.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,15 @@ interface BlockData {
const BlockInputSegment: React.FC<BlockInputSegmentProps> = ({ instance, param }) => {
const { state: teacherTool } = useContext(AppStateContext);

function handleClick() {
pxt.tickEvent(Ticks.BlockPickerOpened, { criteriaCatalogId: instance.catalogCriteriaId });
showModal({
modal: "block-picker",
criteriaInstanceId: instance.instanceId,
paramName: param.name,
} as BlockPickerOptions);
}

const blockData = useMemo<BlockData | undefined>(() => {
if (!param.value || !teacherTool.toolboxCategories) {
return undefined;
Expand All @@ -161,15 +170,6 @@ const BlockInputSegment: React.FC<BlockInputSegmentProps> = ({ instance, param }
return undefined;
}, [param.value, teacherTool.toolboxCategories]);

function handleClick() {
pxt.tickEvent(Ticks.BlockPickerOpened, { criteriaCatalogId: instance.catalogCriteriaId });
showModal({
modal: "block-picker",
criteriaInstanceId: instance.instanceId,
paramName: param.name,
} as BlockPickerOptions);
}

const style = blockData ? { backgroundColor: blockData.category.color, color: "white" } : undefined;
const blockDisplay = blockData ? <ReadableBlockName blockData={blockData} /> : null;
return (
Expand Down

0 comments on commit d228a56

Please sign in to comment.