Merge branch 'master' into yann300-patch-36

pull/5370/head
Liana Husikyan 3 years ago committed by GitHub
commit 2c7b52d21f
  1. 6
      apps/remix-ide/src/app/tabs/runTab/contractDropdown.js
  2. 20
      libs/remix-ui/tabs/src/lib/remix-ui-tabs.tsx
  3. 6342
      package-lock.json

@ -310,10 +310,10 @@ class ContractDropdownUI {
const data = self.runView.compilersArtefacts.getCompilerAbstract(contractObject.contract.file) const data = self.runView.compilersArtefacts.getCompilerAbstract(contractObject.contract.file)
self.runView.compilersArtefacts.addResolvedContract(helper.addressToString(address), data) self.runView.compilersArtefacts.addResolvedContract(helper.addressToString(address), data)
if (self.ipfsCheckedState) { if (self.ipfsCheckedState) {
_paq.push(['trackEvent', 'udapp', 'DeployAndPublish', this.networkName, this.networkId]) _paq.push(['trackEvent', 'udapp', 'DeployAndPublish', this.networkName + '_' + this.networkId])
publishToStorage('ipfs', self.runView.fileProvider, self.runView.fileManager, selectedContract) publishToStorage('ipfs', self.runView.fileProvider, self.runView.fileManager, selectedContract)
} else { } else {
_paq.push(['trackEvent', 'udapp', 'DeployOnly', this.networkName, this.networkId]) _paq.push(['trackEvent', 'udapp', 'DeployOnly', this.networkName + '_' + this.networkId])
} }
} }
@ -347,7 +347,7 @@ class ContractDropdownUI {
} }
deployContract (selectedContract, args, contractMetadata, compilerContracts, callbacks, confirmationCb) { deployContract (selectedContract, args, contractMetadata, compilerContracts, callbacks, confirmationCb) {
_paq.push(['trackEvent', 'udapp', 'DeployContractTo', this.networkName, this.networkId]) _paq.push(['trackEvent', 'udapp', 'DeployContractTo', this.networkName + '_' + this.networkId])
const { statusCb } = callbacks const { statusCb } = callbacks
if (!contractMetadata || (contractMetadata && contractMetadata.autoDeployLib)) { if (!contractMetadata || (contractMetadata && contractMetadata.autoDeployLib)) {
return this.blockchain.deployContractAndLibraries(selectedContract, args, contractMetadata, compilerContracts, callbacks, confirmationCb) return this.blockchain.deployContractAndLibraries(selectedContract, args, contractMetadata, compilerContracts, callbacks, confirmationCb)

@ -21,6 +21,8 @@ export const TabsUI = (props: TabsUIProps) => {
const [selectedIndex, setSelectedIndex] = useState(-1) const [selectedIndex, setSelectedIndex] = useState(-1)
const currentIndexRef = useRef(-1) const currentIndexRef = useRef(-1)
const tabsRef = useRef({}) const tabsRef = useRef({})
const tabsElement = useRef(null)
const tabs = useRef(props.tabs) const tabs = useRef(props.tabs)
tabs.current = props.tabs // we do this to pass the tabs list to the onReady callbacks tabs.current = props.tabs // we do this to pass the tabs list to the onReady callbacks
@ -53,11 +55,22 @@ export const TabsUI = (props: TabsUIProps) => {
currentIndexRef.current = index currentIndexRef.current = index
setSelectedIndex(index) setSelectedIndex(index)
} }
const transformScroll = (event) => {
if (!event.deltaY) {
return
}
event.currentTarget.scrollLeft += event.deltaY + event.deltaX
event.preventDefault()
}
useEffect(() => { useEffect(() => {
props.onReady({ props.onReady({
activateTab, activateTab,
active active
}) })
return () => { tabsElement.current.removeEventListener('wheel', transformScroll) }
}, []) }, [])
return ( return (
@ -70,8 +83,13 @@ export const TabsUI = (props: TabsUIProps) => {
<Tabs <Tabs
className="tab-scroll" className="tab-scroll"
selectedIndex={selectedIndex} selectedIndex={selectedIndex}
domRef={(domEl) => {
if (tabsElement.current) return
tabsElement.current = domEl
tabsElement.current.addEventListener('wheel', transformScroll)
}}
> >
<TabList className="d-flex flex-row justify-content-center align-items-center"> <TabList className="d-flex flex-row align-items-center">
{props.tabs.map((tab, i) => <Tab className="py-1" key={tab.name}>{renderTab(tab, i)}</Tab>)} {props.tabs.map((tab, i) => <Tab className="py-1" key={tab.name}>{renderTab(tab, i)}</Tab>)}
</TabList> </TabList>
{props.tabs.map((tab) => <TabPanel key={tab.name} ></TabPanel>)} {props.tabs.map((tab) => <TabPanel key={tab.name} ></TabPanel>)}

6342
package-lock.json generated

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save