From 5cb2d02063b4cba3469f3ebd82f375143c53af5d Mon Sep 17 00:00:00 2001 From: AlphaX-Projects <77661270+AlphaX-Projects@users.noreply.github.com> Date: Fri, 10 May 2024 10:49:47 +0200 Subject: [PATCH] Fix text color, broken link and remove last tab --- core/src/components/show-plugin.js | 62 ++++++++++++++++++------------ core/src/styles/core-css.js | 1 + 2 files changed, 38 insertions(+), 25 deletions(-) diff --git a/core/src/components/show-plugin.js b/core/src/components/show-plugin.js index a5e965a9..8885a5fa 100644 --- a/core/src/components/show-plugin.js +++ b/core/src/components/show-plugin.js @@ -421,35 +421,46 @@ class ShowPlugin extends connect(store)(LitElement) { let iconId = '' this.tabs = this.tabs.filter((tab, tIndex) => tIndex !== index) - this.currentTab = this.tabs.length - 1; + this.currentTab = this.tabs.length - 1 const tabD = this.tabs.length - 1 - const plugObj = this.tabs[tabD].url - theId = this.tabs[tabD].id - tabId = 'tab-' + theId - frameId = 'frame-' + theId - plugId = 'plug-' + theId - iconId = 'icon-' + theId - var tabActive = this.shadowRoot.getElementById(tabId) - var frameActive = this.shadowRoot.getElementById(frameId) - var plugActive = this.shadowRoot.getElementById(plugId) - var iconActive = this.shadowRoot.getElementById(iconId) - - if (plugObj === undefined || '') { - tabActive.classList.add('active') - iconActive.classList.remove('iconInactive') - iconActive.classList.add('iconActive') - plugActive.classList.remove('hideIframe') - plugActive.classList.add('showIframe') + if (tabD < 0) { + const lengthOfTabs = this.tabs.length + this.addTab({ + url: '', + id: this.uid.rnd() + }) + this.currentTab = lengthOfTabs } else { - tabActive.classList.add('active') - iconActive.classList.remove('iconInactive') - iconActive.classList.add('iconActive') - frameActive.classList.remove('hideIframe') - frameActive.classList.add('showIframe') + const plugObj = this.tabs[tabD].url + theId = this.tabs[tabD].id + tabId = 'tab-' + theId + frameId = 'frame-' + theId + plugId = 'plug-' + theId + iconId = 'icon-' + theId + + var tabActive = this.shadowRoot.getElementById(tabId) + var frameActive = this.shadowRoot.getElementById(frameId) + var plugActive = this.shadowRoot.getElementById(plugId) + var iconActive = this.shadowRoot.getElementById(iconId) + + if (plugObj === undefined || '') { + tabActive.classList.add('active') + iconActive.classList.remove('iconInactive') + iconActive.classList.add('iconActive') + plugActive.classList.remove('hideIframe') + plugActive.classList.add('showIframe') + } else { + tabActive.classList.add('active') + iconActive.classList.remove('iconInactive') + iconActive.classList.add('iconActive') + frameActive.classList.remove('hideIframe') + frameActive.classList.add('showIframe') + } + + this.requestUpdate() } - this.requestUpdate() } else { // Remove tab from array this.tabs = this.tabs.filter((tab, tIndex) => tIndex !== index) @@ -457,6 +468,7 @@ class ShowPlugin extends connect(store)(LitElement) { if (this.tabs.length !== 0) { this.currentTab = 0 } + this.requestUpdate() } } @@ -1583,7 +1595,7 @@ class NavBar extends connect(store)(LitElement) { if (this.pluginType === 'overview-page') { this.pluginPage = 'overview-page/index.html' } else if (this.pluginType === 'minting') { - this.pluginPage = 'minting/index.html' + this.pluginPage = 'minting-info/index.html' } else if (this.pluginType === 'become-minter') { this.pluginPage = 'become-minter/index.html' } else if (this.pluginType === 'sponsorship-list') { diff --git a/core/src/styles/core-css.js b/core/src/styles/core-css.js index 400cc10e..ca5ebdfb 100644 --- a/core/src/styles/core-css.js +++ b/core/src/styles/core-css.js @@ -2497,6 +2497,7 @@ export const showPluginStyles = css` --mdc-theme-surface: var(--white); --mdc-text-field-outlined-idle-border-color: var(--txtfieldborder); --mdc-text-field-outlined-hover-border-color: var(--txtfieldhoverborder); + --mdc-text-field-disabled-ink-color: var(--black); --mdc-text-field-label-ink-color: var(--black); --mdc-text-field-ink-color: var(--black); --mdc-select-ink-color: var(--black);