Skip to content

Commit

Permalink
Merge pull request #50 from TrigenSoftware/cleanup
Browse files Browse the repository at this point in the history
Cleanup
  • Loading branch information
dangreen authored May 28, 2019
2 parents ba00702 + da462d1 commit 25d8ba4
Show file tree
Hide file tree
Showing 54 changed files with 2,280 additions and 2,065 deletions.
10 changes: 9 additions & 1 deletion .storybook/config.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,18 @@
import '@trigen/scripts/storybook/config';
import React from 'react';
import { addDecorator } from '@storybook/react';
import {
loadStories
} from '@trigen/scripts/storybook/config';
import {
addDecorator,
configure
} from '@storybook/react';
import stylesheet from '@flexis/ui/reboot.st.css';

addDecorator(story => (
<div {...stylesheet('root')}>
{story()}
</div>
));

configure(loadStories, module);
1 change: 0 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
language: node_js
node_js:
- "lts/*"
- "node"
cache:
directories:
- node_modules
27 changes: 14 additions & 13 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
"description": "Architecture demo app.",
"author": "dangreen",
"license": "MIT",
"private": true,
"repository": {
"type": "git",
"url": "https://github.com/TrigenSoftware/weather"
Expand All @@ -29,27 +28,29 @@
"serve": "trigen-scripts serve"
},
"dependencies": {
"@babel/runtime": "^7.4.2",
"@babel/runtime": "^7.4.5",
"@flexis/redux": "^0.3.1-alpha",
"@flexis/ui": "^0.6.2-alpha",
"@flexis/ui": "^0.14.9-alpha",
"@loadable/component": "^5.10.1",
"@stylable/runtime": "^1.0.3",
"@types/prop-types": "^15.5.5",
"@types/qs": "^6.5.1",
"@types/react": "16.8.8",
"@types/react-router-dom": "^4.3.1",
"@types/loadable__component": "^5.9.0",
"@types/prop-types": "^15.7.1",
"@types/qs": "^6.5.3",
"@types/react": "16.8.18",
"@types/react-router-dom": "^4.3.3",
"axios": "^0.18.0",
"date-fns": "^2.0.0-alpha.27",
"date-fns-timezone": "^0.1.4",
"immutable": "4.0.0-rc.12",
"moment": "^2.22.2",
"prop-types": "^15.6.0",
"qs": "^6.7.0",
"react": "^16.8.5",
"react-dom": "^16.8.5",
"react-loadable": "^5.5.0",
"react-router-dom": "^4.3.1",
"react": "^16.8.6",
"react-dom": "^16.8.6",
"react-router-dom": "^5.0.0",
"redux": "^4.0.0"
},
"devDependencies": {
"@trigen/scripts": "^1.7.2",
"@trigen/scripts": "^1.10.2",
"@types/faker": "^4.1.4",
"faker": "^4.1.0",
"moxios": "^0.4.0"
Expand Down
14 changes: 0 additions & 14 deletions scripts/webpack.js

This file was deleted.

6 changes: 4 additions & 2 deletions src/App/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ import React, {
ReactChild,
PureComponent
} from 'react';
import { hot } from 'react-hot-loader';
import {
hot
} from 'react-hot-loader';
import {
BrowserRouter as Router,
Route,
Expand All @@ -13,7 +15,7 @@ import Todo from '~/containers/Todo/loadable';
import Navigator from '~/components/Navigator';
import stylesheet from './App.st.css';

interface IProps {
export interface IProps {
disableRouter?: boolean;
}

Expand Down
8 changes: 6 additions & 2 deletions src/App/axios/index.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
import Axios, { CancelTokenSource } from 'axios';
import Axios, {
CancelTokenSource
} from 'axios';
import qs from 'qs';

export {
Axios as default,
qs
};

const { CancelToken } = Axios;
const {
CancelToken
} = Axios;

Axios.defaults.responseType = 'json';

Expand Down
34 changes: 0 additions & 34 deletions src/App/components/Button/Button.st.css

This file was deleted.

3 changes: 0 additions & 3 deletions src/App/components/Button/index.ts

This file was deleted.

23 changes: 0 additions & 23 deletions src/App/components/Input/Input.st.css

This file was deleted.

3 changes: 0 additions & 3 deletions src/App/components/Input/index.ts

This file was deleted.

11 changes: 11 additions & 0 deletions src/App/components/Navigator/Navigator.st.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@

.root {
/* Empty block */
}

.list {
margin: 0;
padding: 0;
list-style: none;
}

.root,
.list {
display: flex;
}

Expand Down
5 changes: 4 additions & 1 deletion src/App/components/Navigator/Navigator.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
/* tslint:disable:no-magic-numbers */
import React from 'react';
import { storiesOf } from '@storybook/react';
import {
storiesOf
} from '@storybook/react';
import {
button,
number
Expand All @@ -13,6 +15,7 @@ import Navigator from './';
const stylableApi = `
Stylable API
---
- ::list
- ::item
`;

Expand Down
25 changes: 13 additions & 12 deletions src/App/components/Navigator/Navigator.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@ import React, {
Children,
Component
} from 'react';
import Menu, {
MenuItem
} from '@flexis/ui/components/Menu';
import stylesheet from './Navigator.st.css';

export default class Navigator extends Component {
Expand All @@ -16,17 +13,21 @@ export default class Navigator extends Component {
} = this.props;

return (
<Menu
<nav
{...stylesheet('root', {}, this.props)}
>
{Children.map(children, child => child && (
<MenuItem
{...stylesheet('item')}
>
{child}
</MenuItem>
))}
</Menu>
<ul
{...stylesheet('list')}
>
{Children.map(children, child => child && (
<li
{...stylesheet('item')}
>
{child}
</li>
))}
</ul>
</nav>
);
}
}
9 changes: 7 additions & 2 deletions src/App/components/TodoList/TodoList.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
/* tslint:disable:no-magic-numbers */
import React from 'react';
import { storiesOf } from '@storybook/react';
import { action } from '@storybook/addon-actions';
import {
storiesOf
} from '@storybook/react';
import {
action
} from '@storybook/addon-actions';
import {
button,
number
Expand All @@ -22,6 +26,7 @@ const events = {
const stylableApi = `
Stylable API
---
_Empty_
`;

storiesOf('TodoList', module)
Expand Down
9 changes: 3 additions & 6 deletions src/App/components/TodoList/TodoList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@ import React, {
cloneElement
} from 'react';
import TodoListForm from './TodoListForm';
import TodoListItem from './TodoListItem';
import stylesheet from './TodoList.st.css';

interface IProps {
export * from './TodoListItem';

export interface IProps {
children: ReactElement<any>|ReactElement<any>[];
onAdd?(text: string);
onChange?(id: string, text: string);
Expand All @@ -19,10 +20,6 @@ interface IState {
value: string;
}

export {
TodoListItem
};

export default class TodoList extends PureComponent<IProps, IState> {

constructor(props) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
/* tslint:disable:no-magic-numbers */
import React from 'react';
import { storiesOf } from '@storybook/react';
import { action } from '@storybook/addon-actions';
import {
storiesOf
} from '@storybook/react';
import {
action
} from '@storybook/addon-actions';
import TodoListForm from './';

const events = {
Expand Down
19 changes: 11 additions & 8 deletions src/App/components/TodoList/TodoListForm/TodoListForm.tsx
Original file line number Diff line number Diff line change
@@ -1,20 +1,19 @@
import React, {
FormEvent,
ChangeEvent,
PureComponent
} from 'react';
import stylesheet from './TodoListForm.st.css';
import Button from '~/components/Button';
import Input from '~/components/Input';

interface IProps {
export interface ITodoListFormProps {
onSubmit?(value: string);
}

interface IState {
value: string;
}

export default class TodoListForm extends PureComponent<IProps, IState> {
export default class TodoListForm extends PureComponent<ITodoListFormProps, IState> {

state = {
value: ''
Expand All @@ -39,17 +38,17 @@ export default class TodoListForm extends PureComponent<IProps, IState> {
{...stylesheet('root', {}, this.props)}
onSubmit={this.onSubmit}
>
<Input
<input
{...stylesheet('input')}
type='text'
onChange={this.onChange}
value={value}
/>
<Button
<button
{...stylesheet('button')}
>
Add
</Button>
</button>
</form>
);
}
Expand All @@ -74,7 +73,11 @@ export default class TodoListForm extends PureComponent<IProps, IState> {
}));
}

private onChange(value: string) {
private onChange(event: ChangeEvent<HTMLInputElement>) {

const {
value
} = event.target;

this.setState(() => ({
value
Expand Down
Loading

0 comments on commit 25d8ba4

Please sign in to comment.