@eohjsc/react-native-smart-city 0.2.71 → 0.2.72

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@eohjsc/react-native-smart-city",
3
3
  "title": "React Native Smart Home",
4
- "version": "0.2.71",
4
+ "version": "0.2.72",
5
5
  "description": "TODO",
6
6
  "main": "index.js",
7
7
  "files": [
@@ -5,6 +5,7 @@ export const Action = {
5
5
  LIST_DEVICE_TYPES: 'LIST_DEVICE_TYPES',
6
6
  LIST_ACTION: 'LIST_ACTION',
7
7
  IS_FIRST_OPEN_CAMERA: 'IS_FIRST_OPEN_CAMERA',
8
+ IS_LAVIDA_SOURCE: 'IS_LAVIDA_SOURCE',
8
9
  };
9
10
 
10
11
  export type AuthData = {
@@ -48,4 +49,5 @@ export type ActionDataMap = {
48
49
 
49
50
  export type AppType = {
50
51
  isFirstOpenCamera: boolean;
52
+ isLavidaSource: boolean;
51
53
  };
@@ -39,6 +39,7 @@ export const initialState = {
39
39
  listAction: [] as ListAction,
40
40
  app: {
41
41
  isFirstOpenCamera: true,
42
+ isLavidaSource: false,
42
43
  },
43
44
  };
44
45
 
@@ -97,6 +98,15 @@ export const reducer = (currentState: ContextData, action: Action) => {
97
98
  isFirstOpenCamera: payload,
98
99
  },
99
100
  };
101
+ case Action.IS_LAVIDA_SOURCE: {
102
+ return {
103
+ ...currentState,
104
+ app: {
105
+ ...currentState.app,
106
+ isLavidaSource: payload,
107
+ },
108
+ };
109
+ }
100
110
  default:
101
111
  return currentState;
102
112
  }
@@ -18,7 +18,7 @@ import { lgThinqConnect } from '../../iot/RemoteControl/LG';
18
18
  import ShortDetailSubUnit from '../../commons/SubUnit/ShortDetail';
19
19
  import NavBar from '../../commons/NavBar';
20
20
  import WrapParallaxScrollView from '../../commons/WrapParallaxScrollView';
21
- import { SCContext } from '../../context';
21
+ import { SCContext, useSCContextSelector } from '../../context';
22
22
  import { Action } from '../../context/actionType';
23
23
  import CameraDevice from '../../commons/CameraDevice';
24
24
  import { ModalFullVideo } from '../../commons/Modal';
@@ -43,6 +43,9 @@ const UnitDetail = ({ route }) => {
43
43
  const isFocused = useIsFocused();
44
44
  const { stateData, setAction } = useContext(SCContext);
45
45
  const { navigate } = useNavigation();
46
+ const isLavidaSource = useSCContextSelector(
47
+ (state) => state.app.isLavidaSource
48
+ );
46
49
 
47
50
  const [unit, setUnit] = useState(unitData || { id: unitId });
48
51
  const [appState, setAppState] = useState(AppState.currentState);
@@ -306,8 +309,8 @@ const UnitDetail = ({ route }) => {
306
309
  }, [navigate, routeName]);
307
310
 
308
311
  const Dashboard = useCallback(() => {
309
- navigate(Routes.Dashboard);
310
- }, [navigate]);
312
+ navigate(isLavidaSource ? Routes.SmartHomeDashboard : Routes.Dashboard);
313
+ }, [isLavidaSource, navigate]);
311
314
 
312
315
  return (
313
316
  <WrapParallaxScrollView
@@ -126,6 +126,7 @@ const Routes = {
126
126
  GatewayWifiList: 'GatewayWifiList',
127
127
  ConfirmUnitDeletion: 'ConfirmUnitDeletion',
128
128
  SmartAccount: 'SmartAccount',
129
+ SmartHomeDashboard: 'SmartHomeDashboard',
129
130
  };
130
131
 
131
132
  export default Routes;