From 1886f37335496902dcfac90add160167c3a57b28 Mon Sep 17 00:00:00 2001 From: Rustam Yusupov Date: Wed, 3 Jan 2018 19:06:41 +0200 Subject: [PATCH 001/148] feat(all): init tracker, remove unwanted --- src/components/IconTabs/IconTabs.js | 50 ------ src/components/IconTabs/IconTabs.mock.jsx | 32 ---- src/components/IconTabs/IconTabs.stories.js | 37 ----- src/components/IconTabs/IconTabs.styl | 35 ----- src/components/IconTabs/IconTabs.test..js | 9 -- src/components/IconTabs/index.js | 1 - src/components/atoms/Box/Box.js | 60 -------- src/components/atoms/Box/Box.stories.js | 88 ----------- src/components/atoms/Box/Box.styl | 7 - src/components/atoms/Box/Box.test.js | 9 -- src/components/atoms/Box/index.js | 1 - src/components/atoms/Icon/Icon.js | 27 ---- src/components/atoms/Icon/Icon.stories.js | 81 ---------- src/components/atoms/Icon/Icon.styl | 9 -- src/components/atoms/Icon/Icon.test.js | 9 -- src/components/atoms/Icon/index.js | 1 - .../atoms/SelectColor/SelectColor.js | 95 ------------ .../atoms/SelectColor/SelectColor.stories.js | 26 ---- .../atoms/SelectColor/SelectColor.styl | 36 ----- src/components/atoms/SelectColor/index.js | 1 - .../AdaptiveHeader/AdaptiveHeader.js | 19 --- .../AdaptiveHeader/AdaptiveHeader.styl | 12 -- .../molecules/AdaptiveHeader/index.jsx | 1 - src/components/molecules/Tab/Tab.js | 144 ------------------ src/components/molecules/Tab/Tab.stories.js | 87 ----------- src/components/molecules/Tab/Tab.styl | 68 --------- src/components/molecules/Tab/Tab.test.js | 9 -- src/components/molecules/Tab/index.js | 1 - .../molecules/TabPinned/TabPinned.js | 53 ------- .../molecules/TabPinned/TabPinned.stories.js | 38 ----- .../molecules/TabPinned/TabPinned.styl | 18 --- .../molecules/TabPinned/TabPinned.test.js | 9 -- src/components/molecules/TabPinned/index.js | 1 - src/components/molecules/Tabs/Tabs.js | 69 --------- src/components/molecules/Tabs/Tabs.stories.js | 9 -- src/components/molecules/Tabs/Tabs.styl | 13 -- src/components/molecules/Tabs/Tabs.test.js | 9 -- src/components/molecules/Tabs/index.js | 1 - src/containers/App/App.jsx | 13 +- src/containers/PageCatalog/index.jsx | 2 - .../PageCatalog.jsx => PageMain/PageMain.jsx} | 17 +-- src/containers/PageMain/index.jsx | 1 + src/containers/PageTree/PageTree.jsx | 25 --- src/containers/PageTree/PageTree.styl | 9 -- src/containers/PageTree/index.js | 1 - src/routes.js | 12 +- 46 files changed, 18 insertions(+), 1237 deletions(-) delete mode 100644 src/components/IconTabs/IconTabs.js delete mode 100644 src/components/IconTabs/IconTabs.mock.jsx delete mode 100644 src/components/IconTabs/IconTabs.stories.js delete mode 100644 src/components/IconTabs/IconTabs.styl delete mode 100644 src/components/IconTabs/IconTabs.test..js delete mode 100644 src/components/IconTabs/index.js delete mode 100644 src/components/atoms/Box/Box.js delete mode 100644 src/components/atoms/Box/Box.stories.js delete mode 100644 src/components/atoms/Box/Box.styl delete mode 100644 src/components/atoms/Box/Box.test.js delete mode 100644 src/components/atoms/Box/index.js delete mode 100644 src/components/atoms/Icon/Icon.js delete mode 100644 src/components/atoms/Icon/Icon.stories.js delete mode 100644 src/components/atoms/Icon/Icon.styl delete mode 100644 src/components/atoms/Icon/Icon.test.js delete mode 100644 src/components/atoms/Icon/index.js delete mode 100644 src/components/atoms/SelectColor/SelectColor.js delete mode 100644 src/components/atoms/SelectColor/SelectColor.stories.js delete mode 100644 src/components/atoms/SelectColor/SelectColor.styl delete mode 100644 src/components/atoms/SelectColor/index.js delete mode 100644 src/components/molecules/AdaptiveHeader/AdaptiveHeader.js delete mode 100644 src/components/molecules/AdaptiveHeader/AdaptiveHeader.styl delete mode 100644 src/components/molecules/AdaptiveHeader/index.jsx delete mode 100644 src/components/molecules/Tab/Tab.js delete mode 100644 src/components/molecules/Tab/Tab.stories.js delete mode 100644 src/components/molecules/Tab/Tab.styl delete mode 100644 src/components/molecules/Tab/Tab.test.js delete mode 100644 src/components/molecules/Tab/index.js delete mode 100644 src/components/molecules/TabPinned/TabPinned.js delete mode 100644 src/components/molecules/TabPinned/TabPinned.stories.js delete mode 100644 src/components/molecules/TabPinned/TabPinned.styl delete mode 100644 src/components/molecules/TabPinned/TabPinned.test.js delete mode 100644 src/components/molecules/TabPinned/index.js delete mode 100644 src/components/molecules/Tabs/Tabs.js delete mode 100644 src/components/molecules/Tabs/Tabs.stories.js delete mode 100644 src/components/molecules/Tabs/Tabs.styl delete mode 100644 src/components/molecules/Tabs/Tabs.test.js delete mode 100644 src/components/molecules/Tabs/index.js delete mode 100644 src/containers/PageCatalog/index.jsx rename src/containers/{PageCatalog/PageCatalog.jsx => PageMain/PageMain.jsx} (77%) create mode 100644 src/containers/PageMain/index.jsx delete mode 100644 src/containers/PageTree/PageTree.jsx delete mode 100644 src/containers/PageTree/PageTree.styl delete mode 100644 src/containers/PageTree/index.js diff --git a/src/components/IconTabs/IconTabs.js b/src/components/IconTabs/IconTabs.js deleted file mode 100644 index 1c363ad..0000000 --- a/src/components/IconTabs/IconTabs.js +++ /dev/null @@ -1,50 +0,0 @@ -import React, { PureComponent } from 'react' -import { array, string, func } from 'prop-types' -import cx from 'classnames' -import FontAwesomeSymbol from 'react-fontawesome' -import R from 'ramda' - -import styles from './IconTabs.styl' - -export default class IconTabs extends PureComponent { - static propTypes = { - items: array, - value: string, - onChange: func - } - - static defaultProps = { - items: [], - value: 'decor', - onChange: () => { } - } - - handleClick = name => () => { - this.props.onChange(name) - } - - renderIcon = item => ( - - ) - - render() { - const { items } = this.props - - return ( -
- {items.map(this.renderIcon)} -
- ) - } -} diff --git a/src/components/IconTabs/IconTabs.mock.jsx b/src/components/IconTabs/IconTabs.mock.jsx deleted file mode 100644 index ae900e8..0000000 --- a/src/components/IconTabs/IconTabs.mock.jsx +++ /dev/null @@ -1,32 +0,0 @@ -export default [ - { - id: 1, - name: 'decor', - title: 'Оформление', - iconName: 'paint-brush' - }, - { - id: 2, - name: 'project', - title: 'Проект', - iconName: 'circle' - }, - { - id: 3, - name: 'overview', - title: 'Обзор', - iconName: 'eye' - }, - { - id: 4, - name: 'counters', - title: 'Счетчики', - iconName: 'area-chart' - }, - { - id: 5, - name: 'shares', - title: 'Поделиться', - iconName: 'share-square-o' - } -] diff --git a/src/components/IconTabs/IconTabs.stories.js b/src/components/IconTabs/IconTabs.stories.js deleted file mode 100644 index 2564ba0..0000000 --- a/src/components/IconTabs/IconTabs.stories.js +++ /dev/null @@ -1,37 +0,0 @@ -import React, { Component } from 'react' -import { storiesOf } from '@storybook/react' -import IconTabs from '../IconTabs' -import items from './IconTabs.mock' - -class IconTabsParent extends Component { - state = { - value: 'decor' - } - - handleChange = name => { - this.setState({ - value: name - }) - } - - render() { - return ( -
- -
- ) - } -} - -storiesOf('IconTabs', module) - .addWithInfo('Default', () => ( - - )) - .addWithInfo('IconTabsParent', () => ( - - )) - diff --git a/src/components/IconTabs/IconTabs.styl b/src/components/IconTabs/IconTabs.styl deleted file mode 100644 index 98c408e..0000000 --- a/src/components/IconTabs/IconTabs.styl +++ /dev/null @@ -1,35 +0,0 @@ -@import '~variables.styl' - -.iconTabs - position: relative - display: flex - align-items: center - -.iconTabsItem - color: var(--gray) - display: flex - justify-content: center - align-items: center - flex-direction: column - width: 100% - cursor: pointer - - &:not(:last-child) - margin-right: 20px - - &_active - color: var(--black) - -.iconTabsIcon - display: block - font-size: 30px - color: inherit - font-family: FontAwesome - line-height: inherit - cursor: inherit - -.iconTabsTitle - display: block - font-size: 14px - color: inherit - cursor: inherit diff --git a/src/components/IconTabs/IconTabs.test..js b/src/components/IconTabs/IconTabs.test..js deleted file mode 100644 index 9883956..0000000 --- a/src/components/IconTabs/IconTabs.test..js +++ /dev/null @@ -1,9 +0,0 @@ -import React from 'react' -import { shallow } from 'enzyme' -import IconTabs from '../IconTabs' - -describe('IconTabs', () => { - it('should render normal without any props supplied', () => { - expect(shallow()).toHaveLength(1) - }) -}) diff --git a/src/components/IconTabs/index.js b/src/components/IconTabs/index.js deleted file mode 100644 index 7487381..0000000 --- a/src/components/IconTabs/index.js +++ /dev/null @@ -1 +0,0 @@ -export { default } from './IconTabs' diff --git a/src/components/atoms/Box/Box.js b/src/components/atoms/Box/Box.js deleted file mode 100644 index 86de63e..0000000 --- a/src/components/atoms/Box/Box.js +++ /dev/null @@ -1,60 +0,0 @@ -import React, { PureComponent } from 'react' -import { number, string, bool, oneOfType, node } from 'prop-types' -import Icon from '../Icon' - -import styles from './Box.styl' - -export default class Box extends PureComponent { - static propTypes = { - size: number, - color: string, - backgroundColor: string, - children: oneOfType([string, node]), - isFirst: bool, - isLast: bool, - name: string - } - - static defaultProps = { - size: 36, - color: '#B1FF89', - backgroundColor: '#2A5D10', - isFirst: false, - isLast: false - } - - render() { - const { - size, - color, - backgroundColor, - isFirst, - isLast, - children, - name - } = this.props - - const borderRadius = Math.round(size / 3.5) - const fontSize = Math.round(size / 2.25) - const lineHeight = `${size}px` - - return ( -
- - {children} -
- ) - } -} diff --git a/src/components/atoms/Box/Box.stories.js b/src/components/atoms/Box/Box.stories.js deleted file mode 100644 index 821181f..0000000 --- a/src/components/atoms/Box/Box.stories.js +++ /dev/null @@ -1,88 +0,0 @@ -import React from 'react' -import { storiesOf } from '@storybook/react' -import Box from '../Box' - -storiesOf('Box', module) - .addWithInfo('Default', () => ( - - )) - .addWithInfo('With one symbol', () => ( - - )) - .addWithInfo('With one symbol as children', () => ( - B - )) - .addWithInfo('With long children', () => ( - Box - )) - .addWithInfo('With very long children', () => ( - Box is now very big - )) - .addWithInfo('With Icon', () => ( - - )) - .addWithInfo('Element size 20px', () => ( - - )) - .addWithInfo('Element size 20px with Icon', () => ( - - )) - .addWithInfo('Element size 45px', () => ( - - )) - .addWithInfo('Element size 45px with Icon', () => ( - - )) - .addWithInfo('Element size 70px', () => ( - - )) - .addWithInfo('Element size 70px with Icon', () => ( - - )) - .addWithInfo('Element size 100px', () => ( - - )) - .addWithInfo('Element size 100px with Icon', () => ( - - )) - .addWithInfo('Red element', () => ( - - )) - .addWithInfo('First element', () => ( - - )) - .addWithInfo('Last element', () => ( - - )) - .addWithInfo('Alone element', () => ( - - )) - .addWithInfo('With title', () => ( -
- - Заголовок 1 -
- )) - .addWithInfo('With multiline title', () => ( -
- - Заголовок строкa 1 Заголовок строкa 2 Заголовок строкa 3 -
- )) - .addWithInfo('Complex example', () => ( -
-
- - Первый заголовок из двух строк -
-
- - Второй заголовок состоит из трех строк -
-
- - Третий заголовок -
-
- )) - diff --git a/src/components/atoms/Box/Box.styl b/src/components/atoms/Box/Box.styl deleted file mode 100644 index 293e7f0..0000000 --- a/src/components/atoms/Box/Box.styl +++ /dev/null @@ -1,7 +0,0 @@ -@import '~variables.styl' -.box - display: flex - justify-content: center - align-items: flex-start - align-self: stretch - box-sizing: border-box diff --git a/src/components/atoms/Box/Box.test.js b/src/components/atoms/Box/Box.test.js deleted file mode 100644 index 4a22cd1..0000000 --- a/src/components/atoms/Box/Box.test.js +++ /dev/null @@ -1,9 +0,0 @@ -import React from 'react' -import { shallow } from 'enzyme' -import Box from '../Box' - -describe('Box', () => { - it('should render normal without any props supplied', () => { - expect(shallow()).toHaveLength(1) - }) -}) diff --git a/src/components/atoms/Box/index.js b/src/components/atoms/Box/index.js deleted file mode 100644 index 58cfba7..0000000 --- a/src/components/atoms/Box/index.js +++ /dev/null @@ -1 +0,0 @@ -export { default } from './Box' diff --git a/src/components/atoms/Icon/Icon.js b/src/components/atoms/Icon/Icon.js deleted file mode 100644 index 0f89521..0000000 --- a/src/components/atoms/Icon/Icon.js +++ /dev/null @@ -1,27 +0,0 @@ -import React, { PureComponent } from 'react' -import FontAwesomeSymbol from 'react-fontawesome' -import { string } from 'prop-types' - -import styles from './Icon.styl' - -export default class Icon extends PureComponent { - static propTypes = { - name: string - } - - render() { - const { name } = this.props - - if (!name) { - return null - } - - const content = name.length > 1 - ? - :
{name}
- - return ( - content - ) - } -} diff --git a/src/components/atoms/Icon/Icon.stories.js b/src/components/atoms/Icon/Icon.stories.js deleted file mode 100644 index 18be4e6..0000000 --- a/src/components/atoms/Icon/Icon.stories.js +++ /dev/null @@ -1,81 +0,0 @@ -import React from 'react' -import { storiesOf } from '@storybook/react' -import Icon from '../Icon' - -const iconsLibrary = [ - 'rocket', - 'heart', - 'circle', - 'adjust', - 'asterisk', - 'beer', - 'bell', - 'ambulance', - 'cog', - 'refresh', - 'truck', - 'spinner' -] - -storiesOf('Icon', module) - .addWithInfo('Default', () => ( - - )) - .addWithInfo('Loader', () => ( -
- -
- )) - .addWithInfo('Black and big star', () => ( -
- -
- )) - .addWithInfo('Without name', () => ( -
- -
- )) - .addWithInfo('One symbol', () => ( - - )) - .addWithInfo('Icons library', () => ( - iconsLibrary.map(name => ( - - - - )) - )) - diff --git a/src/components/atoms/Icon/Icon.styl b/src/components/atoms/Icon/Icon.styl deleted file mode 100644 index 5129cc9..0000000 --- a/src/components/atoms/Icon/Icon.styl +++ /dev/null @@ -1,9 +0,0 @@ -@import '~variables.styl' - -.icon - color: inherit - font-size: inherit - font-family: FontAwesome - line-height: inherit - cursor: inherit - diff --git a/src/components/atoms/Icon/Icon.test.js b/src/components/atoms/Icon/Icon.test.js deleted file mode 100644 index f4f58f7..0000000 --- a/src/components/atoms/Icon/Icon.test.js +++ /dev/null @@ -1,9 +0,0 @@ -import React from 'react' -import { shallow } from 'enzyme' -import Icon from '../Icon' - -describe('Icon', () => { - it('should render normal without any props supplied', () => { - expect(shallow()).toHaveLength(1) - }) -}) diff --git a/src/components/atoms/Icon/index.js b/src/components/atoms/Icon/index.js deleted file mode 100644 index 17f79ac..0000000 --- a/src/components/atoms/Icon/index.js +++ /dev/null @@ -1 +0,0 @@ -export { default } from './Icon' diff --git a/src/components/atoms/SelectColor/SelectColor.js b/src/components/atoms/SelectColor/SelectColor.js deleted file mode 100644 index 369afb9..0000000 --- a/src/components/atoms/SelectColor/SelectColor.js +++ /dev/null @@ -1,95 +0,0 @@ -import React, { PureComponent } from 'react' -import { number, string, func, arrayOf } from 'prop-types' -import cx from 'classnames' -import Icon from '../Icon' - -import styles from './SelectColor.styl' - -export default class SelectColor extends PureComponent { - static propTypes = { - size: number, - colorsArray: arrayOf(arrayOf(string)), - currentColorIndex: number, - onChange: func - } - - static defaultProps = { - size: 36, - onChange: () => {} - } - - render() { - const { - size, - colorsArray, - currentColorIndex, - onChange - } = this.props - - const renderColorBox = (color, backgroundColor, index, isActive) => (( - - )) - - const fontSize = Math.round(size / 2.25) - - return ( -
- {colorsArray.map((itemColor, index) => { - const isActive = index === currentColorIndex - return renderColorBox(itemColor[0], itemColor[1], index, isActive) - })} - -
- ) - } -} diff --git a/src/components/atoms/SelectColor/SelectColor.stories.js b/src/components/atoms/SelectColor/SelectColor.stories.js deleted file mode 100644 index 7d1da33..0000000 --- a/src/components/atoms/SelectColor/SelectColor.stories.js +++ /dev/null @@ -1,26 +0,0 @@ -import React from 'react' -import { storiesOf } from '@storybook/react' -import SelectColor from '../SelectColor' - -const colorsArray = [ - ['#000000', '#EE1100'], - ['#000000', '#FF00FE'], - ['#000000', '#FF6644'], - ['#000000', '#FDAE2D'], - ['#000000', '#FDF204'], - ['#000000', '#AACB22'], - ['#000000', '#69D126'], - ['#000000', '#21CCA8'], - ['#000000', '#11AABA'], - ['#000000', '#4443DC'], - ['#000000', '#44229A'], - ['#FFFFFF', '#000000'] -] - -storiesOf('SelectColor', module) - .addWithInfo('Default', () => ( - - )) - .addWithInfo('Color choosed', () => ( - - )) diff --git a/src/components/atoms/SelectColor/SelectColor.styl b/src/components/atoms/SelectColor/SelectColor.styl deleted file mode 100644 index d9561a4..0000000 --- a/src/components/atoms/SelectColor/SelectColor.styl +++ /dev/null @@ -1,36 +0,0 @@ -@import '~variables.styl' -.selectColor - display: flex - box-sizing: border-box - - &__colorBox - display flex - justify-content center - align-items center - flex-shrink 0 - cursor pointer - - &_state_active - cursor default - - &__input - display none - - &__colorBoxChecked - display flex - justify-content center - align-items center - - &__reset - display flex - justify-content center - align-items center - flex-shrink 0 - background-color transparent - border none - outline none - opacity 0.2 - cursor pointer - - &:hover - opacity 1 diff --git a/src/components/atoms/SelectColor/index.js b/src/components/atoms/SelectColor/index.js deleted file mode 100644 index 0180593..0000000 --- a/src/components/atoms/SelectColor/index.js +++ /dev/null @@ -1 +0,0 @@ -export { default } from './SelectColor' diff --git a/src/components/molecules/AdaptiveHeader/AdaptiveHeader.js b/src/components/molecules/AdaptiveHeader/AdaptiveHeader.js deleted file mode 100644 index 3051a27..0000000 --- a/src/components/molecules/AdaptiveHeader/AdaptiveHeader.js +++ /dev/null @@ -1,19 +0,0 @@ -import React, { PureComponent, PropTypes } from 'react' -import styles from './AdaptiveHeader.styl' -import Tabs from '../Tabs/Tabs' - -class AdaptiveHeader extends PureComponent { - static propTypes = { - containerQuery: PropTypes.object - } - render() { - return ( -
- -
- ) - } -} - -export default AdaptiveHeader - diff --git a/src/components/molecules/AdaptiveHeader/AdaptiveHeader.styl b/src/components/molecules/AdaptiveHeader/AdaptiveHeader.styl deleted file mode 100644 index 6d6aa4a..0000000 --- a/src/components/molecules/AdaptiveHeader/AdaptiveHeader.styl +++ /dev/null @@ -1,12 +0,0 @@ -@import '~variables.styl' - -.adaptiveHeader - background: red - width: 100% - display: block - &:container(width < 630px) - background: green - &:container(width > 630px) - background: yellow - &:container(width > 930px) - background: red diff --git a/src/components/molecules/AdaptiveHeader/index.jsx b/src/components/molecules/AdaptiveHeader/index.jsx deleted file mode 100644 index 06a5f76..0000000 --- a/src/components/molecules/AdaptiveHeader/index.jsx +++ /dev/null @@ -1 +0,0 @@ -export { default } from './AdaptiveHeader' diff --git a/src/components/molecules/Tab/Tab.js b/src/components/molecules/Tab/Tab.js deleted file mode 100644 index e643c5a..0000000 --- a/src/components/molecules/Tab/Tab.js +++ /dev/null @@ -1,144 +0,0 @@ -import React, { PureComponent } from 'react' -import { number, string, bool, func } from 'prop-types' -import cx from 'classnames' -import Box from '../../atoms/Box' -import Icon from '../../atoms/Icon' - -import styles from './Tab.styl' - -export default class Tab extends PureComponent { - static propTypes = { - size: number, - color: string, - backgroundColor: string, - iconColor: string, - iconBackgroundColor: string, - icon: string, - activeColor: string, - isActive: bool, - isDisabled: bool, - onClick: func, - isWithCross: bool, - isHideOnHover: bool, - onClickOnCross: func, - children: string - } - - static defaultProps = { - size: 40, - color: '#FFFFFF', - backgroundColor: '#000000', - activeColor: '#FFFFFF', - isActive: false, - isDisabled: false, - isWithCross: false, - isHideOnHover: false, - onClick: () => {}, - onClickOnCross: () => {} - } - - componentDidMount() { - const textWidth = this.hideNode.clientWidth - const containerWidth = this.textNode.clientWidth - if (containerWidth < textWidth) { - this.textNode.setAttribute('title', this.props.children) - this.textNode.classList.add(styles.tab__text_tooltip) - } - } - - render() { - const { - size, - color, - backgroundColor, - icon, - iconColor, - iconBackgroundColor, - isActive, - activeColor, - isDisabled, - onClick, - isWithCross, - isHideOnHover, - onClickOnCross, - children - } = this.props - - const isIcon = !!icon - const boxSize = size - 10 - - return ( -
- { isActive && -
- } - { isIcon && -
- - - -
- } - { - this.textNode = node - return this.textNode - }} - > - {children} - - { - this.hideNode = node - return this.hideNode - }} - > - {children} - - { isWithCross && - - } -
- ) - } -} - -/* -style={{ width: size }} -*/ diff --git a/src/components/molecules/Tab/Tab.stories.js b/src/components/molecules/Tab/Tab.stories.js deleted file mode 100644 index 116323a..0000000 --- a/src/components/molecules/Tab/Tab.stories.js +++ /dev/null @@ -1,87 +0,0 @@ -import React from 'react' -import { storiesOf, action } from '@storybook/react' -import Tab from '../Tab' - -storiesOf('Tab', module) - .addWithInfo('Default', () => ( -
- -
- )) - .addWithInfo('With text', () => ( -
- - 4 team - -
- )) - .addWithInfo('With text & default colors icon with symbol', () => ( -
- - 4 team - -
- )) - .addWithInfo('With text & default colors icon with Icon', () => ( -
- - 4 team - -
- )) - .addWithInfo('Disabled', () => ( -
- - 4 team - -
- )) - .addWithInfo('Active', () => ( -
- - 4 team - -
- )) - .addWithInfo('With different icon', () => ( -
- - 4 team - -
- )) - .addWithInfo('With cross', () => ( -
- - 4 team - -
- )) - .addWithInfo('With hide cross', () => ( -
- - 4 team - -
- )) - .addWithInfo('With long text', () => ( -
- - Это просто какое-то очень длинное название - -
- )) - .addWithInfo('Action', () => ( -
- - 4 team - -
- )) - .addWithInfo('Complex example', () => ( -
- - Это просто какое-то очень длинное название - -
- )) diff --git a/src/components/molecules/Tab/Tab.styl b/src/components/molecules/Tab/Tab.styl deleted file mode 100644 index 0940ef6..0000000 --- a/src/components/molecules/Tab/Tab.styl +++ /dev/null @@ -1,68 +0,0 @@ -@import '~variables.styl' -.tab - position: relative - display: flex - align-items: center - padding: 5px 10px - width: 100% - color: var(--white) - background-color: var(--black) - box-sizing: border-box - - &_isActive &__activeMark - position: absolute - content: '' - bottom: 0 - left: 0 - right: 0 - height: 2px - - - &_isDisabled - z-index: 1 - - &::after - position: absolute - content: '' - top: 0 - bottom: 0 - left: 0 - right: 0 - background-color: color(var(--black) a(20%)) - z-index: 10 - - &__icon - margin-right: 10px - - &__text - flex-shrink: 1 - white-space: nowrap - overflow: hidden - text-overflow: ellipsis - - &_tooltip - cursor: help - - &__measuringText - position: absolute - top: -999px - left: 0 - opacity: 0 - visibility: hidden - z-index: -99 - - &__cross - position: relative - margin: 0 - margin-left: auto - margin-right: -10px - padding: 0 - border: none - background-color: transparent - cursor: pointer - - &_hide - opacity: 0 - - &:hover &__cross_hide - opacity: 1 diff --git a/src/components/molecules/Tab/Tab.test.js b/src/components/molecules/Tab/Tab.test.js deleted file mode 100644 index 8801c20..0000000 --- a/src/components/molecules/Tab/Tab.test.js +++ /dev/null @@ -1,9 +0,0 @@ -import React from 'react' -import { shallow } from 'enzyme' -import Tab from '../Tab' - -describe('TabPinned', () => { - it('should render normal without any props supplied', () => { - expect(shallow()).toHaveLength(1) - }) -}) diff --git a/src/components/molecules/Tab/index.js b/src/components/molecules/Tab/index.js deleted file mode 100644 index 2d0a549..0000000 --- a/src/components/molecules/Tab/index.js +++ /dev/null @@ -1 +0,0 @@ -export { default } from './Tab' diff --git a/src/components/molecules/TabPinned/TabPinned.js b/src/components/molecules/TabPinned/TabPinned.js deleted file mode 100644 index c611027..0000000 --- a/src/components/molecules/TabPinned/TabPinned.js +++ /dev/null @@ -1,53 +0,0 @@ -import React, { PureComponent } from 'react' -import { number, string, bool, node } from 'prop-types' -import cx from 'classnames' -import Box from '../../atoms/Box' -import Icon from '../../atoms/Icon' - -import styles from './TabPinned.styl' - -export default class TabPinned extends PureComponent { - static propTypes = { - size: number, - color: string, - backgroundColor: string, - icon: string, - isDisabled: bool, - children: node - } - - static defaultProps = { - size: 40, - color: '#FFFFFF', - backgroundColor: '#FC6B3E', - isDisabled: false - } - - render() { - const { - size, - color, - backgroundColor, - icon, - isDisabled, - children - } = this.props - - const isIcon = !!icon - const content = isIcon ? : children - - return ( -
- - {content} - -
- ) - } -} - diff --git a/src/components/molecules/TabPinned/TabPinned.stories.js b/src/components/molecules/TabPinned/TabPinned.stories.js deleted file mode 100644 index 1be1603..0000000 --- a/src/components/molecules/TabPinned/TabPinned.stories.js +++ /dev/null @@ -1,38 +0,0 @@ -import React from 'react' -import { storiesOf } from '@storybook/react' -import TabPinned from '../TabPinned' - -storiesOf('TabPinned', module) - .addWithInfo('Default', () => ( - - )) - .addWithInfo('With icon', () => ( - - )) - .addWithInfo('With symbol', () => ( - - A - - )) - .addWithInfo('Disabled', () => ( - - )) - .addWithInfo('Complex example', () => ( -
-
- -
-
- -
-
- -
-
- - A - -
- -
- )) diff --git a/src/components/molecules/TabPinned/TabPinned.styl b/src/components/molecules/TabPinned/TabPinned.styl deleted file mode 100644 index ea31842..0000000 --- a/src/components/molecules/TabPinned/TabPinned.styl +++ /dev/null @@ -1,18 +0,0 @@ -@import '~variables.styl' -.tabPinned - display: flex - - &_isDisabled - position: relative - z-index: 1 - - &::after - position: absolute - content: '' - top: 0 - bottom: 0 - left: 0 - right: 0 - background-color: color(var(--black) a(20%)) - z-index: 10 - diff --git a/src/components/molecules/TabPinned/TabPinned.test.js b/src/components/molecules/TabPinned/TabPinned.test.js deleted file mode 100644 index a4b26d9..0000000 --- a/src/components/molecules/TabPinned/TabPinned.test.js +++ /dev/null @@ -1,9 +0,0 @@ -import React from 'react' -import { shallow } from 'enzyme' -import TabPinned from '../TabPinned' - -describe('TabPinned', () => { - it('should render normal without any props supplied', () => { - expect(shallow()).toHaveLength(1) - }) -}) diff --git a/src/components/molecules/TabPinned/index.js b/src/components/molecules/TabPinned/index.js deleted file mode 100644 index bf3e626..0000000 --- a/src/components/molecules/TabPinned/index.js +++ /dev/null @@ -1 +0,0 @@ -export { default } from './TabPinned' diff --git a/src/components/molecules/Tabs/Tabs.js b/src/components/molecules/Tabs/Tabs.js deleted file mode 100644 index cba2a51..0000000 --- a/src/components/molecules/Tabs/Tabs.js +++ /dev/null @@ -1,69 +0,0 @@ -import React, { PureComponent } from 'react' -// import { string, number, bool, array, func, node } from 'prop-types' - -import styles from './Tabs.styl' -import TabPinned from '../TabPinned/TabPinned' -import Tab from '../Tab/Tab' - -export default class Tabs extends PureComponent { - static propTypes = { - - } - - static defaultProps = { - - } - - render() { - // const { } = this.props - - return ( -
-
-
- -
-
- -
-
- -
-
- - A - -
- -
-
-
- - Проверка СМС - -
-
- - Изначальная папка - -
-
-
- ) - } -} diff --git a/src/components/molecules/Tabs/Tabs.stories.js b/src/components/molecules/Tabs/Tabs.stories.js deleted file mode 100644 index 95057e9..0000000 --- a/src/components/molecules/Tabs/Tabs.stories.js +++ /dev/null @@ -1,9 +0,0 @@ -import React from 'react' -import { storiesOf } from '@storybook/react' -import Tabs from '../Tabs' - -storiesOf('Tabs', module) - .addWithInfo('Default', () => ( - - )) - diff --git a/src/components/molecules/Tabs/Tabs.styl b/src/components/molecules/Tabs/Tabs.styl deleted file mode 100644 index 66b5c0e..0000000 --- a/src/components/molecules/Tabs/Tabs.styl +++ /dev/null @@ -1,13 +0,0 @@ -@import '~variables.styl' - -.tabs - display: block - background: black - display: flex - .tabPinnedWrapper - display: flex - align-items: center - .tabWrapper - display: flex - align-items: center - diff --git a/src/components/molecules/Tabs/Tabs.test.js b/src/components/molecules/Tabs/Tabs.test.js deleted file mode 100644 index 09d60c4..0000000 --- a/src/components/molecules/Tabs/Tabs.test.js +++ /dev/null @@ -1,9 +0,0 @@ -import React from 'react' -import { shallow } from 'enzyme' -import Tabs from '../Tabs' - -describe('Tabs', () => { - it('should render normal without any props supplied', () => { - expect(shallow()).toHaveLength(1) - }) -}) diff --git a/src/components/molecules/Tabs/index.js b/src/components/molecules/Tabs/index.js deleted file mode 100644 index 07f8ccc..0000000 --- a/src/components/molecules/Tabs/index.js +++ /dev/null @@ -1 +0,0 @@ -export { default } from './Tabs' diff --git a/src/containers/App/App.jsx b/src/containers/App/App.jsx index eeea400..8160bb1 100644 --- a/src/containers/App/App.jsx +++ b/src/containers/App/App.jsx @@ -1,4 +1,4 @@ -import React, { Component, PropTypes } from 'react' +import React, { Component, PropTypes as pt } from 'react' import pureRender from 'pure-render-decorator' import { connect } from 'react-redux' import { asyncConnect } from 'redux-async-connect' @@ -7,17 +7,18 @@ import styles from './App.styl' @asyncConnect([{ promise: () => Promise.resolve() }]) @connect() @pureRender -class App extends Component { +export default class App extends Component { static propTypes = { - children: PropTypes.any + children: pt.any } + render() { + const { children } = this.props + return (
- {this.props.children} + {children}
) } } - -export default App diff --git a/src/containers/PageCatalog/index.jsx b/src/containers/PageCatalog/index.jsx deleted file mode 100644 index 44b03e7..0000000 --- a/src/containers/PageCatalog/index.jsx +++ /dev/null @@ -1,2 +0,0 @@ -export { default } from './PageCatalog' - diff --git a/src/containers/PageCatalog/PageCatalog.jsx b/src/containers/PageMain/PageMain.jsx similarity index 77% rename from src/containers/PageCatalog/PageCatalog.jsx rename to src/containers/PageMain/PageMain.jsx index b4b6914..e51ac55 100644 --- a/src/containers/PageCatalog/PageCatalog.jsx +++ b/src/containers/PageMain/PageMain.jsx @@ -1,20 +1,17 @@ import React, { PureComponent } from 'react' -import Box from 'components/atoms/Box' -import AdaptiveHeader from 'components/molecules/AdaptiveHeader' -import Iframe from '../../components/atoms/Iframe' +import Iframe from 'components/atoms/Iframe' -export default class PageCatalog extends PureComponent { +export default class PageMain extends PureComponent { state = { url: 'http://jira.relef.ru/browse/CSSSR-725' } - handleClick = url => () => this.setState({ - url - }) + + handleClick = url => () => + this.setState({ url }) + render() { return (
- -
@@ -29,7 +26,9 @@ export default class PageCatalog extends PureComponent {

+

{this.state.url}

+