From 45124cb4098702ee278dd75b274480ef02214bd3 Mon Sep 17 00:00:00 2001 From: Marks Polakovs Date: Fri, 20 Mar 2020 11:19:32 +0000 Subject: [PATCH] Style fiddling --- src/showplanner/index.tsx | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/src/showplanner/index.tsx b/src/showplanner/index.tsx index 7846447..2208850 100644 --- a/src/showplanner/index.tsx +++ b/src/showplanner/index.tsx @@ -1,4 +1,4 @@ -import React, { useState, useReducer, useRef, useEffect } from "react"; +import React, { useState, useReducer, useRef, useEffect, memo } from "react"; import { DndProvider, useDrag, useDrop } from "react-dnd"; import HTML5Backend from "react-dnd-html5-backend"; import { ContextMenu, ContextMenuTrigger, MenuItem } from "react-contextmenu"; @@ -41,7 +41,7 @@ const CML_CACHE: { [recordid_trackid: string]: Track } = {}; const TS_ITEM_MENU_ID = "SongMenu"; -function Item({ +const Item = memo(function Item({ item: x, index, column @@ -96,7 +96,7 @@ function Item({ )} ); -} +}); const USE_REAL_GAIN_VALUE = false; @@ -108,11 +108,12 @@ function Player({ id }: { id: number }) { return (
- {playerState.loadedItem == null &&
No Media Selected
} - {playerState.loadedItem !== null && playerState.loading == false && ( -
{playerState.loadedItem.title}
- )} - {playerState.loading && LOADING} +
+ {playerState.loadedItem !== null && playerState.loading == false + ? playerState.loadedItem.title + : "No Media Selected"}{" "} + {playerState.loading && LOADING} +