fix display order

pull/5370/head
yann300 12 months ago
parent a19e0026b9
commit 5a396f19e8
  1. 8
      apps/remix-ide/src/app.js
  2. 15
      apps/remix-ide/src/walkthroughService.js
  3. 12
      libs/remix-ui/app/src/lib/remix-app/components/modals/enter.tsx
  4. 18
      libs/remix-ui/app/src/lib/remix-app/remix-app.tsx

@ -130,10 +130,12 @@ class AppComponent {
'remix.ethereum.org': 23,
'6fd22d6fe5549ad4c4d8fd3ca0b7816b.mod': 35 // remix desktop
}
this.showMatamo = true /*matomoDomains[window.location.hostname]*/ && !Registry.getInstance().get('config').api.exists('settings/matomo-analytics')
this.showEnter = !this.showMatamo && !localStorage.getItem('hadUsageTypeAsked')
this.walkthroughService = new WalkthroughService(appManager, !this.showMatamo || !this.showEnter)
this.matomoConfAlreadySet = Registry.getInstance().get('config').api.exists('settings/matomo-analytics')
this.matomoCurrentSetting = Registry.getInstance().get('config').api.get('settings/matomo-analytics')
this.showMatamo = matomoDomains[window.location.hostname] && !this.matomoConfAlreadySet
this.walkthroughService = new WalkthroughService(appManager)
const hosts = ['127.0.0.1:8080', '192.168.0.101:8080', 'localhost:8080']
// workaround for Electron support

@ -11,21 +11,8 @@ const profile = {
}
export class WalkthroughService extends Plugin {
constructor (appManager, showWalkthrough) {
constructor (appManager) {
super(profile)
/*let readyToStart = 0;
appManager.event.on('activate', (plugin) => {
if (plugin.name === 'udapp') readyToStart++
if (readyToStart == 2 && showWalkthrough) {
this.start()
}
})
appManager.event.on('activate', (plugin) => {
if (plugin.name === 'solidity') readyToStart++
if (readyToStart == 2 && showWalkthrough) {
this.start()
}
})*/
}
startRecorderW () {

@ -4,25 +4,17 @@ import {UsageTypes} from '../../types'
import { type } from 'os'
interface EnterDialogProps {
show: boolean,
handleUserChoice: (userChoice: UsageTypes) => void,
}
const EnterDialog = (props: EnterDialogProps) => {
const [visibility, setVisibility] = useState<boolean>(false)
const {showEnter} = useContext(AppContext)
useEffect(() => {
setVisibility(props.show)
console.log("useeff vis in enter", props.show, " showEnter ", showEnter)
}, [props.show])
const [visibility, setVisibility] = useState<boolean>(true)
const enterAs = async (uType) => {
props.handleUserChoice(uType)
}
const modalClass = (visibility && showEnter) ? "d-flex" : "d-none"
console.log("enterDialog class ", modalClass)
const modalClass = visibility ? "d-flex" : "d-none"
return (
<div
data-id={`EnterModalDialogContainer-react`}

@ -48,7 +48,18 @@ const RemixApp = (props: IRemixAppUi) => {
activateApp()
}
const hadUsageTypeAsked = localStorage.getItem('hadUsageTypeAsked')
setShowEnterDialog(!hadUsageTypeAsked)
if (props.app.showMatamo) {
// if matomo dialog is displayed, it will take care of calling "setShowEnterDialog",
// if the user approves matomo tracking.
// so "showEnterDialog" stays false
} else {
// if matomo dialog isn't displayed, we show the "enter dialog" only if:
// - it wasn't already set
// - (and) if user has given consent
if (!hadUsageTypeAsked && props.app.matomoCurrentSetting) {
setShowEnterDialog(true)
}
}
}, [])
function setListeners() {
@ -87,7 +98,6 @@ const RemixApp = (props: IRemixAppUi) => {
const value = {
settings: props.app.settings,
showMatamo: props.app.showMatamo,
showEnter: props.app.showEnter,
appManager: props.app.appManager,
modal: props.app.notification,
layout: props.app.layout
@ -135,8 +145,8 @@ const RemixApp = (props: IRemixAppUi) => {
<IntlProvider locale={locale.code} messages={locale.messages}>
<AppProvider value={value}>
<OriginWarning></OriginWarning>
<MatomoDialog hide={!appReady} okFn={() => {console.log("ok"); setShowEnterDialog(true)}}></MatomoDialog>
<EnterDialog show={showEnterDialog} handleUserChoice={(type) => handleUserChosenType(type)}></EnterDialog>
<MatomoDialog hide={!appReady} okFn={() => setShowEnterDialog(true)}></MatomoDialog>
{showEnterDialog && <EnterDialog handleUserChoice={(type) => handleUserChosenType(type)}></EnterDialog>}
<div className={`remixIDE ${appReady ? '' : 'd-none'}`} data-id="remixIDE">
<div id="icon-panel" data-id="remixIdeIconPanel" className="custom_icon_panel iconpanel bg-light">
{props.app.menuicons.render()}

Loading…
Cancel
Save