- app.js
const express = require('express');
const http = require('http');
const fs = require('fs');
const app = express();
const adminRouter = express.Router();
| // Bootstrap | |
| /* Custom, iPhone Retina */ | |
| @media only screen and (min-width : 320px) { | |
| } | |
| /* Extra Small Devices, Phones */ | |
| @media only screen and (min-width : 480px) { |
| import validation from 'validate.js'; | |
| export default function validate(fieldName, value) { | |
| let constraints = { | |
| email: { | |
| presence: true, | |
| format: { | |
| pattern: /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/, | |
| message: 'Invalid email id', | |
| }, | |
| }, |
| form validation react native |
| import { | |
| ... | |
| SafeAreaView | |
| } from 'react-native'; | |
| class Main extends React.Component { | |
| render() { | |
| return ( | |
| <SafeAreaView style={styles.safeArea}> | |
| <App /> | |
| </SafeAreaView> |
| // helpers/Storage.js | |
| import {createAsyncStorage} from '@react-native-community/async-storage'; | |
| const AsyncStorage = createAsyncStorage(100 * 1024 * 1024); | |
| export default AsyncStorage; |
| export const API_STATUS = { | |
| //1×× Informational | |
| AS_100: {'CODE':100,'DES': 'Continue'}, | |
| AS_101: {'CODE':101,'DES': 'Switching Protocols'}, | |
| AS_102: {'CODE':102,'DES': 'Processing'}, | |
| //2×× Success | |
| AS_200: {'CODE':200,'DES': 'OK'}, | |
| AS_201: {'CODE':201,'DES': 'Created'}, | |
| AS_202: {'CODE':202,'DES': 'Accepted'}, | |
| AS_203: {'CODE':203,'DES': 'Non-authoritative Information'}, |
| import { | |
| LOADING_START, | |
| LOADING_END, | |
| REDIRECT_TO_MANAGE_PAGE, | |
| GET_TOKEN, | |
| SAVE_TOKEN, | |
| REMOVE_TOKEN, | |
| ERROR, | |
| } from '../constent/io'; | |
| import asyncStore from 'react-native-simple-store'; |
| import {Alert, Share} from 'react-native'; | |
| import {NavigationActions, StackActions} from 'react-navigation'; | |
| import {ALL_SCREEN} from './Constants'; | |
| let moment = require('moment'); | |
| const date1 = (text) => { | |
| return moment(text).format('D MMMM YYYY'); | |
| }; | |
| let shareAp = () => { |