Fix mini-camera layout

This commit is contained in:
Bill 2021-08-16 13:18:55 -04:00
parent ca18bf2f30
commit 909fbc1715
3 changed files with 23 additions and 3 deletions

View File

@ -25,4 +25,5 @@
@import './card/NitroCardView';
@import './draggable-window/DraggableWindow';
@import './loading-spinner/LoadingSpinnerView';
@import './mini-camera/NitroLayoutMiniCameraView';
@import './trophy/NitroLayoutTrophyView';

View File

@ -1,4 +1,4 @@
import { FC } from 'react';
import { FC, MouseEvent, useCallback } from 'react';
import { useNitroCardContext } from '../context/NitroCardContext';
import { NitroCardHeaderViewProps } from './NitroCardHeaderView.types';
@ -7,6 +7,12 @@ export const NitroCardHeaderView: FC<NitroCardHeaderViewProps> = props =>
const { headerText = null, onCloseClick = null } = props;
const { simple = false } = useNitroCardContext();
const onMouseDown = useCallback((event: MouseEvent<HTMLDivElement>) =>
{
event.stopPropagation();
event.nativeEvent.stopImmediatePropagation();
}, []);
if(simple)
{
return (
@ -14,7 +20,7 @@ export const NitroCardHeaderView: FC<NitroCardHeaderViewProps> = props =>
<div className="row nitro-card-header simple-header">
<div className="d-flex justify-content-center align-items-center w-100 position-relative">
<div className="h5 text-white text-center text-shadow bg-tertiary-split border-top-0 rounded-bottom drag-handler">{ headerText }</div>
<div className="position-absolute header-close" onMouseDown={ event => event.stopPropagation() } onClick={ onCloseClick }>
<div className="position-absolute header-close" onMouseDownCapture={ onMouseDown } onClick={ onCloseClick }>
<i className="fas fa-times" />
</div>
</div>
@ -28,7 +34,7 @@ export const NitroCardHeaderView: FC<NitroCardHeaderViewProps> = props =>
<div className="row nitro-card-header">
<div className="d-flex justify-content-center align-items-center w-100 position-relative">
<div className="h4 text-white text-shadow header-text">{ headerText }</div>
<div className="position-absolute header-close" onMouseDown={ event => event.stopPropagation() } onClick={ onCloseClick }>
<div className="position-absolute header-close" onMouseDownCapture={ onMouseDown } onClick={ onCloseClick }>
<i className="fas fa-times" />
</div>
</div>

View File

@ -0,0 +1,13 @@
.nitro-room-thumbnail-camera {
width: 132px;
height: 192px;
background-image: url('../../assets/images/room-widgets/thumbnail-widget/thumbnail-camera-spritesheet.png');
.camera-frame {
position: absolute;
width: 110px;
height: 110px;
margin-top: 38px;
margin-left: 3px;
}
}