Reconcile the new Prompts icon with the latest shared navigation update
Hop-State: A_06FN70N4H5GHEPN2J1H0MJR Hop-Proposal: R_06FN70KCN1YVY92ZHPYBP3R Hop-Task: T_06FN6VQDZET3E5FH6B4D4N8 Hop-Attempt: AT_06FN70A6M65ZVCJ8K8D7TJ0
This commit is contained in:
@@ -106,6 +106,19 @@
|
||||
return new URLSearchParams(window.location.search).get('hop') === 'prompts';
|
||||
}
|
||||
|
||||
function promptsIcon() {
|
||||
const svg = document.createElementNS('http://www.w3.org/2000/svg', 'svg');
|
||||
svg.setAttribute('viewBox', '0 0 16 16');
|
||||
svg.setAttribute('width', '16');
|
||||
svg.setAttribute('height', '16');
|
||||
svg.setAttribute('aria-hidden', 'true');
|
||||
const path = document.createElementNS('http://www.w3.org/2000/svg', 'path');
|
||||
path.setAttribute('fill', 'currentColor');
|
||||
path.setAttribute('d', 'M2 2.75A1.75 1.75 0 0 1 3.75 1h8.5A1.75 1.75 0 0 1 14 2.75v6.5A1.75 1.75 0 0 1 12.25 11H7.6l-2.82 2.1A.5.5 0 0 1 4 12.7V11h-.25A1.75 1.75 0 0 1 2 9.25Zm1.75-.75a.75.75 0 0 0-.75.75v6.5c0 .414.336.75.75.75H4.5a.5.5 0 0 1 .5.5v1.2l2.15-1.6A.5.5 0 0 1 7.45 10h4.8a.75.75 0 0 0 .75-.75v-6.5a.75.75 0 0 0-.75-.75Z');
|
||||
svg.append(path);
|
||||
return svg;
|
||||
}
|
||||
|
||||
function addPromptsNavigation() {
|
||||
const navigation = repoNavigation();
|
||||
const tasks = navigationLink('/issues');
|
||||
@@ -117,8 +130,7 @@
|
||||
link = document.createElement('a');
|
||||
link.className = tasks.className;
|
||||
link.classList.add('hop-native-prompts-tab');
|
||||
const icon = tasks.querySelector('svg');
|
||||
if (icon) link.append(icon.cloneNode(true));
|
||||
link.append(promptsIcon());
|
||||
link.append(document.createTextNode(' Prompts'));
|
||||
navigation.insertBefore(link, tasks);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user