Skip to content

Commit ebe556f

Browse files
committed
Remove Redux page actions
Remove Containers structure / replace with components Refactoring
1 parent 27bede7 commit ebe556f

File tree

27 files changed

+186
-264
lines changed

27 files changed

+186
-264
lines changed

.circleci/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ version: 2
22
jobs:
33
build:
44
docker:
5-
- image: circleci/node:9
5+
- image: circleci/node:10
66
working_directory: ~/repo
77
steps:
88
- checkout

client/Store.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
1-
import {PageStore} from './stores';
21
import {InfoStore} from './modules/info';
32

43
export interface Store {
5-
readonly page: PageStore;
64
readonly info: InfoStore;
75
}

client/actions/PageActions.ts

Lines changed: 0 additions & 21 deletions
This file was deleted.

client/actions/index.ts

Lines changed: 0 additions & 1 deletion
This file was deleted.

client/components/Layout.tsx

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
import * as React from 'react';
2+
import {InjectedIntlProps, injectIntl} from 'react-intl';
3+
import {AppFrame, Content, LeftMenu, TopBar} from './';
4+
5+
interface OwnProps {}
6+
7+
interface State {
8+
readonly isOpenLeftMenu: boolean;
9+
}
10+
11+
type Props = OwnProps & InjectedIntlProps;
12+
13+
export class Container extends React.Component<Props, State> {
14+
constructor(props: Props, context: any) {
15+
super(props, context);
16+
this.state = {
17+
isOpenLeftMenu: false,
18+
};
19+
}
20+
21+
handleOnOpenLeftMenu = () => {
22+
this.setState((prevState) => ({...prevState, isOpenLeftMenu: true}));
23+
};
24+
25+
handleOnCloseLeftMenu = () => {
26+
this.setState((prevState) => ({...prevState, isOpenLeftMenu: false}));
27+
};
28+
29+
render() {
30+
const {
31+
children,
32+
intl: {locale},
33+
} = this.props;
34+
const {isOpenLeftMenu} = this.state;
35+
return (
36+
<AppFrame>
37+
<TopBar locale={locale} gitHubUrl={'https://github.com/ApiTreeCZ/alda'} onClickOpenLeftMenu={this.handleOnOpenLeftMenu} />
38+
<div id={'loadingContent'} />
39+
<LeftMenu open={isOpenLeftMenu} onClose={this.handleOnCloseLeftMenu} />
40+
<Content>{children}</Content>
41+
</AppFrame>
42+
);
43+
}
44+
}
45+
46+
export const Layout = injectIntl<OwnProps>(Container);

client/components/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
export * from './AppFrame';
22
export * from './Content';
3+
export * from './Layout';
34
export * from './LeftMenu';
45
export * from './LightbublFullIcon';
56
export * from './TopBar';

client/containers/PageContainer.tsx

Lines changed: 0 additions & 50 deletions
This file was deleted.

client/containers/index.ts

Lines changed: 0 additions & 1 deletion
This file was deleted.

client/modules/homePage/containers/HomePageContainer.tsx

Lines changed: 0 additions & 45 deletions
This file was deleted.

client/modules/homePage/containers/index.ts

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)