-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #51 from webgem-xyz/notifcations
✨ Added Notifications route ✨ Added Notification Component ❗️ Missing documentation and changes in CHANGELOG
- Loading branch information
Showing
5 changed files
with
70 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import { Component } from 'preact'; | ||
import { PropTypes } from 'preact-compat'; | ||
|
||
import style from './style'; | ||
|
||
export default class Notification extends Component { | ||
render() { | ||
const details = this.props.details; | ||
return ( | ||
<div class={style.notificationWrapper}> | ||
<p>{details.message}</p> | ||
<p>{details.date}</p> | ||
</div> | ||
); | ||
} | ||
} | ||
|
||
Notification.propTypes = { | ||
details: PropTypes.object.isRequired, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
.notificationWrapper { | ||
align-items: center; | ||
border: 1px solid var(--main-color); | ||
display: flex; | ||
justify-content: space-around; | ||
margin: 5px 0; | ||
|
||
p { | ||
display: inline-block; | ||
font-weight: 700; | ||
} | ||
|
||
p:nth-child(2) { | ||
font-weight: 400; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import { Component } from 'preact'; | ||
import style from './style'; | ||
|
||
import Notification from '../../components/notification/index'; | ||
import Header from '../../components/header/'; | ||
|
||
export default class Notifications extends Component { | ||
constructor(props) { | ||
super(props); | ||
|
||
this.state = { | ||
notifications: { | ||
notification1: { message: 'You have 10 uploads this week!', date: '16-01-2018' }, | ||
notification2: { message: 'You have 20 uploads this week!', date: '16-01-2018' } | ||
}, | ||
}; | ||
} | ||
render() { | ||
return ( | ||
<div class={style.notifications}> | ||
<Header title="Notification"/> | ||
{Object.keys(this.state.notifications).map(key => ( | ||
<Notification key={key} index={key} details={this.state.notifications[key]} /> | ||
))} | ||
</div> | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
.notifications { | ||
display: block; | ||
padding: 16px; | ||
} |