Skip to content

Commit

Permalink
#7 Add title option to notifications
Browse files Browse the repository at this point in the history
  • Loading branch information
cristijora committed Sep 17, 2017
1 parent 2f743d0 commit 0af1e46
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/Notification.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ export default {
name: 'notification',
props: {
message: String,
title: String,
icon: String,
verticalAlign: {
type: String,
Expand All @@ -13,7 +14,7 @@ export default {
},
horizontalAlign: {
type: String,
default: 'center',
default: 'right',
validator: (value) => {
let acceptedValues = ['left', 'center', 'right']
return acceptedValues.indexOf(value) !== -1
Expand Down Expand Up @@ -104,7 +105,8 @@ export default {
this.icon && <span data-notify="icon" class={['alert-icon', this.icon]}></span>
}
<span data-notify="message">
{this.message !== undefined && this.message}
{this.title !== undefined && <span class="title"><b>{this.title}<br/></b></span>}
{this.message !== undefined && this.message}
{this.component !== undefined &&
<this.component></this.component>}
</span>
Expand Down
1 change: 1 addition & 0 deletions src/Notifications.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ export default {
verticalAlign={notification.verticalAlign}
icon={notification.icon}
message={notification.message}
title={notification.title}
timeout={notification.timeout}
type={notification.type}
component={notification.component}
Expand Down

0 comments on commit 0af1e46

Please sign in to comment.