No contract compiled yet.
-No contract compiled yet.
+{output.message}+
+ {output.message} +
WalletConnect
- { ethereumClient && wagmiConfig &&WalletConnect
+ {ethereumClient && wagmiConfig && ( +An Opt-in version of Matomo, an open source data analytics platform is being used to improve Remix IDE.
-We realize that our users have sensitive information in their code and that their privacy - your privacy - must be protected.
-All data collected through Matomo is stored on our own server - no data is ever given to third parties. Our analytics reports are public: take a look.
-We do not collect nor store any personally identifiable information (PII).
-For more info, see: Matomo Analyitcs on Remix iDE.
-You can change your choice in the Settings panel anytime.
>) + return ( + <> ++ An Opt-in version of{' '} + + Matomo + + , an open source data analytics platform is being used to improve + Remix IDE. +
++ We realize that our users have sensitive information in their code and + that their privacy - your privacy - must be protected. +
++ All data collected through Matomo is stored on our own server - no + data is ever given to third parties. Our analytics reports are public:{' '} + + take a look + + . +
++ We do not collect nor store any personally identifiable information + (PII). +
++ For more info, see:{' '} + + Matomo Analyitcs on Remix iDE + + . +
+You can change your choice in the Settings panel anytime.
+ > + ) } useEffect(() => { if (visible && showMatamo) { - modal({ id: 'matomoModal', title: 'Help us to improve Remix IDE', message: message(), okLabel: 'Accept', okFn: handleModalOkClick, cancelLabel: 'Decline', cancelFn: declineModal }) + modal({ + id: 'matomoModal', + title: 'Help us to improve Remix IDE', + message: message(), + okLabel: 'Accept', + okFn: handleModalOkClick, + cancelLabel: 'Decline', + cancelFn: declineModal + }) } }, [visible]) @@ -38,13 +84,14 @@ const MatomoDialog = (props) => { const handleModalOkClick = async () => { _paq.push(['forgetUserOptOut']) // @TODO remove next line when https://github.com/matomo-org/matomo/commit/9e10a150585522ca30ecdd275007a882a70c6df5 is used - document.cookie = 'mtm_consent_removed=; expires=Thu, 01 Jan 1970 00:00:01 GMT;' + document.cookie = + 'mtm_consent_removed=; expires=Thu, 01 Jan 1970 00:00:01 GMT;' settings.updateMatomoAnalyticsChoice(true) appManager.call('walkthrough', 'start') setVisible(false) } - return (<>>) + return <>> } export default MatomoDialog 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 38c8d8579e..69e0901c30 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 @@ -1,6 +1,10 @@ -import React, { useEffect, useRef, useState } from 'react' -import { ModalDialog, ModalDialogProps, ValidationResult } from '@remix-ui/modal-dialog' -import { ModalTypes } from '../../types' +import React, {useEffect, useRef, useState} from 'react' +import { + ModalDialog, + ModalDialogProps, + ValidationResult +} from '@remix-ui/modal-dialog' +import {ModalTypes} from '../../types' interface ModalWrapperProps extends ModalDialogProps { modalType?: ModalTypes @@ -28,36 +32,54 @@ const ModalWrapper = (props: ModalWrapperProps) => { if (ref.current === undefined && formRef.current === undefined) { onOkFn() } else if (formRef.current) { - (props.okFn) ? props.okFn(getFormData()) : props.resolve(getFormData()) - } else if(ref.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) + props.okFn + ? props.okFn(ref.current.value) + : props.resolve(ref.current.value) } } const onOkFn = async () => { - (props.okFn) ? props.okFn(data.current) : props.resolve(data.current || true) + props.okFn ? props.okFn(data.current) : props.resolve(data.current || true) } const onCancelFn = async () => { - (props.cancelFn) ? props.cancelFn() : props.resolve(false) + props.cancelFn ? props.cancelFn() : props.resolve(false) } const onInputChanged = (event) => { if (props.validationFn) { const validation = props.validationFn(event.target.value) - setState(prevState => { - return { ...prevState, message: createModalMessage(props.defaultValue, validation), validation } + setState((prevState) => { + return { + ...prevState, + message: createModalMessage(props.defaultValue, validation), + validation + } }) } } - const createModalMessage = (defaultValue: string, validation: ValidationResult) => { + const createModalMessage = ( + defaultValue: string, + validation: ValidationResult + ) => { return ( <> {props.message} - - {validation && !validation.valid && {validation.message}} + + {validation && !validation.valid && ( + {validation.message} + )} > ) } @@ -65,8 +87,8 @@ const ModalWrapper = (props: ModalWrapperProps) => { const onFormChanged = () => { if (props.validationFn) { const validation = props.validationFn(getFormData()) - setState(prevState => { - return { ...prevState, message: createForm(validation), validation } + setState((prevState) => { + return {...prevState, message: createForm(validation), validation} }) } } @@ -77,7 +99,9 @@ const ModalWrapper = (props: ModalWrapperProps) => {