-
-
Notifications
You must be signed in to change notification settings - Fork 34
Expand file tree
/
Copy pathfrom-static-widget-tree.ts
More file actions
30 lines (29 loc) · 880 Bytes
/
from-static-widget-tree.ts
File metadata and controls
30 lines (29 loc) · 880 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import { JsxWidget } from "@web-builder/core";
import { ReactComponentExportResult } from "@web-builder/react-core";
import {
reactnative as rn_config,
react as react_config,
} from "@grida/builder-config";
import { ReactNativeStyledComponentsModuleBuilder } from "./rn-styled-components-module-builder";
/**
* standard `StyleSheet.create` pattern for react-native
* @todo - this is not fully implemented
* @param entry
* @returns
*/
export function finalizeReactNativeWidget_StyledComponents(
entry: JsxWidget,
{
styling,
exporting,
}: {
styling: rn_config.ReactNativeStyledComponentsConfig;
exporting: react_config.ReactComponentExportingCofnig;
}
): ReactComponentExportResult {
const builder = new ReactNativeStyledComponentsModuleBuilder({
entry,
config: styling,
});
return builder.asExportableModule().finalize(exporting);
}