forked from ppfun/pixelplanet
hide 3D controls if not using touch device
This commit is contained in:
parent
7f7d054b37
commit
a951bfaf86
|
@ -16,7 +16,7 @@ import HistorySelect from './HistorySelect';
|
|||
import Mobile3DControls from './Mobile3DControls';
|
||||
|
||||
|
||||
const UI = ({ isHistoricalView, is3D }) => {
|
||||
const UI = ({ isHistoricalView, is3D, isOnMobile }) => {
|
||||
if (isHistoricalView) {
|
||||
return <HistorySelect />;
|
||||
}
|
||||
|
@ -25,7 +25,7 @@ const UI = ({ isHistoricalView, is3D }) => {
|
|||
<PalselButton />
|
||||
<Palette />
|
||||
{(is3D) ? null : <GlobeButton />}
|
||||
<Mobile3DControls />
|
||||
{(isOnMobile) ? <Mobile3DControls /> : null}
|
||||
<CoolDownBox />
|
||||
<NotifyBox />
|
||||
</div>
|
||||
|
@ -37,9 +37,13 @@ function mapStateToProps(state: State) {
|
|||
isHistoricalView,
|
||||
is3D,
|
||||
} = state.canvas;
|
||||
const {
|
||||
isOnMobile,
|
||||
} = state.user;
|
||||
return {
|
||||
isHistoricalView,
|
||||
is3D,
|
||||
isOnMobile,
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
@ -25,8 +25,7 @@ export type UserState = {
|
|||
chatMessages: Array,
|
||||
// minecraft
|
||||
minecraftname: string,
|
||||
// just gets set by 3D controls on
|
||||
// on voxel canvases
|
||||
// if user is using touchscreen
|
||||
isOnMobile: boolean,
|
||||
};
|
||||
|
||||
|
|
|
@ -524,8 +524,9 @@ class Renderer {
|
|||
const state = this.store.getState();
|
||||
const {
|
||||
placeAllowed,
|
||||
isOnMobile,
|
||||
} = state.user;
|
||||
if (!placeAllowed) {
|
||||
if (!placeAllowed || isOnMobile) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user