diff --git a/src/views/room/widgets/furniture/high-score/FurnitureHighScoreView.tsx b/src/views/room/widgets/furniture/high-score/FurnitureHighScoreView.tsx index 981fe26a..16f59ba4 100644 --- a/src/views/room/widgets/furniture/high-score/FurnitureHighScoreView.tsx +++ b/src/views/room/widgets/furniture/high-score/FurnitureHighScoreView.tsx @@ -5,17 +5,17 @@ import { useRoomEngineEvent } from '../../../../../hooks'; import { NitroLayoutGrid, NitroLayoutGridColumn } from '../../../../../layout'; import { NitroLayoutBase } from '../../../../../layout/base'; import { useRoomContext } from '../../../context/RoomContext'; -import { ContextMenuView } from '../../context-menu/ContextMenuView'; import { ContextMenuHeaderView } from '../../context-menu/views/header/ContextMenuHeaderView'; import { ContextMenuListView } from '../../context-menu/views/list/ContextMenuListView'; +import { ObjectLocationView } from '../../object-location/ObjectLocationView'; -const SCORE_TYPES = [ 'perteam', 'mostwins', 'classic' ]; -const CLEAR_TYPES = [ 'alltime', 'daily', 'weekly', 'monthly' ]; +const SCORE_TYPES = ['perteam', 'mostwins', 'classic']; +const CLEAR_TYPES = ['alltime', 'daily', 'weekly', 'monthly']; export const FurnitureHighScoreView: FC<{}> = props => { - const [ objectId, setObjectId ] = useState(-1); - const [ stuffData, setStuffData ] = useState(null); + const [objectId, setObjectId] = useState(-1); + const [stuffData, setStuffData] = useState(null); const { roomSession = null } = useRoomContext(); const close = useCallback(() => @@ -23,7 +23,7 @@ export const FurnitureHighScoreView: FC<{}> = props => setObjectId(-1); setStuffData(null); }, []); - + const onRoomEngineTriggerWidgetEvent = useCallback((event: RoomEngineTriggerWidgetEvent) => { switch(event.type) @@ -49,7 +49,7 @@ export const FurnitureHighScoreView: FC<{}> = props => close(); return; } - }, [ roomSession, objectId, close ]); + }, [roomSession, objectId, close]); useRoomEngineEvent(RoomEngineTriggerWidgetEvent.REQUEST_HIGH_SCORE_DISPLAY, onRoomEngineTriggerWidgetEvent); useRoomEngineEvent(RoomEngineTriggerWidgetEvent.REQUEST_HIDE_HIGH_SCORE_DISPLAY, onRoomEngineTriggerWidgetEvent); @@ -57,49 +57,52 @@ export const FurnitureHighScoreView: FC<{}> = props => if((objectId === -1) || !stuffData) return null; return ( - - - { LocalizeText('high.score.display.caption', [ 'scoretype', 'cleartype' ], [LocalizeText(`high.score.display.scoretype.${ SCORE_TYPES[stuffData.scoreType] }`), LocalizeText(`high.score.display.cleartype.${ CLEAR_TYPES[stuffData.clearType] }`) ]) } - - - - - - { LocalizeText('high.score.display.users.header') } - - - - - { LocalizeText('high.score.display.score.header') } - - - -
- - - { stuffData.entries.map((entry, index) => + +
+ + {LocalizeText('high.score.display.caption', ['scoretype', 'cleartype'], [LocalizeText(`high.score.display.scoretype.${SCORE_TYPES[stuffData.scoreType]}`), LocalizeText(`high.score.display.cleartype.${CLEAR_TYPES[stuffData.clearType]}`)])} + + + + + + {LocalizeText('high.score.display.users.header')} + + + + + {LocalizeText('high.score.display.score.header')} + + + +
+ + + {stuffData.entries.map((entry, index) => { return ( - - { entry.users.join(', ') } + + {entry.users.join(', ')} ); }) - } - - - { stuffData.entries.map((entry, index) => + } + + + {stuffData.entries.map((entry, index) => { return ( - - { entry.score } + + {entry.score} ); }) - } - - -
- + } + + + +
+
+ ); } diff --git a/src/views/room/widgets/object-location/ObjectLocationView.tsx b/src/views/room/widgets/object-location/ObjectLocationView.tsx index 69740e78..e21a9b5e 100644 --- a/src/views/room/widgets/object-location/ObjectLocationView.tsx +++ b/src/views/room/widgets/object-location/ObjectLocationView.tsx @@ -50,7 +50,7 @@ export const ObjectLocationView: FC = props => }, [ updatePosition, noFollow ]); return ( -
-1 ? 'visible' : 'invisible') } style={ { left: pos.x, top: pos.y } }> +
-1 ? 'visible' : 'invisible') } style={ { left: pos.x, top: pos.y } }> { children }
);