fix learnEth button

pull/3245/head
Joseph Izang 2 years ago committed by Aniket
parent 5c1f962d50
commit f9dc2da0c4
  1. 16
      libs/remix-ui/home-tab/src/lib/components/homeTabLearn.tsx

@ -34,11 +34,23 @@ function HomeTabLearn ({plugin}: HomeTabLearnProps) {
const startLearnEthTutorial = async (tutorial: 'home' | 'basics' | 'soliditybeginner' | 'deploylibraries') => {
await plugin.appManager.activatePlugin(['solidity', 'LearnEth', 'solidityUnitTesting'])
plugin.verticalIcons.select('LearnEth')
tutorial === 'home' ? plugin.call('LearnEth') :
tutorial === 'home' ? plugin.call('LearnEth', 'home') :
plugin.call('LearnEth', 'startTutorial', 'ethereum/remix-workshops', 'master', tutorial)
_paq.push(['trackEvent', 'hometab', 'startLearnEthTutorial', tutorial])
}
const goToLearnEthHome = async () => {
console.log({ plugin })
if(plugin.appManager.isActive('LearnEth')) {
plugin.verticalIcons.select('LearnEth')
await plugin.call('LearnEth', 'home')
} else {
await plugin.appManager.activatePlugin(['learnEth', 'solidity', 'solidityUnitTesting'])
plugin.verticalIcons.select('LearnEth')
await plugin.call('LearnEth', 'home')
}
}
return (
<div className="d-flex px-2 pb-2 pt-2 d-flex flex-column" id="hTLearnSection">
<div className="d-flex justify-content-between">
@ -47,7 +59,7 @@ function HomeTabLearn ({plugin}: HomeTabLearnProps) {
</label>
<button
onClick={ async () => {
await startLearnEthTutorial('home')
await goToLearnEthHome()
}}
className="h-100 px-2 pt-0 btn"
>

Loading…
Cancel
Save