Initial commit

This commit is contained in:
2020-05-25 14:55:37 +05:30
commit d4f93a106a
115 changed files with 24977 additions and 0 deletions

View File

@@ -0,0 +1,3 @@
.c-{{pascalCase name}} {
}

View File

@@ -0,0 +1,17 @@
import React from 'react';
import PropTypes from 'prop-types';
import './{{pascalCase name}}.component.scss';
const {{pascalCase name}} = props => {
return (
<div className='c-{{pascalCase name}}'>
In Component {{pascalCase name}}
</div>
);
};
{{pascalCase name}}.propTypes = {
};
export default {{pascalCase name}};

View File

@@ -0,0 +1,8 @@
import React from 'react';
import {{pascalCase name}} from './{{pascalCase name}}';
describe('{{pascalCase name}}', () => {
it('renders without error', () => {
});
});

View File

@@ -0,0 +1,3 @@
import {{pascalCase name}} from './{{pascalCase name}}.jsx';
export default {{pascalCase name}};

View File

@@ -0,0 +1,17 @@
import React from 'react';
import PropTypes from 'prop-types';
import './{{pascalCase name}}.module.scss';
const {{pascalCase name}} = props => {
return (
<div className="c-{{pascalCase name}}">
In Page {{pascalCase name}}
</div>
);
};
{{pascalCase name}}.propTypes = {
};
export default {{pascalCase name}};

View File

@@ -0,0 +1,3 @@
.c-{{pascalCase name}} {
}

View File

@@ -0,0 +1,8 @@
import React from 'react';
import {{pascalCase name}} from './{{pascalCase name}}';
describe('{{pascalCase name}}', () => {
it('renders without error', () => {
});
});

View File

@@ -0,0 +1,16 @@
export const UPDATE_FORM_VALUES = 'UPDATE_{{constantCase name}}_FORM_VALUES'
export const UPDATE_FORM_ERRORS = 'UPDATE_{{constantCase name}}_FORM_ERRORS'
export const updateFormValues = (formValues) => {
return {
type: UPDATE_FORM_VALUES,
payload: formValues
}
}
export const updateFormErrors = (formErrors) => {
return {
type: UPDATE_FORM_ERRORS,
payload: formErrors
}
}

View File

@@ -0,0 +1,3 @@
import {{pascalCase name}} from './{{pascalCase name}}.jsx';
export default {{pascalCase name}};

View File

@@ -0,0 +1,16 @@
import Immutable from 'immutable'
import {UPDATE_FORM_ERRORS, UPDATE_FORM_VALUES} from './actions'
const initialState = Immutable.Map()
const reducer = (state = initialState, action) => {
switch (action.type) {
case UPDATE_FORM_ERRORS:
case UPDATE_FORM_VALUES:
return state.mergeDeep(action.payload)
default:
return state
}
}
export default reducer

View File

@@ -0,0 +1,14 @@
import {createSelector} from 'reselect'
import {createGetSelector} from 'reselect-immutable-helpers'
const getData = ({data}) => data
export const get{{pascalCase name}} = createSelector(
getData,
(dataState) => {
return dataState.pages.{{camelCase name}}
}
)
export const getFormErrors = createGetSelector(get{{pascalCase name}}, 'formErrors')
export const getFormValues = createGetSelector(get{{pascalCase name}}, 'formValues')

View File

@@ -0,0 +1,5 @@
const {{camelCase name}} = () => {
};
export default {{camelCase name}};

View File

@@ -0,0 +1,5 @@
/* PLOP_INJECT_IMPORT */
export {
/* PLOP_INJECT_EXPORT */
}

View File

@@ -0,0 +1,17 @@
const create{{pascalCase name}} = () => {
let examplePrivateVariable = 0
return {
getExamplePrivateVariable: () => {
return examplePrivateVariable
},
setExamplePrivateVariable: (n) => {
examplePrivateVariable = n
}
}
};
const singleton = create{{pascalCase name}}();
Object.freeze(singleton);
export default singleton;