From a63f1c013d6f793e4bd1d19db8a5ddfa34c55301 Mon Sep 17 00:00:00 2001 From: insanity Date: Fri, 21 Jul 2017 16:31:36 +0900 Subject: [PATCH] noti --- src/ts/@overflow/app/views/layout/LogoBar.tsx | 2 +- .../commons/react/component/Notification.tsx | 64 ++++++++++++------- 2 files changed, 42 insertions(+), 24 deletions(-) diff --git a/src/ts/@overflow/app/views/layout/LogoBar.tsx b/src/ts/@overflow/app/views/layout/LogoBar.tsx index 494ea26..acb3e38 100644 --- a/src/ts/@overflow/app/views/layout/LogoBar.tsx +++ b/src/ts/@overflow/app/views/layout/LogoBar.tsx @@ -35,7 +35,7 @@ export class LogoBar extends React.Component { position='right' icon='bell' />} - on='click' basic wide > + on='click' wide > diff --git a/src/ts/@overflow/commons/react/component/Notification.tsx b/src/ts/@overflow/commons/react/component/Notification.tsx index 5765dd2..8fb5a3e 100644 --- a/src/ts/@overflow/commons/react/component/Notification.tsx +++ b/src/ts/@overflow/commons/react/component/Notification.tsx @@ -9,7 +9,7 @@ export interface Props { } export interface State { - + list: object[]; } export class Notification extends React.Component { @@ -17,36 +17,54 @@ export class Notification extends React.Component { constructor(props: Props, context: State) { super(props, context); this.state = { + list: null, }; } + public componentWillMount(): void { + let tempData = [ + { + 'icon': 'github', + 'header': 'Notification title1', + 'content': 'Notification content blahblahblahblahblah', + }, + { + 'icon': 'github', + 'header': 'Notification title2', + 'content': 'Notification content2 blahblahblahblahblah', + }, + { + 'icon': 'github', + 'header': 'Notification title3', + 'content': 'Notification content3 blahblahblahblahblahblahblahblahblahblahblahblahblah', + }, + ]; + this.setState({ + list: tempData, + }); + } + + public renderItems(): (JSX.Element | JSX.Element[]) { + if (this.state.list === null || this.state.list.length === 0) { + return
No user notifications found.
; + } + return this.state.list.map((item: any, index: number) => ( + + + + {item.header} + {item.content} + + + )); + } public render(): JSX.Element { return ( -
+
- - - - Semantic-Org/Semantic-UI - Updated 10 mins ago - - - - - - Semantic-Org/Semantic-UI-Docs - Updated 22 mins ago - - - - - - Semantic-Org/Semantic-UI-Meteor - Updated 34 mins ago - - + {this.renderItems()} );