@@ -9,6 +9,9 @@ const ipc = require('electron').ipcRenderer
9
9
const messages = require ( '../constants/messages' )
10
10
const getOrigin = require ( '../state/siteUtil' ) . getOrigin
11
11
12
+ const { StyleSheet, css} = require ( 'aphrodite/no-important' )
13
+ const globalStyles = require ( '../../app/renderer/components/styles/global' )
14
+
12
15
class NotificationItem extends ImmutableComponent {
13
16
clickHandler ( buttonIndex , e ) {
14
17
const nonce = this . props . detail . get ( 'options' ) . get ( 'nonce' )
@@ -93,4 +96,53 @@ class NotificationBar extends ImmutableComponent {
93
96
}
94
97
}
95
98
96
- module . exports = NotificationBar
99
+ class NotificationBarCaret extends ImmutableComponent {
100
+ render ( ) {
101
+ return < div className = { css ( styles . caretWrapper ) } >
102
+ < div className = { css ( styles . caret ) } />
103
+ </ div >
104
+ }
105
+ }
106
+
107
+ const caret = ( size , color ) => `${ Number . parseInt ( size , 10 ) / 2 } px solid ${ color } `
108
+
109
+ const styles = StyleSheet . create ( {
110
+ caretWrapper : {
111
+ position : 'absolute' ,
112
+ bottom : 0 ,
113
+ left : 0 ,
114
+ right : 0 ,
115
+ zIndex : globalStyles . zindex . zindexTabs
116
+ } ,
117
+
118
+ caret : {
119
+ position : 'relative' ,
120
+ margin : 'auto' ,
121
+ width : globalStyles . spacing . caretSize ,
122
+
123
+ ':before' : {
124
+ content : '""' ,
125
+ position : 'absolute' ,
126
+ bottom : 0 ,
127
+ left : 0 ,
128
+ borderBottom : caret ( globalStyles . spacing . caretSize , globalStyles . color . notificationItemColor ) ,
129
+ borderLeft : caret ( globalStyles . spacing . caretSize , 'transparent' ) ,
130
+ borderRight : caret ( globalStyles . spacing . caretSize , 'transparent' )
131
+ } ,
132
+
133
+ ':after' : {
134
+ content : '""' ,
135
+ position : 'absolute' ,
136
+ bottom : globalStyles . spacing . caretSize ,
137
+ left : globalStyles . spacing . caretSize ,
138
+ borderBottom : caret ( 0 , '#eeeeee' ) ,
139
+ borderLeft : caret ( 0 , 'transparent' ) ,
140
+ borderRight : caret ( 0 , 'transparent' )
141
+ }
142
+ }
143
+ } )
144
+
145
+ module . exports = {
146
+ NotificationBar,
147
+ NotificationBarCaret
148
+ }
0 commit comments