- GitHub Staff
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| export const getCars = (state) => state.car.cars; | |
| export const getCarById = (carId) => (state) => getCars(state)[carId]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| export const carClicked = (carId) => (dispatch, getState) => { | |
| const state = getState(); | |
| const canToggle = getCanToggle(state); | |
| if (!canToggle) return; | |
| const car = getCarById(carId)(state); | |
| dispatch(selectCar(car.id, !car.selected)); | |
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| export const loadCars = () => async (dispatch, getState) => { | |
| const state = getState(); | |
| // check if already loaded cars | |
| if (getCars(state).length > 0) return; | |
| // simulate ajax load | |
| const data = await new Promise((resolve) => | |
| setTimeout(() => resolve(carData), 500) | |
| ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| src | |
| ├── App.js | |
| ├── components | |
| │ ├── Car.js | |
| │ └── Options.js | |
| ├── containers | |
| │ └── CarsPageContainer.js | |
| ├── index.js | |
| └── store | |
| ├── actions |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import React from "react"; | |
| const Car = ({ car, canToggle, selectCar }) => { | |
| const onCarClicked = () => { | |
| if (!canToggle) return; | |
| selectCar(car.id, !car.selected); | |
| }; | |
| return ( | |
| <div className="card m-1" style={{ width: "18rem" }}> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <input type="text" autocomplete="off" | |
| class="form-control" | |
| id="txtUsername" | |
| name="txtUsername" | |
| placeholder="Username" | |
| [(ngModel)]="credentialModel.userName" | |
| #formUsername="ngModel" | |
| required | |
| lhiNonEmail | |
| lhiWebUserIdAvailable |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <form class="form admin-form" #accountForm="ngForm" *ngIf="user"> | |
| <div class="row"> | |
| <div class="col-sm-5 text-right-form">First Name</div> | |
| <div class="col-sm-7 col-md-4"> | |
| <input class="form-control" type="text" name="FirstName" [(ngModel)]="user.FirstName" [disabled]="user.$saving" /> | |
| </div> | |
| </div> | |
| <div class="row"> | |
| <div class="col-sm-5 text-right-form">Last Name</div> | |
| <div class="col-sm-7 col-md-4"> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const INITIAL_STATE = { | |
| count: 0 | |
| } | |
| // Action | |
| const increaseAction = { type: 'increase' } | |
| // Reducer | |
| function counter(state, action) { | |
| const count = state.count |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import Immutable from 'seamless-immutable' | |
| import _ from 'lodash' | |
| import { makeReducer } from './index' | |
| export const INITIAL_STATE = Immutable({ | |
| campaigns: {}, | |
| activeCampaignId: null | |
| }) | |
| export const reducer = {} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!DOCTYPE html> | |
| <html ng-app="minos-public"> | |
| <head> | |
| <title>Minos Disposition Engine </title> | |
| <meta name="viewport" content="width=device-width, initial-scale=1"> | |
| <link rel="stylesheet" href="/assets/vendor/font-awesome/css/font-awesome.css"/> | |
| <link rel="stylesheet" href="/assets/vendor/bootswatch/yeti/bootstrap.css"/> | |
| <link rel="stylesheet" href="/assets/styles/style.css"/> |