@@ -4,7 +4,7 @@ import { detect } from 'detect-browser';
4
4
import styled from 'styled-components' ;
5
5
6
6
const Container = styled . div `
7
- width: 220px ;
7
+ width: 240px ;
8
8
box-shadow: 0 2px 5px 0 rgb(0 0 0 / 16%), 0 2px 10px 0 rgb(0 0 0 / 12%);
9
9
border-radius: 3px;
10
10
padding: 0px;
@@ -16,21 +16,45 @@ const Container = styled.div`
16
16
line-height: normal !important;
17
17
` ;
18
18
19
- const Title = styled . div `
19
+ const TitleContainer = styled . div `
20
20
padding: 8px 10px;
21
21
background: ${ ( props ) => ( props . isDark ? 'rgb(36, 36, 36)' : '#fefefe' ) } ;
22
- color: ${ ( props ) => ( props . isDark ? 'rgb(167, 167, 167 )' : '#333' ) } ;
22
+ color: ${ ( props ) => ( props . isDark ? 'rgb(190, 190, 190 )' : '#333' ) } ;
23
23
24
24
border-top-left-radius: 3px;
25
25
border-top-right-radius: 3px;
26
26
27
27
word-wrap: break-word;
28
28
` ;
29
29
30
+ const TabInfoContainer = styled . div `
31
+ font-size: 11px;
32
+ opacity: 0.8;
33
+ ` ;
34
+
35
+ const AudibleOrMuted = styled . div `
36
+ margin-top: 5px;
37
+ display: flex;
38
+ align-items: center;
39
+ ` ;
40
+
41
+ const AudioMutedBadge = styled . span `
42
+ border-radius: 3px;
43
+ background-color: ${ ( props ) => ( props . isMuted ? 'inherent' : '#fe8c0a' ) } ;
44
+ color: ${ ( props ) => ( props . isMuted ? 'inherent' : '#fff' ) } ;
45
+ border: 1px solid transparent;
46
+ border-color: ${ ( props ) => ( props . isMuted ? '#666' : 'transparent' ) } ;
47
+
48
+ margin-left: 4px;
49
+ margin-right: 1px;
50
+
51
+ padding: 0.5px 2px;
52
+ ` ;
53
+
30
54
const Domain = styled . div `
31
55
padding: 8px 10px;
32
56
background: ${ ( props ) => ( props . isDark ? '#35363A' : 'rgb(222, 225, 230)' ) } ;
33
- color: ${ ( props ) => ( props . isDark ? 'rgb(167, 167, 167 )' : '#444' ) } ;
57
+ color: ${ ( props ) => ( props . isDark ? 'rgb(190, 190, 190 )' : '#444' ) } ;
34
58
35
59
border-bottom-left-radius: 3px;
36
60
border-bottom-right-radius: 3px;
@@ -76,7 +100,14 @@ const NotSecureBadge = styled.div`
76
100
77
101
const browserInfo = detect ( ) ;
78
102
79
- const TabPreviewFrame = ( { title, url, faviconUrl, isDark } ) => {
103
+ const TabPreviewFrame = ( {
104
+ title,
105
+ url,
106
+ muted,
107
+ audible,
108
+ faviconUrl,
109
+ isDark,
110
+ } ) => {
80
111
let domain = new URL ( url ) . hostname ;
81
112
82
113
if ( url . startsWith ( browserInfo . name + '://' ) && ! domain . includes ( '://' ) ) {
@@ -89,7 +120,23 @@ const TabPreviewFrame = ({ title, url, faviconUrl, isDark }) => {
89
120
90
121
return (
91
122
< Container className = "TabPreviewContainer" >
92
- < Title isDark = { isDark } > { title } </ Title >
123
+ < TitleContainer isDark = { isDark } >
124
+ < div > { title } </ div >
125
+ < TabInfoContainer >
126
+ { muted && audible && (
127
+ < AudibleOrMuted >
128
+ This tab is{ ' ' }
129
+ < AudioMutedBadge isMuted = { true } > muted</ AudioMutedBadge > .
130
+ </ AudibleOrMuted >
131
+ ) }
132
+ { ! muted && audible && (
133
+ < AudibleOrMuted >
134
+ This tab is{ ' ' }
135
+ < AudioMutedBadge isMuted = { false } > playing audio</ AudioMutedBadge > .
136
+ </ AudibleOrMuted >
137
+ ) }
138
+ </ TabInfoContainer >
139
+ </ TitleContainer >
93
140
94
141
< Domain isDark = { isDark } >
95
142
< DomainNameDisplay >
0 commit comments