Skip to content

Commit

Permalink
Merge branch 'master' of github.com:nikandlv/react-mui-android-notifi…
Browse files Browse the repository at this point in the history
…cation
  • Loading branch information
nikandlv committed Aug 9, 2019
2 parents 9eb033c + 733654a commit 82877c9
Show file tree
Hide file tree
Showing 10 changed files with 9,551 additions and 191 deletions.
2 changes: 1 addition & 1 deletion examples/src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<title>React Mui Android Notification</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,500">
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700&display=swap" />
</head>
<body>
<noscript>
Expand Down
58 changes: 48 additions & 10 deletions examples/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ const items = [
{
title: "Simple Notification",
props: {
buttons:() => {},
},
body: "this is a basic notification without any props and actions"
},
Expand All @@ -24,7 +25,14 @@ const items = [
props: {
title:"Awesome Notification",
body:"this is an awesome notification !",
timeStamp:"Nov 6"
date:"Nov 6",
buttons:() => (
<React.Fragment>
<Button>Replay</Button>
<Button>Mark as read</Button>
<IconButton><Add/></IconButton>
</React.Fragment>
),
},
body: "this is a basic notification with custom title and body with no actions "
},
Expand All @@ -33,7 +41,14 @@ const items = [
props: {
name:"Awesome Notification",
title:"Awesome Notification",
body:"this is an awesome notification !"
body:"this is an awesome notification !",
buttons:() => (
<React.Fragment>
<Button>Replay</Button>
<Button>Mark as read</Button>
<IconButton><Add/></IconButton>
</React.Fragment>
),
},
body: "this is a basic notification with custom name, title and and body"
}
Expand All @@ -45,7 +60,13 @@ const items = [
title:"Luv",
body:"Sorry but i dont love you back ...",
icon:<Message />,
buttons:[<Button>Replay</Button>,<Button>Mark as read</Button>,<IconButton><Add/></IconButton>],
buttons:() => (
<React.Fragment>
<Button>Replay</Button>
<Button>Mark as read</Button>
<IconButton><Add/></IconButton>
</React.Fragment>
),
},
propsString: {
buttons:'[<Button>Replay</Button>,<Button>Mark as read</Button>]',
Expand All @@ -61,7 +82,13 @@ const items = [
body:"Sorry but i dont love you back ...",
icon:<Message />,
v2:true,
buttons:[<Button>Replay</Button>,<Button>Mark as read</Button>,<IconButton><Add/></IconButton>],
buttons:() => (
<React.Fragment>
<Button>Replay</Button>
<Button>Mark as read</Button>
<IconButton><Add/></IconButton>
</React.Fragment>
),
},
propsString: {
buttons:'[<Button>Replay</Button>,<Button>Mark as read</Button>]',
Expand All @@ -83,7 +110,13 @@ const items = [
alert("body clicked!");
},
icon:<Message />,
buttons:[<Button>Replay</Button>,<Button>Mark as read</Button>,<IconButton><Add/></IconButton>],
buttons:() => (
<React.Fragment>
<Button>Replay</Button>
<Button>Mark as read</Button>
<IconButton><Add/></IconButton>
</React.Fragment>
),
},
propsString: {
buttons:'[<Button>Replay</Button>,<Button>Mark as read</Button>]',
Expand Down Expand Up @@ -143,11 +176,14 @@ class App extends React.Component {
<AndroidNotification
name="AndroidNotification"
title="My Notification"
timeStamp="Nov 6"
date="Nov 6"
body="This is an awesome Notification!!!"
buttons={[<Button>Reply</Button>, <Button>Archive</Button>,<IconButton><Add/></IconButton>]}
expand={this.state.expanded}
/>
>
<Button>Reply</Button>
<Button>Archive</Button>
<IconButton><Add/></IconButton>
</AndroidNotification>
</div>
<br />
<Typography variant="display1">Usage</Typography>
Expand All @@ -168,7 +204,7 @@ class App extends React.Component {
+"\title:{Notification Title : string}\n"
+"\tbody:{Notification Body : string}\n"
+"\ticon:{Notification Icon : react SvgIcon Component, default: whatshot}\n"
+"\ttimeStamp:{Notification time : string, default : now}\n"
+"\tdate:{Notification time : string, default : now}\n"
+"\taccent:{Notification Accent : string, default : theme.palette.primary.main}\n"
+"\texpand:{Notification Expand state : bool, default : false}\n"
+"\trounded:{Notification Round state : bool, default : false}\n"
Expand All @@ -190,7 +226,9 @@ class App extends React.Component {
<Typography variant="title">{item.title}</Typography>
<br />
<div className="notification">
<AndroidNotification {...item.props} />
<AndroidNotification {...item.props}>
{item.props.buttons()}
</AndroidNotification>
</div>
<Highlight className='xml html js javascript'>
{
Expand Down
Loading

0 comments on commit 82877c9

Please sign in to comment.