From 44c4c463e64b9f441fefc65ca4fab40dd850b836 Mon Sep 17 00:00:00 2001 From: aniket-engg Date: Wed, 16 Oct 2024 19:12:25 +0530 Subject: [PATCH 01/33] update ballot contract --- apps/remix-ide/contracts/ballot.sol | 55 ++++++++++++++++++++++++----- 1 file changed, 46 insertions(+), 9 deletions(-) diff --git a/apps/remix-ide/contracts/ballot.sol b/apps/remix-ide/contracts/ballot.sol index aa49825fac..56b2159551 100644 --- a/apps/remix-ide/contracts/ballot.sol +++ b/apps/remix-ide/contracts/ballot.sol @@ -7,7 +7,9 @@ pragma solidity >=0.7.0 <0.9.0; * @dev Implements voting process along with vote delegation */ contract Ballot { - + // This declares a new complex type which will + // be used for variables later. + // It will represent a single voter. struct Voter { uint weight; // weight is accumulated by delegation bool voted; // if true, that person already voted @@ -15,6 +17,7 @@ contract Ballot { uint vote; // index of the voted proposal } + // This is a type for a single proposal. struct Proposal { // If you can limit the length to a certain number of bytes, // always use one of bytes1 to bytes32 because they are much cheaper @@ -24,8 +27,11 @@ contract Ballot { address public chairperson; + // This declares a state variable that + // stores a 'Voter' struct for each possible address. mapping(address => Voter) public voters; + // A dynamically-sized array of 'Proposal' structs. Proposal[] public proposals; /** @@ -36,6 +42,9 @@ contract Ballot { chairperson = msg.sender; voters[chairperson].weight = 1; + // For each of the provided proposal names, + // create a new proposal object and add it + // to the end of the array. for (uint i = 0; i < proposalNames.length; i++) { // 'Proposal({...})' creates a temporary // Proposal object and 'proposals.push(...)' @@ -47,11 +56,21 @@ contract Ballot { } } - /** + /** * @dev Give 'voter' the right to vote on this ballot. May only be called by 'chairperson'. * @param voter address of voter */ - function giveRightToVote(address voter) public { + function giveRightToVote(address voter) external { + // If the first argument of `require` evaluates + // to 'false', execution terminates and all + // changes to the state and to Ether balances + // are reverted. + // This used to consume all gas in old EVM versions, but + // not anymore. + // It is often a good idea to use 'require' to check if + // functions are called correctly. + // As a second argument, you can also provide an + // explanation about what went wrong. require( msg.sender == chairperson, "Only chairperson can give right to vote." @@ -68,20 +87,39 @@ contract Ballot { * @dev Delegate your vote to the voter 'to'. * @param to address to which vote is delegated */ - function delegate(address to) public { + function delegate(address to) external { + // assigns reference Voter storage sender = voters[msg.sender]; + require(sender.weight != 0, "You have no right to vote"); require(!sender.voted, "You already voted."); + require(to != msg.sender, "Self-delegation is disallowed."); + // Forward the delegation as long as + // 'to' also delegated. + // In general, such loops are very dangerous, + // because if they run too long, they might + // need more gas than is available in a block. + // In this case, the delegation will not be executed, + // but in other situations, such loops might + // cause a contract to get "stuck" completely. while (voters[to].delegate != address(0)) { to = voters[to].delegate; // We found a loop in the delegation, not allowed. require(to != msg.sender, "Found loop in delegation."); } + + Voter storage delegate_ = voters[to]; + + // Voters cannot delegate to accounts that cannot vote. + require(delegate_.weight >= 1); + + // Since 'sender' is a reference, this + // modifies 'voters[msg.sender]'. sender.voted = true; sender.delegate = to; - Voter storage delegate_ = voters[to]; + if (delegate_.voted) { // If the delegate already voted, // directly add to the number of votes @@ -97,11 +135,10 @@ contract Ballot { * @dev Give your vote (including votes delegated to you) to proposal 'proposals[proposal].name'. * @param proposal index of proposal in the proposals array */ - function vote(uint proposal) public { + function vote(uint proposal) external { Voter storage sender = voters[msg.sender]; require(sender.weight != 0, "Has no right to vote"); require(!sender.voted, "Already voted."); - require(proposal < proposals.length, "Invalid proposal index."); sender.voted = true; sender.vote = proposal; @@ -131,9 +168,9 @@ contract Ballot { * @dev Calls winningProposal() function to get the index of the winner contained in the proposals array and then * @return winnerName_ the name of the winner */ - function winnerName() public view + function winnerName() external view returns (bytes32 winnerName_) { winnerName_ = proposals[winningProposal()].name; } -} +} \ No newline at end of file From 757e7a055a4406c02f67d43e925d279ffe848e4d Mon Sep 17 00:00:00 2001 From: aniket-engg Date: Fri, 18 Oct 2024 12:40:37 +0530 Subject: [PATCH 02/33] update Ballot contract in template --- .../remixDefault/contracts/3_Ballot.sol | 54 ++++++++++++++++--- 1 file changed, 46 insertions(+), 8 deletions(-) diff --git a/libs/remix-ws-templates/src/templates/remixDefault/contracts/3_Ballot.sol b/libs/remix-ws-templates/src/templates/remixDefault/contracts/3_Ballot.sol index ffcc6c3609..56b2159551 100644 --- a/libs/remix-ws-templates/src/templates/remixDefault/contracts/3_Ballot.sol +++ b/libs/remix-ws-templates/src/templates/remixDefault/contracts/3_Ballot.sol @@ -7,7 +7,9 @@ pragma solidity >=0.7.0 <0.9.0; * @dev Implements voting process along with vote delegation */ contract Ballot { - + // This declares a new complex type which will + // be used for variables later. + // It will represent a single voter. struct Voter { uint weight; // weight is accumulated by delegation bool voted; // if true, that person already voted @@ -15,6 +17,7 @@ contract Ballot { uint vote; // index of the voted proposal } + // This is a type for a single proposal. struct Proposal { // If you can limit the length to a certain number of bytes, // always use one of bytes1 to bytes32 because they are much cheaper @@ -24,8 +27,11 @@ contract Ballot { address public chairperson; + // This declares a state variable that + // stores a 'Voter' struct for each possible address. mapping(address => Voter) public voters; + // A dynamically-sized array of 'Proposal' structs. Proposal[] public proposals; /** @@ -36,6 +42,9 @@ contract Ballot { chairperson = msg.sender; voters[chairperson].weight = 1; + // For each of the provided proposal names, + // create a new proposal object and add it + // to the end of the array. for (uint i = 0; i < proposalNames.length; i++) { // 'Proposal({...})' creates a temporary // Proposal object and 'proposals.push(...)' @@ -47,11 +56,21 @@ contract Ballot { } } - /** + /** * @dev Give 'voter' the right to vote on this ballot. May only be called by 'chairperson'. * @param voter address of voter */ - function giveRightToVote(address voter) public { + function giveRightToVote(address voter) external { + // If the first argument of `require` evaluates + // to 'false', execution terminates and all + // changes to the state and to Ether balances + // are reverted. + // This used to consume all gas in old EVM versions, but + // not anymore. + // It is often a good idea to use 'require' to check if + // functions are called correctly. + // As a second argument, you can also provide an + // explanation about what went wrong. require( msg.sender == chairperson, "Only chairperson can give right to vote." @@ -60,7 +79,7 @@ contract Ballot { !voters[voter].voted, "The voter already voted." ); - require(voters[voter].weight == 0); + require(voters[voter].weight == 0, "Voter already has the right to vote."); voters[voter].weight = 1; } @@ -68,20 +87,39 @@ contract Ballot { * @dev Delegate your vote to the voter 'to'. * @param to address to which vote is delegated */ - function delegate(address to) public { + function delegate(address to) external { + // assigns reference Voter storage sender = voters[msg.sender]; + require(sender.weight != 0, "You have no right to vote"); require(!sender.voted, "You already voted."); + require(to != msg.sender, "Self-delegation is disallowed."); + // Forward the delegation as long as + // 'to' also delegated. + // In general, such loops are very dangerous, + // because if they run too long, they might + // need more gas than is available in a block. + // In this case, the delegation will not be executed, + // but in other situations, such loops might + // cause a contract to get "stuck" completely. while (voters[to].delegate != address(0)) { to = voters[to].delegate; // We found a loop in the delegation, not allowed. require(to != msg.sender, "Found loop in delegation."); } + + Voter storage delegate_ = voters[to]; + + // Voters cannot delegate to accounts that cannot vote. + require(delegate_.weight >= 1); + + // Since 'sender' is a reference, this + // modifies 'voters[msg.sender]'. sender.voted = true; sender.delegate = to; - Voter storage delegate_ = voters[to]; + if (delegate_.voted) { // If the delegate already voted, // directly add to the number of votes @@ -97,7 +135,7 @@ contract Ballot { * @dev Give your vote (including votes delegated to you) to proposal 'proposals[proposal].name'. * @param proposal index of proposal in the proposals array */ - function vote(uint proposal) public { + function vote(uint proposal) external { Voter storage sender = voters[msg.sender]; require(sender.weight != 0, "Has no right to vote"); require(!sender.voted, "Already voted."); @@ -130,7 +168,7 @@ contract Ballot { * @dev Calls winningProposal() function to get the index of the winner contained in the proposals array and then * @return winnerName_ the name of the winner */ - function winnerName() public view + function winnerName() external view returns (bytes32 winnerName_) { winnerName_ = proposals[winningProposal()].name; From 16c45865a2e0d501be3acb48f60cd2fc08e9fc36 Mon Sep 17 00:00:00 2001 From: aniket-engg Date: Fri, 18 Oct 2024 13:07:29 +0530 Subject: [PATCH 03/33] fix search e2e --- apps/remix-ide-e2e/src/tests/search.test.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/remix-ide-e2e/src/tests/search.test.ts b/apps/remix-ide-e2e/src/tests/search.test.ts index 905aa839f6..a9d516e82a 100644 --- a/apps/remix-ide-e2e/src/tests/search.test.ts +++ b/apps/remix-ide-e2e/src/tests/search.test.ts @@ -24,7 +24,7 @@ module.exports = { .waitForElementContainsText('*[data-id="search_results"]', 'sender.voted') .waitForElementContainsText('*[data-id="search_results"]', 'read') .elements('css selector', '.search_plugin_search_line', (res) => { - Array.isArray(res.value) && browser.assert.equal(res.value.length, 6) + Array.isArray(res.value) && browser.assert.equal(res.value.length, 7) }) }, 'Should find text with exclude #group1': function (browser: NightwatchBrowser) { @@ -34,7 +34,7 @@ module.exports = { .clearValue('*[id="search_include"]').pause(2000) .setValue('*[id="search_include"]', '**').sendKeys('*[id="search_include"]', browser.Keys.ENTER).pause(4000) .elements('css selector', '.search_plugin_search_line', (res) => { - Array.isArray(res.value) && browser.assert.equal(res.value.length, 62) + Array.isArray(res.value) && browser.assert.equal(res.value.length, 63) }) .setValue('*[id="search_exclude"]', ',contracts/**').sendKeys('*[id="search_exclude"]', browser.Keys.ENTER).pause(4000) .elements('css selector', '.search_plugin_search_line', (res) => { From 670d5965c7993a648ded47fe929c687f889a148a Mon Sep 17 00:00:00 2001 From: aniket-engg Date: Fri, 18 Oct 2024 13:12:44 +0530 Subject: [PATCH 04/33] fix highlight e2e --- apps/remix-ide-e2e/src/tests/editor.test.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/apps/remix-ide-e2e/src/tests/editor.test.ts b/apps/remix-ide-e2e/src/tests/editor.test.ts index 00d3292fef..b770abe0de 100644 --- a/apps/remix-ide-e2e/src/tests/editor.test.ts +++ b/apps/remix-ide-e2e/src/tests/editor.test.ts @@ -107,9 +107,9 @@ module.exports = { .addFile('removeAllSourcehighlightScript.js', removeAllSourcehighlightScript) .openFile('sourcehighlight.js') .executeScriptInTerminal('remix.exeCurrent()') - .scrollToLine(32) - .waitForElementPresent('.highlightLine33', 60000) - .checkElementStyle('.highlightLine33', 'background-color', 'rgb(52, 152, 219)') + .scrollToLine(33) + .waitForElementPresent('.highlightLine34', 60000) + .checkElementStyle('.highlightLine34', 'background-color', 'rgb(52, 152, 219)') .scrollToLine(40) .waitForElementPresent('.highlightLine41', 60000) .checkElementStyle('.highlightLine41', 'background-color', 'rgb(52, 152, 219)') @@ -172,11 +172,11 @@ const sourcehighlightScript = { await remix.call('fileManager', 'open', 'contracts/3_Ballot.sol') const pos = { start: { - line: 32, + line: 33, column: 3 }, end: { - line: 32, + line: 33, column: 20 } } From 1efc3ffcd1ab7b57a6cf4e5d89690802d72f1cf7 Mon Sep 17 00:00:00 2001 From: aniket-engg Date: Fri, 18 Oct 2024 13:30:11 +0530 Subject: [PATCH 05/33] fix more e2e --- apps/remix-ide-e2e/src/tests/search.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/remix-ide-e2e/src/tests/search.test.ts b/apps/remix-ide-e2e/src/tests/search.test.ts index a9d516e82a..6d71a10ceb 100644 --- a/apps/remix-ide-e2e/src/tests/search.test.ts +++ b/apps/remix-ide-e2e/src/tests/search.test.ts @@ -79,7 +79,7 @@ module.exports = { .clearValue('*[id="search_input"]') .setValue('*[id="search_input"]', 'contract').sendKeys('*[id="search_input"]', browser.Keys.ENTER).pause(4000) .elements('css selector', '.search_plugin_search_line', (res) => { - Array.isArray(res.value) && browser.assert.equal(res.value.length, 15) + Array.isArray(res.value) && browser.assert.equal(res.value.length, 16) }) }, 'Should replace text #group1': function (browser: NightwatchBrowser) { From b002143f93a603ca9da7f1c30da32d3971443750 Mon Sep 17 00:00:00 2001 From: ryestew Date: Wed, 29 May 2024 15:04:03 -0400 Subject: [PATCH 06/33] update vids & tags --- apps/remix-ide/src/app/plugins/remixGuide.tsx | 13 +- .../src/app/plugins/remixGuideData.json | 247 +++++++++++++++++- 2 files changed, 243 insertions(+), 17 deletions(-) diff --git a/apps/remix-ide/src/app/plugins/remixGuide.tsx b/apps/remix-ide/src/app/plugins/remixGuide.tsx index 2a4a79cdc2..852ebc50bf 100644 --- a/apps/remix-ide/src/app/plugins/remixGuide.tsx +++ b/apps/remix-ide/src/app/plugins/remixGuide.tsx @@ -98,13 +98,16 @@ export class RemixGuidePlugin extends ViewPlugin { showUntagged={true} showPin={false} tagList={[ - ['beginner', 'danger'], - ['advanced', 'warning'], + ['Remix', 'primary'], + ['L2', 'primary'], + ['Beginner', 'danger'], + ['Advanced', 'warning'], ['AI', 'success'], ['plugins', 'secondary'], - ['solidity', 'primary'], - ['vyper', 'info'], - ['L2', 'danger'] + ['Solidity', 'primary'], + ['Vyper', 'info'], + ['L2', 'danger'], + ['EVM', 'secondary'] ]} title={Data.title} description={Data.description} diff --git a/apps/remix-ide/src/app/plugins/remixGuideData.json b/apps/remix-ide/src/app/plugins/remixGuideData.json index 91b1b91a02..5d22dd561e 100644 --- a/apps/remix-ide/src/app/plugins/remixGuideData.json +++ b/apps/remix-ide/src/app/plugins/remixGuideData.json @@ -4,11 +4,11 @@ "description": "Streamlined access to categorized video tutorials for mastering Remix IDE. From fundamentals to advanced techniques, level up your development skills with ease.", "sections": [ { - "title": "Basics", + "title": "Remix Basics", "hScrollable": "true", "cells": [ { - "title": "first item", + "title": "Intro to Remix", "tagList": [ "L2", "AI" @@ -20,25 +20,248 @@ } }, { - "title": "second item", + "title": "Workspaces", "tagList": [ - "solidity", - "AI" + "Beginner" ], "expandViewElement": { - "videoID": "vH8T3In6ZkE", - "logo": "https://yt3.ggpht.com/9NFZbC9mkA152sSWJJgNBls6GlBdknsF-9gi6ZVk_xsHjmc82j3q1Pd5a--GCnOKUrP-YtNbHls=s48-c-k-c0x00ffffff-no-rj" + "videoID": "_VepN5pcA0kM", + "logo": "https://github.com/ethereum/remix-project/blob/master/apps/remix-ide/src/assets/img/icon.png" } }, { - "title": "third item", + "title": "Remixd", "tagList": [ - "vyper", - "AI" + "Beginner" ], "expandViewElement": { - "videoID": "vH8T3In6ZkE", - "logo": "https://yt3.ggpht.com/9NFZbC9mkA152sSWJJgNBls6GlBdknsF-9gi6ZVk_xsHjmc82j3q1Pd5a--GCnOKUrP-YtNbHls=s48-c-k-c0x00ffffff-no-rj" + "videoID": "2OAx2UoLYEI", + "logo": "https://github.com/ethereum/remix-project/blob/master/apps/remix-ide/src/assets/img/icon.png" + } + }, + { + "title": "Verifying w/ Etherscan", + "tagList": [ + "Solidity" + ], + "expandViewElement": { + "videoID": "hEJ1OlT8jQ4", + "logo": "https://github.com/ethereum/remix-project/blob/master/apps/remix-ide/src/assets/img/icon.png" + } + }, + { + "title": "Essential Features", + "tagList": [ + "Remix" + ], + "expandViewElement": { + "videoID": "rBExlmWLCBA", + "logo": "https://github.com/ethereum/remix-project/blob/master/apps/remix-ide/src/assets/img/icon.png" + } + }, + { + "title": "Remix w/ Hardhat", + "tagList": [ + "Remix" + ], + "expandViewElement": { + "videoID": "8adSqvhvumQ", + "logo": "https://github.com/ethereum/remix-project/blob/master/apps/remix-ide/src/assets/img/icon.png" + } + } + ] + }, + { + "title": "Solidity Basics", + "hScrollable": "true", + "cells": [ + { + "title": "Hello World", + "tagList": [ + "Solidity" + ], + "expandViewElement": { + "videoID": "g_t0Td4Kr6M", + "logo": "https://www.smartcontract.engineer/_next/image?url=%2Fninja-frog-min.png&w=640&q=75" + } + }, + { + "title": "Events", + "tagList": [ + "Solidity" + ], + "expandViewElement": { + "videoID": "nopo9KwwRg4", + "logo": "https://www.smartcontract.engineer/_next/image?url=%2Fninja-frog-min.png&w=640&q=75" + } + }, + { + "title": "Functions", + "tagList": [ + "Solidity" + ], + "expandViewElement": { + "videoID": "71cmPaD_AnQ", + "logo": "https://www.smartcontract.engineer/_next/image?url=%2Fninja-frog-min.png&w=640&q=75" + } + }, + { + "title": "Payable Functions", + "tagList": [ + "Solidity" + ], + "expandViewElement": { + "videoID": "yD9EL1QN40Q", + "logo": "https://www.smartcontract.engineer/_next/image?url=%2Fninja-frog-min.png&w=640&q=75" + } + }, + { + "title": "State Variables", + "tagList": [ + "Remix", + "Solidity" + ], + "expandViewElement": { + "videoID": "4XQsHBJScEk", + "logo": "https://www.smartcontract.engineer/_next/image?url=%2Fninja-frog-min.png&w=640&q=75" + } + }, + { + "title": "Gas & Gas Price", + "tagList": [ + "Solidity" + ], + "expandViewElement": { + "videoID": "oTS9uxU6cAM", + "logo": "https://www.smartcontract.engineer/_next/image?url=%2Fninja-frog-min.png&w=640&q=75" + } + } + ] + }, + { + "title": "Remix Techniques", + "hScrollable": "true", + "cells": [ + { + "title": "Proxy Contracts", + "tagList": [ + "Remix", + "Solidity" + ], + "expandViewElement": { + "videoID": "YJZV9uiDbJI", + "logo": "https://github.com/ethereum/remix-project/blob/master/apps/remix-ide/src/assets/img/icon.png" + } + }, + { + "title": "Compile & Run", + "tagList": [ + "Remix" + ], + "expandViewElement": { + "videoID": "ZR8sh7MRDQ4", + "logo": "https://github.com/ethereum/remix-project/blob/master/apps/remix-ide/src/assets/img/icon.png" + } + }, + { + "title": "Scripts", + "tagList": [ + "Remix" + ], + "expandViewElement": { + "videoID": "Eh1qgOurDxU", + "logo": "https://github.com/ethereum/remix-project/blob/master/apps/remix-ide/src/assets/img/icon.png" + } + }, + { + "title": "Txn Recorder", + "tagList": [ + "Remix" + ], + "expandViewElement": { + "videoID": "GchvmIRSxUo", + "logo": "https://github.com/ethereum/remix-project/blob/master/apps/remix-ide/src/assets/img/icon.png" + } + }, + { + "title": "Solidity Static Analyzers", + "tagList": [ + "Remix", + "Solidity" + ], + "expandViewElement": { + "videoID": "0frxvI-r5oU", + "logo": "https://github.com/ethereum/remix-project/blob/master/apps/remix-ide/src/assets/img/icon.png" + } + }, + { + "title": "Eth Doc Generator", + "tagList": [ + "Remix", + "Solidity" + ], + "expandViewElement": { + "videoID": "UkMqdI7TGxw", + "logo": "https://github.com/ethereum/remix-project/blob/master/apps/remix-ide/src/assets/img/icon.png" + } + } + ] + }, + { + "title": "Low Level Solidity Videos", + "hScrollable": "true", + "cells": [ + { + "title": "EVM Storage", + "tagList": [ + "EVM" + ], + "expandViewElement": { + "videoID": "vTeav5Rinco", + "logo": "https://www.smartcontract.engineer/_next/image?url=%2Fninja-frog-min.png&w=640&q=75" + } + }, + { + "title": "Transient Storage", + "tagList": [ + "EVM", + "Solidity" + ], + "expandViewElement": { + "videoID": "0-hiB5I39Mk", + "logo": "https://www.smartcontract.engineer/_next/image?url=%2Fninja-frog-min.png&w=640&q=75" + } + }, + { + "title": "Bit Masking", + "tagList": [ + "Solidity" + ], + "expandViewElement": { + "videoID": "luCjY2IQEuw", + "logo": "https://www.smartcontract.engineer/_next/image?url=%2Fninja-frog-min.png&w=640&q=75" + } + }, + { + "title": "Structs in Storage", + "tagList": [ + "EVM", + "Solidity" + ], + "expandViewElement": { + "videoID": "xWkOlxerVJw", + "logo": "https://www.smartcontract.engineer/_next/image?url=%2Fninja-frog-min.png&w=640&q=75" + } + }, + { + "title": "Arrays in Storage", + "tagList": [ + "EVM", + "Solidity" + ], + "expandViewElement": { + "videoID": "74vyHBD_L1E", + "logo": "https://www.smartcontract.engineer/_next/image?url=%2Fninja-frog-min.png&w=640&q=75" } } ] From bdb157d412334311abd5cdf8502a88c137f655ca Mon Sep 17 00:00:00 2001 From: lianahus Date: Thu, 15 Aug 2024 11:28:29 +0200 Subject: [PATCH 07/33] fixed thumbn.s --- apps/remix-ide/src/app/plugins/remixGuide.tsx | 7 ++++--- apps/remix-ide/src/app/plugins/remixGuideData.json | 8 ++++---- apps/remix-ide/src/remixAppManager.js | 2 +- libs/remix-ui/grid-view/src/lib/remix-ui-grid-cell.tsx | 8 +++++++- 4 files changed, 16 insertions(+), 9 deletions(-) diff --git a/apps/remix-ide/src/app/plugins/remixGuide.tsx b/apps/remix-ide/src/app/plugins/remixGuide.tsx index 852ebc50bf..3dcda2829a 100644 --- a/apps/remix-ide/src/app/plugins/remixGuide.tsx +++ b/apps/remix-ide/src/app/plugins/remixGuide.tsx @@ -7,6 +7,7 @@ import { RemixUIGridView } from '@remix-ui/remix-ui-grid-view' import { RemixUIGridSection } from '@remix-ui/remix-ui-grid-section' import { RemixUIGridCell } from '@remix-ui/remix-ui-grid-cell' import * as Data from './remixGuideData.json' +import './remixGuide.css' //@ts-ignore const _paq = (window._paq = window._paq || []) @@ -123,6 +124,7 @@ export class RemixGuidePlugin extends ViewPlugin { plugin={this} title={cell.title} tagList={cell.tagList} + classList='RGCellStyle' expandViewEl={ cell.expandViewElement } @@ -134,10 +136,9 @@ export class RemixGuidePlugin extends ViewPlugin { this.renderComponent() }} logo={cell.expandViewElement.logo} + logoURL={"https://www.youtube.com/@" + cell.authorURL} > - - - + })} diff --git a/apps/remix-ide/src/app/plugins/remixGuideData.json b/apps/remix-ide/src/app/plugins/remixGuideData.json index 5d22dd561e..2eacf913e1 100644 --- a/apps/remix-ide/src/app/plugins/remixGuideData.json +++ b/apps/remix-ide/src/app/plugins/remixGuideData.json @@ -5,7 +5,7 @@ "sections": [ { "title": "Remix Basics", - "hScrollable": "true", + "hScrollable": "false", "cells": [ { "title": "Intro to Remix", @@ -73,7 +73,7 @@ }, { "title": "Solidity Basics", - "hScrollable": "true", + "hScrollable": "false", "cells": [ { "title": "Hello World", @@ -140,7 +140,7 @@ }, { "title": "Remix Techniques", - "hScrollable": "true", + "hScrollable": "false", "cells": [ { "title": "Proxy Contracts", @@ -209,7 +209,7 @@ }, { "title": "Low Level Solidity Videos", - "hScrollable": "true", + "hScrollable": "false", "cells": [ { "title": "EVM Storage", diff --git a/apps/remix-ide/src/remixAppManager.js b/apps/remix-ide/src/remixAppManager.js index d2a4ecd46c..f3fffa42df 100644 --- a/apps/remix-ide/src/remixAppManager.js +++ b/apps/remix-ide/src/remixAppManager.js @@ -83,7 +83,7 @@ let requiredModules = [ 'dgit', 'pinnedPanel', 'pluginStateLogger', - 'remixGuide', + //'remixGuide', 'environmentExplorer', 'templateSelection', 'matomo', diff --git a/libs/remix-ui/grid-view/src/lib/remix-ui-grid-cell.tsx b/libs/remix-ui/grid-view/src/lib/remix-ui-grid-cell.tsx index 96deee2398..fb45c5a0da 100644 --- a/libs/remix-ui/grid-view/src/lib/remix-ui-grid-cell.tsx +++ b/libs/remix-ui/grid-view/src/lib/remix-ui-grid-cell.tsx @@ -17,6 +17,7 @@ interface RemixUIGridCellProps { pinStateCallback?: any logo?: string logos?: string[] + logoURL?: string title: string hideTitle?: boolean tagList?: string[] // max 8, others will be ignored @@ -77,7 +78,12 @@ export const RemixUIGridCell = (props: RemixUIGridCellProps) => {
{ !props.hideTitle &&
- { props.logo && } + { props.logo && props.logoURL !== '' ? + + + : + + } { props.logos && props.logos.map((logo) => )} { props.title && Date: Mon, 9 Sep 2024 16:05:27 +0200 Subject: [PATCH 08/33] adding css file --- apps/remix-ide/src/app/plugins/remixGuide.css | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 apps/remix-ide/src/app/plugins/remixGuide.css diff --git a/apps/remix-ide/src/app/plugins/remixGuide.css b/apps/remix-ide/src/app/plugins/remixGuide.css new file mode 100644 index 0000000000..83ed14c591 --- /dev/null +++ b/apps/remix-ide/src/app/plugins/remixGuide.css @@ -0,0 +1,6 @@ +.RGCellStyle { + min-height: 8.5rem; + max-width: 12rem; + min-width: 12rem; + max-height: 8.5rem; +} \ No newline at end of file From 7db293c2b6634dc68374de43c483491694f62386 Mon Sep 17 00:00:00 2001 From: lianahus Date: Tue, 24 Sep 2024 17:38:52 +0200 Subject: [PATCH 09/33] added tooltip for cell titles --- libs/remix-ui/grid-view/src/lib/remix-ui-grid-cell.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libs/remix-ui/grid-view/src/lib/remix-ui-grid-cell.tsx b/libs/remix-ui/grid-view/src/lib/remix-ui-grid-cell.tsx index fb45c5a0da..fa1f9830b6 100644 --- a/libs/remix-ui/grid-view/src/lib/remix-ui-grid-cell.tsx +++ b/libs/remix-ui/grid-view/src/lib/remix-ui-grid-cell.tsx @@ -19,6 +19,7 @@ interface RemixUIGridCellProps { logos?: string[] logoURL?: string title: string + titleTooltip: string hideTitle?: boolean tagList?: string[] // max 8, others will be ignored classList?: string @@ -89,7 +90,7 @@ export const RemixUIGridCell = (props: RemixUIGridCellProps) => {