Skip to content

Instantly share code, notes, and snippets.

View vkhv's full-sized avatar
☁️
Cloud development

Vladislav Khvostov vkhv

☁️
Cloud development
  • Cloud
View GitHub Profile
@vkhv
vkhv / prepare-commit-msg
Last active July 13, 2017 16:01 — forked from jasonmerino/prepare-commit-msg
Prepend branch name to every git commit message unless on master. This fork aimed to git flow and discard keyword feature.
#!/bin/sh
#
# Prepend the branch name to the commit message
#
# Add this file as [repo]/.git/hooks/prepare-commit-msg
#
# A couple notes:
# 1. The file must be executable (chmod +x prepare-commit-msg)
# 2. This works on a per-repo basis (unless you follow this guide https://coderwall.com/p/jp7d5q/create-a-global-git-commit-hook)
Type Props = {
// Имя пользователя
userName: string
}
Type State = {
// Имя пользователя
userName: string
}
import * as React from 'react';
import {Decorator, Text, PtForm} from 'yamoney-guidelines';
import * as logo from './images/logo.svg';
import * as chair from './images/chair.png';
import styled from 'styled-components';
import {RadioButton, Select, Button, TextInput} from 'lego-on-react';
import 'lego-on-react/src/components/radio-button/radio-button.css';
import 'lego-on-react/src/components/select/select.css';
import 'lego-on-react/src/components/button/button.css';
import 'lego-on-react/src/components/textinput/textinput.css';
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
<link rel="stylesheet" href="css/style.css">
<script
src="http://code.jquery.com/jquery-3.3.1.min.js"
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
<style>
.container {
display: flex;
@vkhv
vkhv / Button.tsx
Last active February 26, 2018 06:48
import * as React from 'react';
import {Button as LegoButton} from 'lego-on-react';
export class StyledLegoButton extends React.Component<{className?: string}> {
render() {
return (
<LegoButton
theme="normal"
size="xs"
type="submit"
import {StyledLegoButton} from '../../../../components/Button';
import * as React from 'react';
import styled from 'styled-components';
const StyledButton = styled(StyledLegoButton)`
line-height: 10px;
`;
class QueuesTabContent extends React.PureComponent {
import {Button as LegoButton} from 'lego-on-react';
import * as React from 'react';
import styled from 'styled-components';
const StyledButtonWrpapper = styled.div`
& .button {
line-height: 10px;
}
`;
Ну вот смотри есть тип c двумя полями:
type Entity = {
name: string,
id: number
}
Ты, напрмер, пишешь экшен который использует этот тип чтобы поменять существующий объект:
const editEntity = (entity: Entity): Entity => ({name: 'bazz', id: 2});
import * as React from 'react';
import {Decorator, PtForm, Text} from 'yamoney-guidelines';
import {RadioButton as LegoRadioButton} from 'lego-on-react';
import {ReduxFormRadioButtonProps} from './types';
/**
* Компонент radio-button для работы с Redux Form
*/
export class ReduxFormRadioButton extends React.PureComponent<ReduxFormRadioButtonProps> {
constructor(props: ReduxFormRadioButtonProps) {