From b501d71a83857a7068d8e8c1ca5ef21bd7a93233 Mon Sep 17 00:00:00 2001
From: Óscar Carretero <ocarreterom@gmail.com>
Date: Thu, 15 Oct 2020 17:54:34 +0200
Subject: Fix spacing of `cleanup-repo-filelist-actions` (#3646)

---
 source/features/cleanup-repo-filelist-actions.tsx | 16 ++++++----------
 1 file changed, 6 insertions(+), 10 deletions(-)

(limited to 'source/features/cleanup-repo-filelist-actions.tsx')

diff --git a/source/features/cleanup-repo-filelist-actions.tsx b/source/features/cleanup-repo-filelist-actions.tsx
index bc8dd129..a2b87f1c 100644
--- a/source/features/cleanup-repo-filelist-actions.tsx
+++ b/source/features/cleanup-repo-filelist-actions.tsx
@@ -5,7 +5,6 @@ import SearchIcon from 'octicon/search.svg';
 import * as pageDetect from 'github-url-detection';
 
 import features from '.';
-import {groupButtons} from '../github-helpers/group-buttons';
 
 function init(): void {
 	const searchButton = select('.btn[data-hotkey="t"]')!;
@@ -14,16 +13,13 @@ function init(): void {
 	searchButton.firstChild!.replaceWith(<SearchIcon/>);
 
 	const addButtonWrapper = searchButton.nextElementSibling!;
-	const addButton = select('.btn', addButtonWrapper);
-	if (addButton) {
-		addButton.classList.add('d-md-block', 'tooltipped', 'tooltipped-ne');
-		addButton.classList.remove('d-md-flex', 'ml-2');
-		addButton.setAttribute('aria-label', 'Add file');
-		addButton.textContent = '';
-		addButton.append(<PlusIcon/>);
+	if (addButtonWrapper.nodeName === 'DETAILS') {
+		addButtonWrapper.classList.add('tooltipped', 'tooltipped-ne');
+		addButtonWrapper.setAttribute('aria-label', 'Add file');
 
-		searchButton.classList.remove('mr-2');
-		groupButtons([searchButton, addButtonWrapper]);
+		const addIcon = select('.btn span', addButtonWrapper)!;
+		addIcon.classList.replace('d-md-flex', 'd-md-block');
+		addIcon.firstChild!.replaceWith(<PlusIcon/>);
 	}
 
 	const downloadButton = select('get-repo details');
-- 
cgit v1.2.3

