diff --git a/apps/remix-ide/src/app/plugins/contractFlattener.tsx b/apps/remix-ide/src/app/plugins/contractFlattener.tsx index 4433ffcf23..71c3a4a1c1 100644 --- a/apps/remix-ide/src/app/plugins/contractFlattener.tsx +++ b/apps/remix-ide/src/app/plugins/contractFlattener.tsx @@ -26,7 +26,7 @@ export class ContractFlattener extends Plugin { async flattenAContract(action: customAction) { this.fileName = action.path[0] - this.call('solidity', 'compile', this.fileName) + await this.call('solidity', 'compile', this.fileName) } /** @@ -39,8 +39,8 @@ export class ContractFlattener extends Plugin { const ast = data.sources const dependencyGraph = getDependencyGraph(ast, filePath) const sorted = dependencyGraph.isEmpty() - ? [filePath] - : dependencyGraph.sort().reverse() + ? [filePath] + : dependencyGraph.sort().reverse() const sources = source.sources const result = concatSourceFiles(sorted, sources) await this.call('fileManager', 'writeFile', `${filePath}_flattened.sol`, result) diff --git a/apps/remix-ide/src/app/plugins/remixd-handle.tsx b/apps/remix-ide/src/app/plugins/remixd-handle.tsx index 7f5b1e8f5e..a39c52c3d3 100644 --- a/apps/remix-ide/src/app/plugins/remixd-handle.tsx +++ b/apps/remix-ide/src/app/plugins/remixd-handle.tsx @@ -115,7 +115,7 @@ export class RemixdHandle extends WebsocketPlugin { // warn the user only if he/she is in the browser context const mod: AppModal = { id: 'remixdConnect', - title: 'Connect to localhost', + title: 'Access file system using remixd', message: remixdDialog(), okLabel: 'Connect', cancelLabel: 'Cancel', diff --git a/apps/remix-ide/src/app/tabs/locales/en/home.json b/apps/remix-ide/src/app/tabs/locales/en/home.json index 3f32d49043..c5fd63d9ab 100644 --- a/apps/remix-ide/src/app/tabs/locales/en/home.json +++ b/apps/remix-ide/src/app/tabs/locales/en/home.json @@ -55,7 +55,7 @@ "home.files": "Files", "home.newFile": "New File", "home.openFile": "Open File", - "home.connectToLocalhost": "Connect to Localhost", - "home.loadFrom": "LOAD FROM", + "home.connectToLocalhost": "Access File System", + "home.loadFrom": "Load from", "home.resources": "Resources" } diff --git a/apps/remix-ide/src/remixEngine.js b/apps/remix-ide/src/remixEngine.js index 9d34b58bf5..64fd918227 100644 --- a/apps/remix-ide/src/remixEngine.js +++ b/apps/remix-ide/src/remixEngine.js @@ -15,7 +15,7 @@ export class RemixEngine extends Engine { if (name === 'hardhat') return { queueTimeout: 60000 * 4 } if (name === 'truffle') return { queueTimeout: 60000 * 4 } if (name === 'localPlugin') return { queueTimeout: 60000 * 4 } - if (name === 'notification') return { queueTimeout: 60000 * 4 } + if (name === 'notification') return { queueTimeout: 60000 * 10 } if (name === 'sourcify') return { queueTimeout: 60000 * 4 } if (name === 'fetchAndCompile') return { queueTimeout: 60000 * 4 } if (name === 'walletconnect') return { queueTimeout: 60000 * 4 } diff --git a/libs/remix-ui/app/src/lib/remix-app/components/modals/modal-wrapper.tsx b/libs/remix-ui/app/src/lib/remix-app/components/modals/modal-wrapper.tsx index 17c6f604d6..450d59f1de 100644 --- a/libs/remix-ui/app/src/lib/remix-app/components/modals/modal-wrapper.tsx +++ b/libs/remix-ui/app/src/lib/remix-app/components/modals/modal-wrapper.tsx @@ -3,19 +3,33 @@ import { ModalDialog, ModalDialogProps, ValidationResult } from '@remix-ui/modal import { ModalTypes } from '../../types' interface ModalWrapperProps extends ModalDialogProps { - modalType?: ModalTypes - defaultValue?: string + modalType?: ModalTypes + defaultValue?: string } const ModalWrapper = (props: ModalWrapperProps) => { const [state, setState] = useState() const ref = useRef() + const formRef = useRef() const data = useRef() + const getFormData = () => { + if (formRef.current) { + const formData = new FormData(formRef.current) + const data = {} + for (const pair of formData.entries()) { + data[pair[0]] = pair[1] + } + return data + } + } + const onFinishPrompt = async () => { - if (ref.current === undefined) { + if (ref.current === undefined && formRef.current === undefined) { onOkFn() - } else { + } else if (formRef.current) { + (props.okFn) ? props.okFn(getFormData()) : props.resolve(getFormData()) + } else if(ref.current) { // @ts-ignore: Object is possibly 'null'. (props.okFn) ? props.okFn(ref.current.value) : props.resolve(ref.current.value) } @@ -43,9 +57,29 @@ const ModalWrapper = (props: ModalWrapperProps) => { <> {props.message} - {!validation.valid && {validation.message}} - - ) + {validation && !validation.valid && {validation.message}} + + ) + } + + const onFormChanged = () => { + if (props.validationFn) { + const validation = props.validationFn(getFormData()) + setState(prevState => { + return { ...prevState, message: createForm(validation), validation } + }) + } + } + + const createForm = (validation: ValidationResult) => { + return ( + <> +
+ {props.message} +
+ {validation && !validation.valid && {validation.message}} + + ) } useEffect(() => { @@ -61,6 +95,14 @@ const ModalWrapper = (props: ModalWrapperProps) => { message: createModalMessage(props.defaultValue, { valid: true }) }) break + case ModalTypes.form: + setState({ + ...props, + okFn: onFinishPrompt, + cancelFn: onCancelFn, + message: createForm({ valid: true }) + }) + break default: setState({ ...props, diff --git a/libs/remix-ui/app/src/lib/remix-app/types/index.ts b/libs/remix-ui/app/src/lib/remix-app/types/index.ts index edca9e147c..6822dbe73e 100644 --- a/libs/remix-ui/app/src/lib/remix-app/types/index.ts +++ b/libs/remix-ui/app/src/lib/remix-app/types/index.ts @@ -4,4 +4,5 @@ export const enum ModalTypes { prompt = 'prompt', password = 'password', default = 'default', + form = 'form', } diff --git a/libs/remix-ui/home-tab/src/lib/components/homeTabFeatured.tsx b/libs/remix-ui/home-tab/src/lib/components/homeTabFeatured.tsx index f2ea97fe57..c8de93004e 100644 --- a/libs/remix-ui/home-tab/src/lib/components/homeTabFeatured.tsx +++ b/libs/remix-ui/home-tab/src/lib/components/homeTabFeatured.tsx @@ -37,50 +37,56 @@ function HomeTabFeatured() { dotListClass="position-relative mt-2" >
- -
+ + + +
- -
+
_paq.push(['trackEvent', 'hometab', 'featuredSection', 'jumpIntoWeb3'])} target="__blank" - href="https://remix-project.org"> + href="https://remix-project.org" + > + +
- + -
+
-

-
+

+
_paq.push(['trackEvent', 'hometab', 'featuredSection', 'youTubeMore'])} target="__blank" - href="https://www.youtube.com/@EthereumRemix/videos"> + href="https://www.youtube.com/@EthereumRemix/videos" + > + +
- -
+ + + +
diff --git a/libs/remix-ui/home-tab/src/lib/components/homeTabFile.tsx b/libs/remix-ui/home-tab/src/lib/components/homeTabFile.tsx index 50ec5bf8fa..df6b89dd79 100644 --- a/libs/remix-ui/home-tab/src/lib/components/homeTabFile.tsx +++ b/libs/remix-ui/home-tab/src/lib/components/homeTabFile.tsx @@ -4,6 +4,7 @@ import { FormattedMessage } from 'react-intl' import { ModalDialog } from '@remix-ui/modal-dialog' // eslint-disable-line import { Toaster } from '@remix-ui/toaster' // eslint-disable-line const _paq = window._paq = window._paq || [] // eslint-disable-line +import { CustomTooltip } from '@remix-ui/helper'; interface HomeTabFileProps { plugin: any @@ -153,17 +154,27 @@ function HomeTabFile ({plugin}: HomeTabFileProps) {
-
- - - - { - event.stopPropagation() - plugin.verticalIcons.select('filePanel') - uploadFile(event.target) - }} multiple /> - - +
+ +
+ + + { + event.stopPropagation() + plugin.verticalIcons.select('filePanel') + uploadFile(event.target) + }} multiple /> + + + +
+
+ +
{(state.visibleTutorial === VisibleTutorial.Basics) &&
- + + +
} {(state.visibleTutorial === VisibleTutorial.Advanced) &&
- - + + + + +
}
diff --git a/libs/remix-ui/home-tab/src/lib/components/homeTabScamAlert.tsx b/libs/remix-ui/home-tab/src/lib/components/homeTabScamAlert.tsx index 790a3bc843..82e16305bd 100644 --- a/libs/remix-ui/home-tab/src/lib/components/homeTabScamAlert.tsx +++ b/libs/remix-ui/home-tab/src/lib/components/homeTabScamAlert.tsx @@ -8,27 +8,28 @@ function HomeTabScamAlert () { return (
- ) diff --git a/libs/remix-ui/home-tab/src/lib/components/homeTabTitle.tsx b/libs/remix-ui/home-tab/src/lib/components/homeTabTitle.tsx index b09242c7e5..ef3fe4b4df 100644 --- a/libs/remix-ui/home-tab/src/lib/components/homeTabTitle.tsx +++ b/libs/remix-ui/home-tab/src/lib/components/homeTabTitle.tsx @@ -52,19 +52,22 @@ function HomeTabTitle() { return (
-
-
playRemi()} style={{ filter: themeFilter.filter}} > - -
- -
-
+ +
+
Remix +
+
playRemi()} > + +
+ +
+
+ className="border-0 p-2 h-100 pl-2 btn fab fa-twitter"> @@ -110,7 +113,7 @@ function HomeTabTitle() { openLink("https://www.linkedin.com/company/ethereum-remix/") _paq.push(['trackEvent', 'hometab', 'socialmedia', 'linkedin']) }} - className="border-0 h-100 pl-2 btn fa fa-linkedin"> + className="border-0 p-2 h-100 pl-2 btn fa fa-linkedin"> @@ -126,7 +129,7 @@ function HomeTabTitle() { openLink("https://medium.com/remix-ide") _paq.push(['trackEvent', 'hometab', 'socialmedia', 'medium']) }} - className="border-0 h-100 pl-2 btn fab fa-medium"> + className="border-0 p-2 h-100 pl-2 btn fab fa-medium"> @@ -142,12 +145,12 @@ function HomeTabTitle() { openLink("https://gitter.im/ethereum/remix") _paq.push(['trackEvent', 'hometab', 'socialmedia', 'gitter']) }} - className="border-0 h-100 pl-2 btn fab fa-gitter"> + className="border-0 h-100 p-2 btn fab fa-gitter">
- +