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 { ITerms } from './index'; | |
| export interface ITerms { | |
| totalPrice: number; | |
| initialPayment: number; | |
| periodMonth: number; | |
| monthlyPayment: number; | |
| initialPaymentRangePercent: { | |
| min: number; | |
| max: number; |
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 types = { | |
| obj: 'Object', | |
| arr: 'Array', | |
| str: 'String', | |
| num: 'Number', | |
| func: 'Function', | |
| bool: 'Boolean', | |
| nil: 'Null', | |
| undef: 'Undefined', | |
| date: 'Date', |
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
| function getMinutes(time: number): string { | |
| const minutes = Math.floor(time / (60 * 1000)).toString(); | |
| return minutes.length > 1 ? minutes : '0' + minutes; | |
| } | |
| function getSeconds(time: number): string { | |
| const seconds = Math.round((time % (60 * 1000)) / 1000).toString(); | |
| return seconds.length > 1 ? seconds : '0' + seconds; | |
| } |
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
| /** | |
| * Store part | |
| */ | |
| export interface IWithOrders extends IWithApplication, IWithConfig, IWithWidgetDictionaries { | |
| orders: IOrdersState; | |
| } | |
| /** | |
| * State | |
| */ |
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 DisplaySize = ({ title, width, height }) => ( | |
| <div> | |
| <h4>{title}</h4> | |
| <p>Width: {width}px</p> | |
| <p>Height: {height}px</p> | |
| </div> | |
| ); | |
| // Компонент для отслеживания ширины и высоты окна |
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 enum constants { | |
| SET = 'feature/SET', | |
| } | |
| export type actions = { | |
| set: { | |
| type: constants.SET; | |
| }; | |
| } |
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 constants = { | |
| FETCH_REQUEST: 'FETCH_REQUEST', | |
| FETCH_SUCCESS: 'FETCH_SUCCESS', | |
| FETCH_FAILURE: 'FETCH_FAILURE' | |
| } | |
| const initialState = { | |
| isFetching: false, | |
| error: false, | |
| data: null |
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 emptyCounterparties = []; | |
| const emptyProducts = []; | |
| /** Список банков */ | |
| export const getCounterparties = (state) => state.orders.data.counterparties; | |
| /** Конкретный банк */ | |
| export const getCounterparty = (state, props) => | |
| state.orders.data.counterparties[props.bankId] || null; |
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 enum constants { | |
| FETCH_REQUEST = 'module/FETCH_REQUEST', | |
| FETCH_SUCCESS = 'module/FETCH_SUCCESS', | |
| FETCH_FAILURE = 'module/FETCH_FAILURE' | |
| } | |
| interface IState { | |
| isFetching: Readonly<boolean>; | |
| isError: Readonly<boolean>; | |
| data: Readonly<IApiResponse>; |
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 source = { | |
| * name: 'Test', | |
| * last_name: 'Test', | |
| * phone: '123456789' | |
| * }; | |
| * | |
| * const dist = { |
OlderNewer