@coorpacademy/app-review 0.0.4 → 0.0.6

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.
@@ -0,0 +1,2 @@
1
+ export * from './navigation';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/actions/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC"}
@@ -0,0 +1 @@
1
+ export * from './navigation';
@@ -0,0 +1,13 @@
1
+ import { ActionCreator } from 'redux';
2
+ export declare const NAVIGATE_TO = "@@navigation/NAVIGATE_TO";
3
+ export declare const NAVIGATE_BACK = "@@navigation/NAVIGATE_BACK";
4
+ export declare type $NAVIGATE_TO = {
5
+ type: '@@navigation/NAVIGATE_TO';
6
+ payload: string;
7
+ };
8
+ export declare type $NAVIGATE_BACK = {
9
+ type: '@@navigation/NAVIGATE_BACK';
10
+ };
11
+ export declare const navigateTo: ActionCreator<$NAVIGATE_TO>;
12
+ export declare const navigateBack: ActionCreator<$NAVIGATE_BACK>;
13
+ //# sourceMappingURL=navigation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"navigation.d.ts","sourceRoot":"","sources":["../../src/actions/navigation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,aAAa,EAAC,MAAM,OAAO,CAAC;AAEpC,eAAO,MAAM,WAAW,6BAA6B,CAAC;AACtD,eAAO,MAAM,aAAa,+BAA+B,CAAC;AAE1D,oBAAY,YAAY,GAAG;IACzB,IAAI,EAAE,0BAA0B,CAAC;IACjC,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,oBAAY,cAAc,GAAG;IAC3B,IAAI,EAAE,4BAA4B,CAAC;CACpC,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,aAAa,CAAC,YAAY,CAGjD,CAAC;AAEH,eAAO,MAAM,YAAY,EAAE,aAAa,CAAC,cAAc,CAErD,CAAC"}
@@ -0,0 +1,9 @@
1
+ export const NAVIGATE_TO = '@@navigation/NAVIGATE_TO';
2
+ export const NAVIGATE_BACK = '@@navigation/NAVIGATE_BACK';
3
+ export const navigateTo = (newPath) => ({
4
+ type: NAVIGATE_TO,
5
+ payload: newPath
6
+ });
7
+ export const navigateBack = () => ({
8
+ type: NAVIGATE_BACK
9
+ });
@@ -0,0 +1,9 @@
1
+ interface Props {
2
+ skillsToRevise: {
3
+ title?: string;
4
+ info?: string;
5
+ }[];
6
+ }
7
+ declare const RevisionHome: (props: Props) => JSX.Element;
8
+ export default RevisionHome;
9
+ //# sourceMappingURL=revision-home.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"revision-home.d.ts","sourceRoot":"","sources":["../../src/components/revision-home.tsx"],"names":[],"mappings":"AAWA,UAAU,KAAK;IACb,cAAc,EAAE;QAAC,KAAK,CAAC,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAA;KAAC,EAAE,CAAC;CACnD;AAoGD,QAAA,MAAM,YAAY,UAAW,KAAK,gBASjC,CAAC;AAEF,eAAe,YAAY,CAAC"}
@@ -0,0 +1,83 @@
1
+ import * as React from 'react';
2
+ import { View, FlatList, Pressable, StyleSheet, Text } from 'react-native';
3
+ import { NovaCompositionNavigationArrowRight as ArrowRight } from '@coorpacademy/nova-icons';
4
+ const styles = StyleSheet.create({
5
+ container: {
6
+ flex: 1,
7
+ padding: 20
8
+ // paddingTop: HEADER_HEIGHT + 20,
9
+ // backgroundColor: theme.colors.white
10
+ },
11
+ title: {
12
+ // fontSize: theme.fontSize.xlarge,
13
+ // fontWeight: theme.fontWeight.bold,
14
+ lineHeight: 28
15
+ // color: theme.colors.text.primary,
16
+ // marginBottom: theme.spacing.base,
17
+ // marginTop: theme.spacing.small
18
+ },
19
+ subtitle: {
20
+ // fontSize: theme.fontSize.xlarge,
21
+ // color: theme.colors.text.primary,
22
+ // marginBottom: theme.spacing.tiny
23
+ },
24
+ text: {
25
+ fontSize: 16,
26
+ lineHeight: 22,
27
+ // color: theme.colors.text.primary,
28
+ opacity: 0.7
29
+ // marginBottom: theme.spacing.base
30
+ },
31
+ noSkillsImage: {
32
+ flex: 1,
33
+ alignSelf: 'center',
34
+ width: 320,
35
+ height: 300
36
+ },
37
+ skills: {},
38
+ skill: {
39
+ display: 'flex',
40
+ flexDirection: 'row',
41
+ overflow: 'hidden',
42
+ alignItems: 'center',
43
+ height: 118,
44
+ borderRadius: 8
45
+ // backgroundColor: theme.colors.gray.lighter,
46
+ // marginTop: theme.spacing.micro,
47
+ // marginBottom: theme.spacing.micro,
48
+ // padding: theme.spacing.base
49
+ },
50
+ skillTexts: {
51
+ flex: 1,
52
+ flexDirection: 'column'
53
+ },
54
+ skillTitle: {
55
+ fontSize: 18,
56
+ fontWeight: '600',
57
+ lineHeight: 22
58
+ // color: theme.colors.text.primary,
59
+ // marginBottom: theme.spacing.tiny
60
+ },
61
+ skillInfo: {
62
+ fontSize: 12,
63
+ lineHeight: 16
64
+ // color: theme.colors.gray.medium
65
+ },
66
+ extraSpace: {
67
+ height: 100
68
+ }
69
+ });
70
+ const onSelectSkill = (title) => () => {
71
+ console.log('pressed on', { title });
72
+ };
73
+ const ExtraSpace = () => React.createElement(View, { style: styles.extraSpace });
74
+ const Skill = ({ title, info }) => (React.createElement(Pressable, { style: styles.skill, onPress: onSelectSkill(title) },
75
+ React.createElement(View, { style: styles.skillTexts },
76
+ React.createElement(Text, { style: styles.skillTitle }, title),
77
+ React.createElement(Text, { style: styles.skillInfo }, info)),
78
+ React.createElement(ArrowRight, { color: "#ededed", height: 20, width: 20 })));
79
+ const renderSkill = ({ item: { title, info, isExtraSpace = false } }) => isExtraSpace ? React.createElement(ExtraSpace, null) : React.createElement(Skill, { title: title, info: info });
80
+ const Skills = (props) => (React.createElement(FlatList, { contentContainerStyle: styles.skills, data: props.skills, renderItem: renderSkill }));
81
+ const NoSkills = () => (React.createElement(React.Fragment, null));
82
+ const RevisionHome = (props) => (React.createElement(View, { style: styles.container }, !props.skillsToRevise || props.skillsToRevise.length === 0 ? (React.createElement(NoSkills, null)) : (React.createElement(Skills, { skills: [...props.skillsToRevise, { isExtraSpace: true }] }))));
83
+ export default RevisionHome;
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=revision-home.stories.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"revision-home.stories.d.ts","sourceRoot":"","sources":["../../src/components/revision-home.stories.tsx"],"names":[],"mappings":""}
@@ -0,0 +1,14 @@
1
+ import * as React from 'react';
2
+ import { storiesOf } from '@storybook/react-native';
3
+ import RevisionHome from './revision-home';
4
+ const emptySkills = [];
5
+ const skillsToRevise = [
6
+ { title: 'Negotiation and powers of persuasion', info: '75 questions to revise' },
7
+ { title: 'Negotiation and powers of persuasion', info: '75 questions to revise' },
8
+ { title: 'Negotiation and powers of persuasion', info: '75 questions to revise' },
9
+ { title: 'Negotiation and powers of persuasion', info: '75 questions to revise' },
10
+ { title: 'Creativity and innovation', info: '75 questions to revise' }
11
+ ];
12
+ storiesOf('RevisionHome', module)
13
+ .add('No skills', () => React.createElement(RevisionHome, { skillsToRevise: emptySkills }))
14
+ .add('Few skills', () => React.createElement(RevisionHome, { skillsToRevise: skillsToRevise }));
@@ -0,0 +1,3 @@
1
+ declare const RevisionOnboarding: () => JSX.Element;
2
+ export default RevisionOnboarding;
3
+ //# sourceMappingURL=revision-onboarding.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"revision-onboarding.d.ts","sourceRoot":"","sources":["../../src/components/revision-onboarding.tsx"],"names":[],"mappings":"AAkEA,QAAA,MAAM,kBAAkB,mBAevB,CAAC;AAEF,eAAe,kBAAkB,CAAC"}
@@ -0,0 +1,57 @@
1
+ import * as React from 'react';
2
+ import { View, StyleSheet, Text } from 'react-native';
3
+ // import theme from '../../../modules/theme';
4
+ // import translations from '../../../translations';
5
+ // import Button from '../../../app-shared/components/button';
6
+ // import {HEADER_HEIGHT} from '../../../app-shared/components/header-v2';
7
+ const styles = StyleSheet.create({
8
+ container: {
9
+ justifyContent: 'space-between',
10
+ flex: 1,
11
+ padding: 20
12
+ // paddingTop: HEADER_HEIGHT + 20
13
+ },
14
+ title: {
15
+ height: 72,
16
+ width: 268,
17
+ // fontSize: theme.fontSize.xxlarge,
18
+ // fontWeight: theme.fontWeight.bold,
19
+ lineHeight: 36
20
+ // color: theme.colors.text.primary,
21
+ // marginBottom: theme.spacing.small
22
+ },
23
+ text: {
24
+ // fontSize: theme.fontSize.large,
25
+ // color: theme.colors.text.primary,
26
+ opacity: 0.7
27
+ // marginBottom: theme.spacing.small
28
+ },
29
+ tip: {
30
+ flexDirection: 'row',
31
+ overflow: 'hidden',
32
+ alignItems: 'center',
33
+ height: 54,
34
+ borderRadius: 8
35
+ // backgroundColor: theme.colors.gray.extra,
36
+ // marginTop: theme.spacing.micro,
37
+ // marginBottom: theme.spacing.micro
38
+ },
39
+ tipText: {
40
+ // fontSize: theme.fontSize.large,
41
+ // color: theme.colors.text.primary
42
+ },
43
+ icon: {
44
+ margin: 10
45
+ },
46
+ button: {
47
+ height: 52,
48
+ borderRadius: 7
49
+ // marginBottom: theme.spacing.large,
50
+ // marginTop: theme.spacing.large
51
+ }
52
+ });
53
+ const onButtonPress = () => { };
54
+ const Tip = ({ Icon, text }) => (React.createElement(View, { style: styles.tip },
55
+ React.createElement(Text, { style: styles.tipText }, text)));
56
+ const RevisionOnboarding = () => (React.createElement(View, { style: styles.container }));
57
+ export default RevisionOnboarding;
@@ -0,0 +1,18 @@
1
+ export declare type _Choice_ = {
2
+ text?: string;
3
+ selected: boolean;
4
+ };
5
+ export declare type _Slide_ = {
6
+ category: string;
7
+ question: string;
8
+ instruction: string;
9
+ type: 'multiSelection' | 'singleSelection' | 'trueOrFalse';
10
+ choices?: _Choice_[];
11
+ };
12
+ interface Props {
13
+ slide: _Slide_;
14
+ num: number;
15
+ }
16
+ declare const RevisionQuizzer: ({ slide }: Props) => JSX.Element;
17
+ export default RevisionQuizzer;
18
+ //# sourceMappingURL=revision-quizzer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"revision-quizzer.d.ts","sourceRoot":"","sources":["../../src/components/revision-quizzer.tsx"],"names":[],"mappings":"AASA,oBAAY,QAAQ,GAAG;IACrB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,OAAO,CAAC;CACnB,CAAC;AAEF,oBAAY,OAAO,GAAG;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,gBAAgB,GAAG,iBAAiB,GAAG,aAAa,CAAC;IAC3D,OAAO,CAAC,EAAE,QAAQ,EAAE,CAAC;CACtB,CAAC;AAEF,UAAU,KAAK;IACb,KAAK,EAAE,OAAO,CAAC;IACf,GAAG,EAAE,MAAM,CAAC;CACb;AA2ID,QAAA,MAAM,eAAe,cAAa,KAAK,gBAStC,CAAC;AAEF,eAAe,eAAe,CAAC"}
@@ -0,0 +1,120 @@
1
+ import * as React from 'react';
2
+ import { View, StyleSheet, Text, useWindowDimensions } from 'react-native';
3
+ const quizzerStyle = StyleSheet.create({
4
+ container: {
5
+ flex: 1,
6
+ padding: 20,
7
+ // paddingTop: HEADER_HEIGHT + 20, @todo with props
8
+ // backgroundColor: theme.colors.white, @todo with props
9
+ justifyContent: 'space-between',
10
+ alignItems: 'center'
11
+ }
12
+ });
13
+ const SLIDE_HEIGHT = () => useWindowDimensions().height * 0.75;
14
+ const creatSlideStyle = (num) => StyleSheet.create({
15
+ slide: {
16
+ position: 'absolute',
17
+ // backgroundColor: theme.colors.white, @todo with props
18
+ top: useWindowDimensions().height / 2 - SLIDE_HEIGHT() / 2 - num * 4,
19
+ flex: 1,
20
+ height: SLIDE_HEIGHT(),
21
+ width: useWindowDimensions().width - 40 - num * 8,
22
+ justifyContent: 'space-between',
23
+ alignItems: 'center',
24
+ padding: 25,
25
+ shadowColor: '#000',
26
+ shadowOffset: { width: 0, height: -1 },
27
+ shadowOpacity: 0.05,
28
+ shadowRadius: 16,
29
+ elevation: 10 - num * 1,
30
+ borderRadius: 16
31
+ },
32
+ category: {
33
+ fontSize: 12,
34
+ lineHeight: 16,
35
+ // color: theme.colors.text.primary, @todo with props
36
+ // marginBottom: theme.spacing.tiny, @todo with props
37
+ // marginTop: theme.spacing.small, @todo with props
38
+ textAlign: 'center'
39
+ },
40
+ question: {
41
+ fontSize: 16,
42
+ lineHeight: 22,
43
+ fontWeight: '700',
44
+ // color: theme.colors.text.primary, @todo with props
45
+ textAlign: 'center'
46
+ },
47
+ instruction: {
48
+ fontSize: 12,
49
+ lineHeight: 16,
50
+ // color: theme.colors.gray.medium, @todo with props
51
+ // marginBottom: theme.spacing.base, @todo with props
52
+ // marginTop: theme.spacing.small, @todo with props
53
+ textAlign: 'center'
54
+ },
55
+ button: {
56
+ width: 287,
57
+ height: 52,
58
+ borderRadius: 7
59
+ // marginTop: theme.spacing.base @todo with props
60
+ }
61
+ });
62
+ const createOptionStyle = (selected) => {
63
+ // const brandTheme = React.useContext(BrandThemeContext); @todo with props
64
+ return StyleSheet.create({
65
+ box: {
66
+ width: '100%',
67
+ // https://stackoverflow.com/a/66561995/959219
68
+ shadowColor: '#000',
69
+ shadowOffset: { width: 0, height: -1 },
70
+ shadowOpacity: 0.2,
71
+ shadowRadius: 16,
72
+ elevation: 8,
73
+ // backgroundColor: selected ? brandTheme.colors.primary : theme.colors.white, @todo with props
74
+ padding: 12,
75
+ marginTop: 4,
76
+ marginBottom: 4,
77
+ borderRadius: 8
78
+ },
79
+ text: {
80
+ fontSize: 15,
81
+ fontWeight: 'bold',
82
+ lineHeight: 24,
83
+ // color: selected ? theme.colors.white : theme.colors.text.primary, @todo with props
84
+ textAlign: 'center'
85
+ }
86
+ });
87
+ };
88
+ const choicesStyle = StyleSheet.create({
89
+ container: {
90
+ flex: 1,
91
+ width: '100%',
92
+ justifyContent: 'center',
93
+ alignItems: 'center'
94
+ }
95
+ });
96
+ const onButtonPress = () => { };
97
+ const Choices = ({ choices }) => (React.createElement(View, { style: choicesStyle.container }, choices.map(({ text, selected = false }) => {
98
+ const optionStyle = createOptionStyle(selected);
99
+ return (React.createElement(View, { style: optionStyle.box },
100
+ React.createElement(Text, { style: optionStyle.text },
101
+ text,
102
+ " ",
103
+ selected)));
104
+ })));
105
+ const Slide = ({ slide, num }) => {
106
+ const slideStyle = creatSlideStyle(num);
107
+ return (React.createElement(View, { style: slideStyle.slide },
108
+ React.createElement(Text, { style: slideStyle.category },
109
+ slide.category,
110
+ " ",
111
+ num),
112
+ React.createElement(Text, { style: slideStyle.question }, slide.question),
113
+ React.createElement(Text, { style: slideStyle.instruction }, slide.instruction),
114
+ React.createElement(Choices, { choices: slide.choices })));
115
+ };
116
+ const RevisionQuizzer = ({ slide }) => {
117
+ const slides = [slide, slide, slide, slide, slide];
118
+ return (React.createElement(View, { style: quizzerStyle.container }, slides.reverse().map((slide, index) => (React.createElement(Slide, { slide: slide, num: slides.length - index })))));
119
+ };
120
+ export default RevisionQuizzer;
@@ -0,0 +1,6 @@
1
+ export default function configureStore(services: any): import("redux").Store<import("redux").EmptyObject & {
2
+ navigation: import("./reducers/navigation").State;
3
+ }, import("redux").AnyAction> & {
4
+ dispatch: unknown;
5
+ };
6
+ //# sourceMappingURL=configure-store.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"configure-store.d.ts","sourceRoot":"","sources":["../src/configure-store.ts"],"names":[],"mappings":"AASA,MAAM,CAAC,OAAO,UAAU,cAAc,CAAC,QAAQ,KAAA;;;;EAc9C"}
@@ -0,0 +1,18 @@
1
+ import { applyMiddleware, compose, createStore } from 'redux';
2
+ import thunk from 'redux-thunk';
3
+ import { composeWithDevTools } from 'redux-devtools-extension';
4
+ import * as actionCreators from './actions';
5
+ import rootReducer from './reducers';
6
+ const preloadedState = undefined;
7
+ export default function configureStore(services) {
8
+ const _compose = process.env.NODE_ENV !== 'production' ? composeWithDevTools : compose;
9
+ const composeEnhancers = _compose({
10
+ actionCreators,
11
+ name: 'app-review',
12
+ trace: true,
13
+ traceLimit: 25
14
+ });
15
+ const composedEnhancer = composeEnhancers(applyMiddleware(thunk));
16
+ const store = createStore(rootReducer, preloadedState, composedEnhancer);
17
+ return store;
18
+ }
@@ -0,0 +1,5 @@
1
+ declare const AppRevision: ({ services }: {
2
+ services: any;
3
+ }) => JSX.Element;
4
+ export default AppRevision;
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.tsx"],"names":[],"mappings":"AAmFA,QAAA,MAAM,WAAW;;iBAehB,CAAC;AAIF,eAAe,WAAW,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,67 @@
1
+ import React, { useEffect, useState } from 'react';
2
+ import { Text, StyleSheet, Pressable, View, BackHandler } from 'react-native';
3
+ import { connect, Provider } from 'react-redux';
4
+ import configureStore from './configure-store';
5
+ import { navigateTo, navigateBack } from './actions/navigation';
6
+ import { getCurrentViewName } from './reducers/navigation';
7
+ // -----------------------------------------------------------------------------
8
+ const styles = StyleSheet.create({
9
+ rootView: {
10
+ flex: 1,
11
+ alignItems: 'center',
12
+ justifyContent: 'center'
13
+ }
14
+ });
15
+ // -----------------------------------------------------------------------------
16
+ const NavText = ({ viewName, navigateTo }) => {
17
+ console.log({ viewName });
18
+ switch (viewName) {
19
+ case 'home':
20
+ return (React.createElement(Pressable, { onPress: () => {
21
+ navigateTo('onboarding');
22
+ } },
23
+ React.createElement(Text, null, "view home")));
24
+ case 'onboarding':
25
+ return (React.createElement(Pressable, { onPress: () => navigateTo('quizzer') },
26
+ React.createElement(Text, null, "view onboarding")));
27
+ case 'quizzer':
28
+ return (React.createElement(Pressable, { onPress: () => navigateTo('home') },
29
+ React.createElement(Text, null, "view quizzer")));
30
+ default:
31
+ return React.createElement(Text, null, "view (none selected)");
32
+ }
33
+ };
34
+ // -----------------------------------------------------------------------------
35
+ const RootView = (props) => {
36
+ const backAction = () => {
37
+ props.navigateBack();
38
+ return true;
39
+ };
40
+ useEffect(() => {
41
+ // https://reactnative.dev/docs/backhandler
42
+ const backHandler = BackHandler.addEventListener('hardwareBackPress', backAction);
43
+ return () => backHandler.remove();
44
+ }, []);
45
+ return (React.createElement(View, { style: styles.rootView },
46
+ React.createElement(NavText, { viewName: props.viewName, navigateTo: props.navigateTo })));
47
+ };
48
+ // -----------------------------------------------------------------------------
49
+ const mapStateToProps = (state, ownProps) => {
50
+ return Object.assign(Object.assign({}, ownProps), { viewName: getCurrentViewName(state) });
51
+ };
52
+ const mapDispatchToProps = { navigateTo, navigateBack };
53
+ const App = connect(mapStateToProps, mapDispatchToProps)(RootView);
54
+ // -----------------------------------------------------------------------------
55
+ const AppRevision = ({ services }) => {
56
+ const [store, setStore] = useState(null);
57
+ useEffect(() => {
58
+ const store = configureStore(services);
59
+ setStore(store);
60
+ }, []);
61
+ if (!store)
62
+ return null;
63
+ return (React.createElement(Provider, { store: store },
64
+ React.createElement(App, null)));
65
+ };
66
+ // -----------------------------------------------------------------------------
67
+ export default AppRevision;
@@ -0,0 +1,5 @@
1
+ declare const rootReducer: import("redux").Reducer<import("redux").CombinedState<{
2
+ navigation: import("./navigation").State;
3
+ }>, import("redux").AnyAction>;
4
+ export default rootReducer;
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/reducers/index.ts"],"names":[],"mappings":"AAGA,QAAA,MAAM,WAAW;;8BAEf,CAAC;AAEH,eAAe,WAAW,CAAC"}
@@ -0,0 +1,6 @@
1
+ import { combineReducers } from 'redux';
2
+ import navigation from './navigation';
3
+ const rootReducer = combineReducers({
4
+ navigation
5
+ });
6
+ export default rootReducer;
@@ -0,0 +1,7 @@
1
+ import type { $NAVIGATE_TO, $NAVIGATE_BACK } from '../actions/navigation';
2
+ export declare type State = Array<string>;
3
+ export declare const initialState: State;
4
+ declare const reducer: (state: State, action: $NAVIGATE_TO | $NAVIGATE_BACK) => State;
5
+ export declare const getCurrentViewName: (appState: any) => any;
6
+ export default reducer;
7
+ //# sourceMappingURL=navigation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"navigation.d.ts","sourceRoot":"","sources":["../../src/reducers/navigation.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAC,YAAY,EAAE,cAAc,EAAC,MAAM,uBAAuB,CAAC;AAExE,oBAAY,KAAK,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC;AAElC,eAAO,MAAM,YAAY,EAAE,KAAgB,CAAC;AAE5C,QAAA,MAAM,OAAO,yBAAyC,YAAY,GAAG,cAAc,UAalF,CAAC;AAEF,eAAO,MAAM,kBAAkB,wBAAkE,CAAC;AAClG,eAAe,OAAO,CAAC"}
@@ -0,0 +1,18 @@
1
+ import { NAVIGATE_BACK, NAVIGATE_TO } from '../actions/navigation';
2
+ export const initialState = ['home'];
3
+ const reducer = (state = initialState, action) => {
4
+ switch (action.type) {
5
+ case NAVIGATE_TO: {
6
+ return [...state, action.payload];
7
+ }
8
+ case NAVIGATE_BACK: {
9
+ const newState = [...state];
10
+ newState.pop();
11
+ return newState;
12
+ }
13
+ default:
14
+ return state;
15
+ }
16
+ };
17
+ export const getCurrentViewName = appState => appState.navigation[appState.navigation.length - 1];
18
+ export default reducer;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@coorpacademy/app-review",
3
- "version": "0.0.4",
3
+ "version": "0.0.6",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "engines": {
@@ -11,14 +11,16 @@
11
11
  },
12
12
  "author": "CoorpAcademy",
13
13
  "files": [
14
+ "dist",
14
15
  "src",
15
16
  "readme.md"
16
17
  ],
17
18
  "exports": {
18
19
  ".": {
19
- "import": "./src/index.tsx",
20
- "types": "./types/index.d.ts"
21
- }
20
+ "import": "./dist/index.js",
21
+ "types": "./dist/index.d.ts"
22
+ },
23
+ "./package.json": "./package.json"
22
24
  },
23
25
  "dependencies": {
24
26
  "react": "^18.1.0",
@@ -31,5 +33,5 @@
31
33
  "redux-devtools-extension": "^2.13.9",
32
34
  "typescript": "^4.6.4"
33
35
  },
34
- "gitHead": "158b91fe516fa07c7899e55b5ade66d5a944396f"
36
+ "gitHead": "0faaf927f730c95f7c54b8d8b5e7bbcb70910776"
35
37
  }