|
|
@ -2,6 +2,7 @@ |
|
|
|
import React, { useEffect, useState, useContext } from 'react' |
|
|
|
import React, { useEffect, useState, useContext } from 'react' |
|
|
|
import { FormattedMessage } from 'react-intl' |
|
|
|
import { FormattedMessage } from 'react-intl' |
|
|
|
import { ThemeContext } from '../themeContext' |
|
|
|
import { ThemeContext } from '../themeContext' |
|
|
|
|
|
|
|
import { CustomTooltip } from '@remix-ui/helper' |
|
|
|
declare global { |
|
|
|
declare global { |
|
|
|
interface Window { |
|
|
|
interface Window { |
|
|
|
_paq: any |
|
|
|
_paq: any |
|
|
@ -27,10 +28,6 @@ function HomeTabLearn ({plugin}: HomeTabLearnProps) { |
|
|
|
|
|
|
|
|
|
|
|
const themeFilter = useContext(ThemeContext) |
|
|
|
const themeFilter = useContext(ThemeContext) |
|
|
|
|
|
|
|
|
|
|
|
const openLink = () => { |
|
|
|
|
|
|
|
window.open("https://remix-ide.readthedocs.io/en/latest/remix_tutorials_learneth.html?highlight=learneth#learneth-tutorial-repos", '_blank') |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const startLearnEthTutorial = async (tutorial: 'basics' | 'soliditybeginner' | 'deploylibraries') => { |
|
|
|
const startLearnEthTutorial = async (tutorial: 'basics' | 'soliditybeginner' | 'deploylibraries') => { |
|
|
|
await plugin.appManager.activatePlugin(['solidity', 'LearnEth', 'solidityUnitTesting']) |
|
|
|
await plugin.appManager.activatePlugin(['solidity', 'LearnEth', 'solidityUnitTesting']) |
|
|
|
plugin.verticalIcons.select('LearnEth') |
|
|
|
plugin.verticalIcons.select('LearnEth') |
|
|
@ -52,9 +49,16 @@ function HomeTabLearn ({plugin}: HomeTabLearnProps) { |
|
|
|
return ( |
|
|
|
return ( |
|
|
|
<div className="d-flex px-2 pb-2 pt-2 d-flex flex-column" id="hTLearnSection"> |
|
|
|
<div className="d-flex px-2 pb-2 pt-2 d-flex flex-column" id="hTLearnSection"> |
|
|
|
<div className="d-flex justify-content-between"> |
|
|
|
<div className="d-flex justify-content-between"> |
|
|
|
<label className="py-2 align-self-center m-0" style={{fontSize: "1.2rem"}}> |
|
|
|
<label className="py-2 pt-3 align-self-center m-0" style={{fontSize: "1.2rem"}}> |
|
|
|
<FormattedMessage id="home.learn" /> |
|
|
|
<FormattedMessage id="home.learn" /> |
|
|
|
</label> |
|
|
|
</label> |
|
|
|
|
|
|
|
<CustomTooltip |
|
|
|
|
|
|
|
placement={'top'} |
|
|
|
|
|
|
|
tooltipId="overlay-tooltip" |
|
|
|
|
|
|
|
tooltipClasses="text-nowrap" |
|
|
|
|
|
|
|
tooltipText={"See all tutorials"} |
|
|
|
|
|
|
|
tooltipTextClasses="border bg-light text-dark p-1 pr-3" |
|
|
|
|
|
|
|
> |
|
|
|
<button |
|
|
|
<button |
|
|
|
onClick={ async () => { |
|
|
|
onClick={ async () => { |
|
|
|
await goToLearnEthHome() |
|
|
|
await goToLearnEthHome() |
|
|
@ -63,6 +67,7 @@ function HomeTabLearn ({plugin}: HomeTabLearnProps) { |
|
|
|
> |
|
|
|
> |
|
|
|
<img className="align-self-center" src="assets/img/learnEthLogo.webp" alt="" style={ { filter: themeFilter.filter, width: "1rem", height: "1ren" } } /> |
|
|
|
<img className="align-self-center" src="assets/img/learnEthLogo.webp" alt="" style={ { filter: themeFilter.filter, width: "1rem", height: "1ren" } } /> |
|
|
|
</button> |
|
|
|
</button> |
|
|
|
|
|
|
|
</CustomTooltip> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div className="d-flex flex-column"> |
|
|
|
<div className="d-flex flex-column"> |
|
|
|
<label className="d-flex flex-column btn border" onClick={() => setState((prevState) => {return { ...prevState, visibleTutorial: VisibleTutorial.Basics }})}> |
|
|
|
<label className="d-flex flex-column btn border" onClick={() => setState((prevState) => {return { ...prevState, visibleTutorial: VisibleTutorial.Basics }})}> |
|
|
@ -70,7 +75,7 @@ function HomeTabLearn ({plugin}: HomeTabLearnProps) { |
|
|
|
<FormattedMessage id="home.learnEth1" /> |
|
|
|
<FormattedMessage id="home.learnEth1" /> |
|
|
|
</label> |
|
|
|
</label> |
|
|
|
{(state.visibleTutorial === VisibleTutorial.Basics) && <div className="pt-2 d-flex flex-column text-left"> |
|
|
|
{(state.visibleTutorial === VisibleTutorial.Basics) && <div className="pt-2 d-flex flex-column text-left"> |
|
|
|
<span> |
|
|
|
<span className="py-1" style={{fontSize: "0.8rem"}}> |
|
|
|
<FormattedMessage id="home.learnEth1Desc" /> |
|
|
|
<FormattedMessage id="home.learnEth1Desc" /> |
|
|
|
</span> |
|
|
|
</span> |
|
|
|
<button className="btn btn-sm btn-secondary mt-2" style={{width: 'fit-content'}} onClick={() => startLearnEthTutorial('basics')}> |
|
|
|
<button className="btn btn-sm btn-secondary mt-2" style={{width: 'fit-content'}} onClick={() => startLearnEthTutorial('basics')}> |
|
|
@ -83,8 +88,9 @@ function HomeTabLearn ({plugin}: HomeTabLearnProps) { |
|
|
|
<FormattedMessage id="home.learnEth2" /> |
|
|
|
<FormattedMessage id="home.learnEth2" /> |
|
|
|
</label> |
|
|
|
</label> |
|
|
|
{(state.visibleTutorial === VisibleTutorial.Intermediate) && <div className="pt-2 d-flex flex-column text-left"> |
|
|
|
{(state.visibleTutorial === VisibleTutorial.Intermediate) && <div className="pt-2 d-flex flex-column text-left"> |
|
|
|
<span> |
|
|
|
<span className="py-1" style={{fontSize: "0.8rem"}}> |
|
|
|
<FormattedMessage id="home.learnEth2Desc" /></span> |
|
|
|
<FormattedMessage id="home.learnEth2Desc" /> |
|
|
|
|
|
|
|
</span> |
|
|
|
<button className="btn btn-sm btn-secondary mt-2" style={{width: 'fit-content'}} onClick={() => startLearnEthTutorial('soliditybeginner')}> |
|
|
|
<button className="btn btn-sm btn-secondary mt-2" style={{width: 'fit-content'}} onClick={() => startLearnEthTutorial('soliditybeginner')}> |
|
|
|
<FormattedMessage id="home.getStarted" /> |
|
|
|
<FormattedMessage id="home.getStarted" /> |
|
|
|
</button> |
|
|
|
</button> |
|
|
@ -95,8 +101,9 @@ function HomeTabLearn ({plugin}: HomeTabLearnProps) { |
|
|
|
<FormattedMessage id="home.remixAdvanced" /> |
|
|
|
<FormattedMessage id="home.remixAdvanced" /> |
|
|
|
</label> |
|
|
|
</label> |
|
|
|
{(state.visibleTutorial === VisibleTutorial.Advanced) && <div className="pt-2 d-flex flex-column text-left"> |
|
|
|
{(state.visibleTutorial === VisibleTutorial.Advanced) && <div className="pt-2 d-flex flex-column text-left"> |
|
|
|
<span> |
|
|
|
<span className="py-1" style={{fontSize: "0.8rem"}}> |
|
|
|
<FormattedMessage id="home.remixAdvancedDesc" /></span> |
|
|
|
<FormattedMessage id="home.remixAdvancedDesc" /> |
|
|
|
|
|
|
|
</span> |
|
|
|
<button className="btn btn-sm btn-secondary mt-2" style={{width: 'fit-content'}} onClick={() => startLearnEthTutorial('deploylibraries')}> |
|
|
|
<button className="btn btn-sm btn-secondary mt-2" style={{width: 'fit-content'}} onClick={() => startLearnEthTutorial('deploylibraries')}> |
|
|
|
<FormattedMessage id="home.getStarted" /> |
|
|
|
<FormattedMessage id="home.getStarted" /> |
|
|
|
</button> |
|
|
|
</button> |
|
|
|