This file contains 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, { useCallback, useState, useRef } from 'react' | |
import { useDropzone } from 'react-dropzone' | |
import styles from './ImageUploader.module.scss'; | |
import Cropper from 'react-cropper'; | |
import 'cropperjs/dist/cropper.css'; | |
import axios from 'axios'; | |
import { Button } from 'components/buttons/button/Button'; | |
import { DialogWindow } from 'components/dialogWindow/DialogWindow'; | |
import { optimizeImage } from './helpers/optimizeImage'; |
This file contains 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
// detectPassiveEvents - для избежания ошибок и увеличения производительности в chromium-браузерах | |
// @ts-ignore | |
import detectPassiveEvents from 'detect-passive-events' | |
const passiveEvents = detectPassiveEvents.hasSupport | |
type TConstructorOptions = { | |
className?: string, | |
offsetTop?: number, | |
color?: string, |
This file contains 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 default function (obj, property, keys = false) { | |
if(!obj) return []; | |
if(Array.isArray(obj)) return obj; | |
if(keys) return Object.keys(obj); | |
return Object.keys(obj).map((key) => { | |
let item = Object.assign(obj[key]); | |
if(property) { |
This file contains 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 default (function fnDelay(){ | |
var timer = 0; | |
return function(callback, ms){ | |
clearTimeout(timer); | |
timer = setTimeout(callback, ms); | |
}; | |
})(); |
This file contains 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
checkAvailableConfirmTypes() { | |
// variables | |
let oldTypes = [ | |
{id: "2",text: "operator's call", show: true}, | |
{id: "4",text: "confirm by sms", show: true} | |
]; | |
let newTypes = { | |
0: "2", | |
}; | |
//add a new Set from newTypes |
This file contains 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
Show hidden characters
{ | |
"env": { | |
"browser": true, | |
"commonjs": true, | |
"es6": true, | |
"node": true | |
}, | |
"parserOptions": { | |
"ecmaFeatures": { | |
"jsx": true |
This file contains 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
" auto reload .vimrc when changed, this avoids reopening vim | |
autocmd! bufwritepost .vimrc source % | |
set nocompatible " be iMproved, required | |
filetype on " required | |
"set universal change-buffer | |
set clipboard=unnamedplus |
This file contains 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 formatData = { | |
// Граммы переводит в килограммы | |
weight : function (weight) { | |
weight = parseFloat(weight); | |
let dimension = ''; | |
if (weight < 1000) { | |
dimension = ' г'; | |
} else { | |
dimension = ' кг'; |
This file contains 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
/** | |
* ENG | |
* Makes element fixed only for the mobile version of site (until 768px) | |
* @constructor | |
* @param {string} sTarget - target css-class for the element, which becomes fixed (.j-sticky-bar) | |
* @param {string} sFixedClass - the name of the css-class you want to add to the sTarget element (j-fixed) | |
* @param {sContent} sFixedClass - when sTarget becomes fixed, sContent element gets additional padding-top (body) | |
*/ | |
/** |
NewerOlder