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 platformSpecific = ({ios, android}) => (Platform.OS == 'ios') ? ios : android; | |
<View style={{ color: platformSpecific({ ios: 'black', android: 'white' }) }}/> |
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
Задача: | |
Используя открытый API (https://dog.ceo/dog-api/) написать небольшое web-приложение на стэке React 16.x + Redux. | |
Приложение должно иметь более чем один "роут". | |
Сборка должна производиться webpack версии 4. | |
Структура, дизайн, архитектура приложения остаётся на совесть выполняющего данное тестовое задание :) К этому критериев нет. | |
Приветствуется: | |
* Обоснованное расширение стэка библиотеками. | |
* Добавление server side rendering. |
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
## http://example.com redirects to https://example.com | |
server { | |
listen 80; | |
listen [::]:80; | |
server_name example.com; | |
include /etc/nginx/snippets/letsencrypt.conf; | |
location / { | |
return 301 https://example.com$request_uri; |
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
{ | |
"name": "package-name", | |
"version": "0.0.1", | |
"description": "Package Description", | |
"keywords": ["key", "words"], | |
"main": "app.js", | |
"engines": { | |
"node": ">8.0.0" | |
}, | |
"author": { |
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
ssl_protocols TLSv1 TLSv1.1 TLSv1.2; | |
ssl_prefer_server_ciphers on; | |
ssl_ciphers "EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH"; | |
ssl_ecdh_curve secp384r1; | |
ssl_session_cache shared:SSL:10m; | |
ssl_session_tickets off; | |
ssl_stapling on; | |
ssl_stapling_verify on; | |
resolver 8.8.8.8 8.8.4.4 valid=300s; | |
resolver_timeout 5s; |
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
Задача: | |
Используя открытый API (https://dog.ceo/dog-api/) написать небольшое web-приложение на стэке React 16.x.x + Redux + React-Router. | |
Приложение должно иметь более чем один роут: список собак, страница конкретной собаки. | |
Сборка должна производиться с помощью webpack версии 4.x.x. | |
Обязательное и обоснованное использование EcmaScript 6+ фич (babel-present-env). | |
Код должен быть отформатирован по eslint airbnb (https://www.npmjs.com/package/eslint-config-airbnb) | |
Дизайн и структура файлов/папок проекта приложения остаётся на совесть выполняющего данное тестовое задание. | |
Что мы хотим видеть? |
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 _ from 'lodash'; | |
export default class EventEmitterManager { | |
constructor() { | |
this.handlerCallbacks = {}; | |
} | |
listenOn(eventName, handlerCallback) { | |
if (!this.handlerCallbacks[eventName]) { | |
this.handlerCallbacks[eventName] = []; |
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, { | |
useRef, useEffect, useCallback, useState, | |
} from 'react'; | |
import { fromEvent, merge } from 'rxjs'; | |
import PropTypes from 'prop-types'; | |
const styles = { | |
wrapper: { | |
position: 'relative', | |
}, |
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 { useEffect, useState } from 'react'; | |
import createActivityDetector from 'activity-detector'; | |
// inspired by https://egghead.io/lessons/react-detect-user-activity-with-a-custom-useidle-react-hook | |
export const useInactivity = (options) => { | |
const [isIdle, setIsIdle] = useState(false); | |
useEffect(() => { | |
const activityDetector = createActivityDetector(options); |
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 { useCallback } from 'react'; | |
export const usePreventPageScroll = () => { | |
const enable = useCallback(() => { | |
// Prevent scrolling | |
document.body.style.position = 'fixed'; | |
document.body.style.top = `-${window.scrollY}px`; | |
}, []); | |
const disable = useCallback(() => { |
OlderNewer