UNPKG

@s20.ai/safecam-360-rn

Version:

A React Native component to view the interior panorama and exterior 360 degree views of a product featuring suppport for hotspots. Compatible with Android and iOS

37 lines (34 loc) 1.26 kB
import { get } from "immer/dist/internal"; import React from "react"; import { connect } from "react-redux"; import constants from "../../../config/constants"; import AutoRotateHint from "./AutoRotateHint"; import ExteriorRotateHint from "./ExteriorRotateHint"; import InteriorRotateHint from "./InteriorRotateHint"; const AnimationOverlay = ({ messageHint, customFontFamily }) => { const getMessage = () => { for (const key in messageHint) { if (Object.hasOwnProperty.call(messageHint, key)) { const element = messageHint[key]; if (element.show && !element.never) switch (key) { case constants.MESSAGES.AUTO_ROTATE_MESSAGE: return <AutoRotateHint customFontFamily={customFontFamily}/> case constants.MESSAGES.EXTERIOR_ROTATE: return <ExteriorRotateHint/> case constants.MESSAGES.INTERIOR_ROTATE: return <InteriorRotateHint customFontFamily={customFontFamily}/> default: return } } } }; return (<>{getMessage()}</>) }; const mapStateToProps = ({ messageHint, currentView }) => { return { messageHint: messageHint }; }; export default connect(mapStateToProps)(AnimationOverlay);