-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add AppSrcIndexer to be used when ejectStatefulComponents is true
- Loading branch information
Showing
6 changed files
with
76 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
18.0.0 | ||
18.17.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
/** | ||
* This file uses Widget's src to get the App Widget. | ||
* | ||
* It's used when the alem config "ejectStatefulComponents" is true | ||
*/ | ||
const AlemApp = useMemo(() => { | ||
if (!props.alem.ready) { | ||
return ""; | ||
} | ||
|
||
const widgetLayer2code = ` | ||
const props = { | ||
...props, | ||
// ==================================== Modules Code ==================================== | ||
alem: { | ||
...props.alem, | ||
// m = modulesCode, está sendo usado "m" para reduzir o bundle final | ||
m: { | ||
MODULES_CODE: {}, | ||
}, | ||
} | ||
}; | ||
return ( | ||
<Widget loading=" " src={"APP_INDEXER_WIDGET_SRC"} props={props} /> | ||
) | ||
`; | ||
|
||
// staging.potlock.near/widget/potlock.ConfigForm | ||
|
||
return ( | ||
<AlemTheme> | ||
<Widget | ||
loading=" " | ||
code={widgetLayer2code} | ||
props={{ alem: props.alem }} | ||
/> | ||
</AlemTheme> | ||
); | ||
}, [props.alem.ready, props.alem.alemExternalStylesBody, props.alem.rootProps]); | ||
|
||
return AlemApp; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters