Merge branch 'master' into template-explorer-fixes

pull/5179/head
Joseph Izang 5 months ago committed by GitHub
commit 5494b10a25
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 32
      apps/remix-ide/ci/downloadsoljson.sh
  2. 7
      apps/remix-ide/src/app/tabs/locales/en/home.json
  3. BIN
      apps/remix-ide/src/assets/img/remi-prof.webp
  4. 1123
      apps/remix-ide/src/assets/list.json
  5. 27
      libs/remix-ui/home-tab/src/lib/components/homeTabFeatured.tsx
  6. 27
      libs/remix-ui/home-tab/src/lib/components/homeTabFeaturedPlugins.tsx
  7. 2
      libs/remix-ui/home-tab/src/lib/remix-ui-home-tab.tsx

@ -4,7 +4,7 @@ echo "Downloading specified soljson.js version based on defaultVersion in packag
set -e set -e
# Check if curl and jq are installed # Check if curl is installed
if ! command -v curl &> /dev/null; then if ! command -v curl &> /dev/null; then
echo "curl could not be found" echo "curl could not be found"
exit 1 exit 1
@ -14,32 +14,38 @@ fi
defaultVersion=$(grep '"defaultVersion"' package.json | awk -F '"' '{print $4}') defaultVersion=$(grep '"defaultVersion"' package.json | awk -F '"' '{print $4}')
echo "Specified version from package.json: $defaultVersion" echo "Specified version from package.json: $defaultVersion"
# Download the list.json file containing available versions # Fetch the list.json from the Solidity binaries
curl -s https://binaries.soliditylang.org/wasm/list.json > list.json listJson=$(curl -s --connect-timeout 5 --max-time 5 https://binaries.soliditylang.org/wasm/list.json)
# Check if the download was successful
if [ -z "$listJson" ]; then
echo "Failed to fetch version list. No internet connection or the connection is too slow."
exit 0 # Silently exit
fi
# Overwrite the local list.json with the fetched content
echo "$listJson" > ./apps/remix-ide/src/assets/list.json
# Check if the specified version exists in the list
check=$(echo "$listJson" | grep "\"$defaultVersion\"")
# Use jq to extract the path for the specified version from the builds array
check=$(grep "\"$defaultVersion\"" list.json)
if [ -z "$check" ]; then if [ -z "$check" ]; then
echo "The specified version $defaultVersion could not be found in the list" echo "The specified version $defaultVersion could not be found in the list"
exit 1 exit 1
fi fi
echo "Path for the specified version: $defaultVersion" echo "Path for the specified version: $defaultVersion"
fullPath="https://binaries.soliditylang.org/bin/$defaultVersion" fullPath="https://binaries.soliditylang.org/bin/$defaultVersion"
echo "Download fullPath: $fullPath" echo "Download fullPath: $fullPath"
# Ensure the target directory exists # Ensure the target directory exists
if [ ! -d "./apps/remix-ide/src/assets/js/soljson" ]; then if [ ! -d "./apps/remix-ide/src/assets/js/soljson" ]; then
mkdir -p ./apps/remix-ide/src/assets/js/soljson mkdir -p ./apps/remix-ide/src/assets/js/soljson
fi fi
# Download the file to ./apps/remix-ide/src/assets/js/soljson.js # Download the soljson.js file to ./apps/remix-ide/src/assets/js/soljson.js
echo "Downloading soljson.js from "$fullPath" to ./apps/remix-ide/src/assets/js/soljson.js" echo "Downloading soljson.js from $fullPath to ./apps/remix-ide/src/assets/js/soljson.js"
curl -s "$fullPath" > ./apps/remix-ide/src/assets/js/soljson.js curl -s "$fullPath" > ./apps/remix-ide/src/assets/js/soljson.js
# Copy the downloaded soljson.js to the specific version directory # Copy the downloaded soljson.js to the specific version directory
cp ./apps/remix-ide/src/assets/js/soljson.js "./apps/remix-ide/src/assets/js/soljson/$path" cp ./apps/remix-ide/src/assets/js/soljson.js "./apps/remix-ide/src/assets/js/soljson/$defaultVersion.js"
cp list.json ./apps/remix-ide/src/assets/list.json
# Clean up by removing the list.json echo "Download and setup of soljson.js complete"
rm list.json

@ -7,9 +7,9 @@
"home.learnMore": "Learn more", "home.learnMore": "Learn more",
"home.here": "more", "home.here": "more",
"home.featured": "Featured", "home.featured": "Featured",
"home.jumpIntoWeb3": "JUMP INTO WEB3", "home.learnEthPromoTitle": "LearnEth: Tutorials inside Remix",
"home.jumpIntoWeb3More": "More", "home.learnEthPromoButton": "Start Learning",
"home.jumpIntoWeb3Text": "Remix IDE is part of the Remix Project, a rich toolset that can be used for the entire journey of contract development by users of any knowledge level. Learn more on the Remix Project website.", "home.learnEthPromoText": "Check out tutorials on Remix, Solidity, and other Web3 projects. Great for all skill levels.",
"home.remixYouTube": "WATCH TO LEARN", "home.remixYouTube": "WATCH TO LEARN",
"home.remixYouTubeText1": "Video Tips from the Remix Team", "home.remixYouTubeText1": "Video Tips from the Remix Team",
"home.remixYouTubeMore": "Watch", "home.remixYouTubeMore": "Watch",
@ -37,6 +37,7 @@
"home.ozerc1155TemplateDesc": "Create an ERC1155 token by importing OpenZeppelin library.", "home.ozerc1155TemplateDesc": "Create an ERC1155 token by importing OpenZeppelin library.",
"home.gnosisSafeMultisigTemplateDesc": "Create Multi-Signature wallets using this template.", "home.gnosisSafeMultisigTemplateDesc": "Create Multi-Signature wallets using this template.",
"home.zeroxErc20TemplateDesc": "Create an ERC20 token by importing 0xProject contract.", "home.zeroxErc20TemplateDesc": "Create an ERC20 token by importing 0xProject contract.",
"home.learnEthPluginDesc": "Learn about Remix, Solidity, and other Web3 projects.",
"home.learn": "Learn", "home.learn": "Learn",
"home.learnEth1": "Remix Basics", "home.learnEth1": "Remix Basics",
"home.learnEth1Desc": "An introduction to Remix's interface and basic operations.", "home.learnEth1Desc": "An introduction to Remix's interface and basic operations.",

Binary file not shown.

After

Width:  |  Height:  |  Size: 62 KiB

File diff suppressed because it is too large Load Diff

@ -7,8 +7,11 @@ import 'react-multi-carousel/lib/styles.css'
import * as releaseDetails from './../../../../../../releaseDetails.json' import * as releaseDetails from './../../../../../../releaseDetails.json'
const _paq = (window._paq = window._paq || []) // eslint-disable-line const _paq = (window._paq = window._paq || []) // eslint-disable-line
export type HomeTabFeaturedProps = {
plugin: any
}
function HomeTabFeatured() { function HomeTabFeatured(props:HomeTabFeaturedProps) {
const themeFilter = useContext(ThemeContext) const themeFilter = useContext(ThemeContext)
return ( return (
@ -64,23 +67,27 @@ function HomeTabFeatured() {
</div> </div>
<div className="mr-1 pr-1 d-flex align-items-center justify-content-center h-100"> <div className="mr-1 pr-1 d-flex align-items-center justify-content-center h-100">
<a href="https://remix-project.org" target="__blank"> <a href="https://remix-project.org" target="__blank">
<img src={'assets/img/bgRemi_small.webp'} className="remixui_carouselImage" alt=""></img> <img src={'assets/img/remi-prof.webp'} className="remixui_carouselImage" alt=""></img>
</a> </a>
<div className="h6 w-50 p-2 pl-4 align-self-center" style={{ flex: '1' }}> <div className="h6 w-50 p-2 pl-4 align-self-center" style={{ flex: '1' }}>
<h5> <h5>
<FormattedMessage id="home.jumpIntoWeb3" /> <FormattedMessage id="home.learnEthPromoTitle" />
</h5> </h5>
<div style={{ fontSize: '0.8rem', lineHeight: '1.25rem' }} className="mb-3"> <div style={{ fontSize: '0.8rem', lineHeight: '1.25rem' }} className="mb-3">
<FormattedMessage id="home.jumpIntoWeb3Text" /> <FormattedMessage id="home.learnEthPromoText" />
</div> </div>
<a <span
className="remixui_home_text btn-sm btn-secondary mt-2 text-decoration-none mb-3" className="remixui_home_text btn-sm btn-secondary mt-2 text-decoration-none mb-3"
onClick={() => _paq.push(['trackEvent', 'hometab', 'featuredSection', 'jumpIntoWeb3'])} style={{ cursor: 'pointer' }}
target="__blank" onClick={async () => {
href="https://remix-project.org/" await props.plugin.appManager.activatePlugin(['LearnEth', 'solidityUnitTesting'])
props.plugin.verticalIcons.select('LearnEth')
await props.plugin.call('LearnEth', 'home')
}
}
> >
<FormattedMessage id="home.jumpIntoWeb3More" /> <FormattedMessage id="home.learnEthPromoButton" />
</a> </span>
</div> </div>
</div> </div>
<div className="mr-1 pr-1 d-flex align-items-center justify-content-center h-100"> <div className="mr-1 pr-1 d-flex align-items-center justify-content-center h-100">

@ -67,10 +67,10 @@ function HomeTabFeaturedPlugins({ plugin }: HomeTabFeaturedPluginsProps) {
plugin.verticalIcons.select('solidityStaticAnalysis') plugin.verticalIcons.select('solidityStaticAnalysis')
_paq.push(['trackEvent', 'hometabActivate', 'userActivate', 'solidityStaticAnalysis']) _paq.push(['trackEvent', 'hometabActivate', 'userActivate', 'solidityStaticAnalysis'])
} }
const startSourceVerify = async () => { const startLearnEth = async () => {
await plugin.appManager.activatePlugin(['solidity', 'sourcify']) await plugin.appManager.activatePlugin(['LearnEth', 'solidity', 'solidityUnitTesting'])
plugin.verticalIcons.select('sourcify') plugin.verticalIcons.select('LearnEth')
_paq.push(['trackEvent', 'hometabActivate', 'userActivate', 'sourcify']) _paq.push(['trackEvent', 'hometabActivate', 'userActivate', 'LearnEth'])
} }
const startCookbook = async () => { const startCookbook = async () => {
await plugin.appManager.activatePlugin(['cookbookdev']) await plugin.appManager.activatePlugin(['cookbookdev'])
@ -109,7 +109,7 @@ function HomeTabFeaturedPlugins({ plugin }: HomeTabFeaturedPluginsProps) {
} }
}} }}
renderButtonGroupOutside={true} renderButtonGroupOutside={true}
ssr={true} // means to render carousel on server-side. ssr={false} // means to render carousel on server-side.
keyBoardControl={true} keyBoardControl={true}
containerClass="carousel-container" containerClass="carousel-container"
deviceType={'desktop'} deviceType={'desktop'}
@ -125,6 +125,16 @@ function HomeTabFeaturedPlugins({ plugin }: HomeTabFeaturedPluginsProps) {
remixMaintained={true} remixMaintained={true}
callback={() => startCodeAnalyzer()} callback={() => startCodeAnalyzer()}
/> />
<PluginButton
imgPath="assets/img/learnEthLogo.webp"
envID="learnEthLogo"
envText="LearnEth Tutorials"
description={intl.formatMessage({
id: 'home.learnEthPluginDesc'
})}
remixMaintained={true}
callback={() => startLearnEth()}
/>
<PluginButton <PluginButton
imgPath="assets/img/cookbook.webp" imgPath="assets/img/cookbook.webp"
envID="cookbookLogo" envID="cookbookLogo"
@ -141,13 +151,6 @@ function HomeTabFeaturedPlugins({ plugin }: HomeTabFeaturedPluginsProps) {
remixMaintained={true} remixMaintained={true}
callback={() => startSolidity()} callback={() => startSolidity()}
/> />
<PluginButton
imgPath="assets/img/sourcifyNewLogo.webp"
envID="sourcifyLogo"
envText="Sourcify"
description={intl.formatMessage({ id: 'home.sourcifyPluginDesc' })}
callback={() => startSourceVerify()}
/>
<PluginButton <PluginButton
imgPath="assets/img/unitTesting.webp" imgPath="assets/img/unitTesting.webp"
envID="sUTLogo" envID="sUTLogo"

@ -86,7 +86,7 @@ export const RemixUiHomeTab = (props: RemixUiHomeTabProps) => {
</div> </div>
<div className="pl-2 pr-3 justify-content-start d-flex flex-column" style={{ width: `${carouselWidth}%` }} id="remixUIHTRight"> <div className="pl-2 pr-3 justify-content-start d-flex flex-column" style={{ width: `${carouselWidth}%` }} id="remixUIHTRight">
<LanguageOptions plugin={plugin}/> <LanguageOptions plugin={plugin}/>
<HomeTabFeatured></HomeTabFeatured> <HomeTabFeatured plugin={plugin}></HomeTabFeatured>
<HomeTabFeaturedPlugins plugin={plugin}></HomeTabFeaturedPlugins> <HomeTabFeaturedPlugins plugin={plugin}></HomeTabFeaturedPlugins>
</div> </div>
</div> </div>

Loading…
Cancel
Save