Skip to content

Instantly share code, notes, and snippets.

View xamedow's full-sized avatar
🏠
Working from home

Andrey Khamedov xamedow

🏠
Working from home
View GitHub Profile
import { takeEvery, put } from 'redux-saga/effects';
import * as R from 'ramda';
import { createReducer } from 'redux-create-reducer';
import {DADATA_ADDRESS_API_URL, DADATA_KEY} from "../../shared/const";
import request from "../../sagas/request";
export const FETCH_ADDRESSES = 'FETCH_ADDRESSES';
export const FETCH_ADDRESSES_SUCCESS = 'FETCH_ADDRESSES_SUCCESS';
export const FETCH_ADDRESSES_ERROR = 'FETCH_ADDRESSES_ERROR';
import React from 'react';
import PropTypes from 'prop-types';
import cn from 'classnames';
import * as styles from './styles.scss';
import Button from '../Button/Button';
const AddButton = ({ children, className, title, onClick, ...props }) => (
<span className={cn(styles.button, className)} {...props}>
<label>
@xamedow
xamedow / Condition.tsx
Last active August 18, 2019 21:01
Final form animated condition component
import React from "react";
import { Field } from "react-final-form";
import { useSpring, animated } from "react-spring";
interface Props extends React.HTMLProps<HTMLElement> {
when: string;
is: any;
}
interface InnerProps {
@xamedow
xamedow / Condition.tsx
Created August 18, 2019 21:10
Final form condition animated component with leave staet and translate animation
import React from "react";
import { Field } from "react-final-form";
import { useTransition, animated } from "react-spring";
import styled from "styled-components";
interface Props extends React.HTMLProps<HTMLElement> {
when: string;
is: any;
}
@xamedow
xamedow / validators.test.ts
Created August 21, 2019 05:50
final form validators
import {
applyValidators,
isCyrillic,
isEmail,
isEntityOgrnValid,
isEntityINNValid,
isIeOgrnValid,
isIEINNValid,
required,
isPassword,
import React from 'react';
import PropTypes from 'prop-types';
import { Field } from 'react-final-form';
import { useSpring, animated } from 'react-spring';
interface IProps extends React.HTMLProps<HTMLElement> {
when: string;
equal?: string | boolean;
isIn?: {};
cb?: any;
@xamedow
xamedow / gist:a01782da3c0db52be4c3c0f24bed591e
Created January 14, 2020 12:51
Validator helper functions
import {
__,
anyPass,
always,
allPass,
compose,
contains,
converge,
curry,
drop,
const createDocumentToAPI = (appID: string) => {
utils.api.setBaseURL(`${BASE_API_URL}:${DOCUMENTS_PORT}`);
const headers = {
...defaultHeaders,
'Content-Type': 'multipart/form-data;'
};
const formData = new FormData();
@xamedow
xamedow / README.md
Created October 20, 2020 14:14
UULA-test-app

Uula Frontend Test Application

Your task is to create comments section component with ability for the client to create/read/update/delete/like/dislike/complain comments

Comments section should be located at the comment page of the app '/comments'

Initially you should request a list of existing comments at the API endpoint and if there are none - show empty list placeholder

Each comment could be unfolded and show a list of replies if any, replies should be also provided with CRUD controls

Uula Frontend Test Application

Your task is to create comments section component with ability for the client to create/read/update/delete/like/dislike/complain comments

Comments section should be located at the comment page of the app '/comments'

Initially you should request a list of existing comments at the API endpoint and if there are none - show empty list placeholder

Each comment could be unfolded and show a list of replies if any, replies should be also provided with CRUD controls