Skip to content

Commit 0de96a4

Browse files
committed
refreshed new tab button
1 parent b02fa21 commit 0de96a4

File tree

5 files changed

+40
-15
lines changed

5 files changed

+40
-15
lines changed

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "vertical-tabs-chrome-extension",
3-
"version": "1.9.1",
3+
"version": "1.9.2",
44
"description": "A chrome extension that presents your tabs vertically.",
55
"license": "MIT",
66
"repository": {

src/pages/Sidebar/containers/TabsList/Tab/Tab.jsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,6 @@ const Tab = ({
173173
}}
174174
onMouseOver={() => {
175175
if (!isDragging && isHovering) {
176-
console.log(isHovering);
177176
if (index === activeTab.index) {
178177
chrome.tabs.highlight({ tabs: [activeTab.index] }, null);
179178
} else {

src/pages/Sidebar/containers/TabsList/TabsList.css

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,31 @@
11
.NewTabButtonContainer {
22
display: flex;
3-
justify-content: center;
4-
align-items: center;
5-
padding: 8px 8px 8px 10px;
3+
/* justify-content: center; */
4+
align-items: flex-start;
5+
padding: 0px;
66
color: rgb(60, 64, 67);
7+
8+
margin-top: 5px;
9+
min-height: 80px;
710
}
811

912
.NewTabButtonContainer.Dark {
1013
color: rgb(190, 193, 198);
1114
}
1215

1316
.NewTabButton {
14-
width: 30px;
15-
height: 30px;
17+
width: 100%;
18+
/* height: 30px; */
19+
20+
padding: 4px 8px;
1621

1722
display: flex;
18-
justify-content: center;
1923
align-items: center;
2024

21-
border-radius: 50%;
2225
color: rgb(60, 64, 67);
2326
transition: all 0.2s ease-in;
27+
28+
cursor: default;
2429
}
2530

2631
.NewTabButton.Dark {
@@ -35,6 +40,12 @@
3540
background-color: rgb(68, 69, 71);
3641
}
3742

43+
.NewTabButton .ShortcutName {
44+
margin-right: 5px;
45+
opacity: 0.6;
46+
font-size: 0.8rem;
47+
}
48+
3849
.PinnedUnpinnedDivider {
3950
width: 100%;
4051
height: 0.5px;

src/pages/Sidebar/containers/TabsList/TabsList.jsx

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ class TabsList extends Component {
1515
searchBarInputText: '',
1616
contextMenuShow: false,
1717
contextMenuShowPrev: null,
18+
19+
platformInfo: null,
1820
};
1921

2022
setContextMenuShow = (toStatus) => {
@@ -40,6 +42,12 @@ class TabsList extends Component {
4042

4143
componentDidMount() {
4244
document.addEventListener('keydown', this.keyPressListener, false);
45+
46+
chrome.runtime.getPlatformInfo((info) => {
47+
this.setState({
48+
platformInfo: info,
49+
});
50+
});
4351
}
4452

4553
componentWillUnmount() {
@@ -106,7 +114,7 @@ class TabsList extends Component {
106114

107115
render() {
108116
const { tabOrders, tabsDict } = this.props;
109-
const { searchBarInputText } = this.state;
117+
const { searchBarInputText, platformInfo } = this.state;
110118

111119
const inputText = searchBarInputText.toLowerCase();
112120

@@ -179,7 +187,7 @@ class TabsList extends Component {
179187
);
180188
})}
181189

182-
<li
190+
<div
183191
className={classNames({
184192
NewTabButtonContainer: true,
185193
Dark: isDark,
@@ -193,9 +201,16 @@ class TabsList extends Component {
193201
})}
194202
onClick={(e) => this.openNewTabClickedHandler(e)}
195203
>
196-
<MdAdd size={'22px'} />
204+
<MdAdd size={'24px'} style={{ marginRight: 5 }} />
205+
New Tab
206+
<div style={{ flex: 1 }}></div>
207+
{platformInfo && platformInfo.os && (
208+
<div className="ShortcutName">
209+
{platformInfo.os === 'mac' ? `⌘T` : `Ctrl+T`}
210+
</div>
211+
)}
197212
</div>
198-
</li>
213+
</div>
199214
</div>
200215
</div>
201216
);

0 commit comments

Comments
 (0)