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 viewportConfig = { | |
| isDesktop: '(min-width: 1280px)', | |
| isDesktopSm: '(max-width: 1279px)', | |
| isTablet: '(max-width: 1023px)', | |
| isMobileLg: '(max-width: 767px)', | |
| isMobileMd: '(max-width: 639px)', | |
| }; | |
| // ============================================================== |
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 { MutableRefObject, useCallback, useEffect } from 'react'; | |
| const useClickOutside = ( | |
| target: MutableRefObject<null | HTMLElement>, | |
| handler: () => void, | |
| exceptions: MutableRefObject<null | HTMLElement>[] = [], | |
| ) => { | |
| const handleClickOutside = useCallback((e: MouseEvent) => { | |
| const clickTarget = e.target as HTMLElement; | |
| const hasInterceptionWithTarget = target.current?.contains(clickTarget); |
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
| /** | |
| * The function handles the url depending on whether the path is absolute or relative | |
| * @param url – required url | |
| * @param withHost – inject host name to make an absolute url (with protocol and domain) | |
| * @param lang – language used by client to inject correct host into url | |
| * @returns string | |
| */ | |
| const getStaticPath = ( | |
| url: string, | |
| withHost: boolean = false, |
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
| // use: declOfNum(count, ["Город", "Города", "Городов"]); | |
| const declOfNum = (number, titles) => { | |
| const cases = [2, 0, 1, 1, 1, 2]; | |
| return titles[(number % 100 > 4 && number % 100 < 20) ? 2 : cases[(number % 10 < 5) ? number % 10 : 5]]; | |
| }; | |
| export default declOfNum; |
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'; | |
| import Button from '@/components/ui/Button'; | |
| import Modal from '@/components/ui/Modal'; | |
| import {operation} from '@/store/Operations/Operaion'; | |
| const ModalAddOperation = ({operation, modalVisibility, setModalVisibility, sendCallback}) => { | |
| const makeOperation = () => operation().then(() => { | |
| sendCallback(); | |
| setModalVisibility(false); | |
| }); |
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 PropTypes from 'prop-types'; | |
| import React, {useRef} from 'react'; | |
| import ReactDOM from 'react-dom'; | |
| import styled from 'styled-components'; | |
| const Overlay = styled.div` | |
| position: fixed; | |
| top: 0; | |
| left: 0; | |
| width: 100%; |
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 PropTypes from 'prop-types'; | |
| import React, { | |
| Children, | |
| cloneElement, | |
| isValidElement, | |
| useEffect, | |
| useRef | |
| } from 'react'; | |
| const WithOuterClick = ({children, handler}) => { |
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 Axios from 'axios'; | |
| export default class ServerManager { | |
| constructor(ServiceProvider) { | |
| this._serviceProvider = ServiceProvider; | |
| this._csrfTokenContainer = document.head.querySelector('meta[name="csrf-token"]'); | |
| this._httpClient = this._makeHttpClientInstance(); | |
| } |
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
| $message = 'Hello "User"! <script>window.location.href = \'https://yandex.ru\';</script> Down angled quote (« and ») in HTML [duplicate]'; | |
| echo str_replace( | |
| [""", "&", "«", "»"], | |
| ["\"", "&", "«", "»"], | |
| htmlentities($message) | |
| ); |
NewerOlder