Skip to content

Commit

Permalink
[minor changes] Trims jsx text childrens of visual ui elements
Browse files Browse the repository at this point in the history
  • Loading branch information
mikecmart committed Jul 5, 2024
1 parent b7d2c1e commit ecf12c5
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 18 deletions.
34 changes: 17 additions & 17 deletions packages/app/bundles/custom/pages/home.tsx
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
import React, { useState } from "react";
import { Theme } from "@my/ui";
import {Page} from 'protolib/components/Page'
import {Text} from 'protolib/components/Text'
import {Pressable} from 'protolib/components/Pressable'
import {Icon} from 'protolib/components/Icon'
import VStack from 'protolib/components/VStack'
import HStack from 'protolib/components/HStack'
import Image from 'protolib/components/Image'
import {useComposedState} from 'protolib/lib/useComposedState'
import {withSession } from "protolib/lib/Session"
import {useEditor} from 'protolib/visualui/useEdit'
import {SSR} from 'protolib/lib/SSR'
import {UIWrapLib, UIWrap} from 'protolib/visualui/visualuiWrapper'
import { Page } from "protolib/components/Page";
import { Text } from "protolib/components/Text";
import { Pressable } from "protolib/components/Pressable";
import { Icon } from "protolib/components/Icon";
import VStack from "protolib/components/VStack";
import HStack from "protolib/components/HStack";
import Image from "protolib/components/Image";
import { useComposedState } from "protolib/lib/useComposedState";
import { withSession } from "protolib/lib/Session";
import { useEditor } from "protolib/visualui/useEdit";
import { SSR } from "protolib/lib/SSR";
import { UIWrapLib, UIWrap } from "protolib/visualui/visualuiWrapper";
import { DefaultLayout } from "../../../layout/DefaultLayout";
import { Protofy } from "protolib/base";
import { context } from "app/bundles/uiContext";
import { useRouter } from 'solito/navigation';
import { useRouter } from "solito/navigation";
import { Objects } from "app/bundles/objects";

const isProtected = Protofy("protected", false);
Expand All @@ -24,7 +24,7 @@ const Home = ({ currentView, setCurrentView, props }: any) => {
const { cs, states } = useComposedState();

const router = useRouter();
context.onRender(async () => { });
context.onRender(async () => {});
return (
<Page height="99vh">
<DefaultLayout footer={<></>}>
Expand Down Expand Up @@ -73,7 +73,7 @@ const Home = ({ currentView, setCurrentView, props }: any) => {
);
};

const cw = UIWrapLib('@my/ui')
const cw = UIWrapLib("@my/ui");

export default {
route: Protofy("route", "/"),
Expand All @@ -84,12 +84,12 @@ export default {
path: "/packages/app/bundles/custom/pages/home.tsx",
components: {
...UIWrap("DefaultLayout", DefaultLayout, "../../../layout/DefaultLayout"),
...cw("Theme", Theme)
...cw("Theme", Theme),
},
context: {
currentView: currentView,
setCurrentView: setCurrentView,
Objects: Objects
Objects: Objects,
},
});
},
Expand Down
2 changes: 1 addition & 1 deletion packages/visualui/src/models/Source.ts
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ export class Source {
// GET JsxText Children
const jsxText = this.getJsxTextOfJsxElement(node)
if (jsxText && jsxText.getText()) {
props = { ...props, "children": jsxText.getText() }
props = { ...props, "children": jsxText.getText()?.trim() }
custom = { ...custom, "children": "StringLiteral" }
}

Expand Down

0 comments on commit ecf12c5

Please sign in to comment.