Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: default style on react app #475

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions apps/starter/src/ensemble/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,6 @@ import ThemeYAML from "./theme.yaml";
export const starterApp: ApplicationDTO = {
id: "myStarterApp",
name: "My App",
theme: {
id: "theme",
content: String(ThemeYAML),
},
config: ConfigYAML,
scripts: [
{
Expand Down
7 changes: 5 additions & 2 deletions apps/starter/src/ensemble/screens/home.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,19 @@ View:
Column:
styles:
names: page
padding: 10px
children:
- Text:
styles:
names: heading-1
fontSize: 24px
fontWeight: 800
text: Hello, world!
- Markdown:
text: This screen demonstrates a few patterns to get you started with Ensemble. Here, we fetch data from an API and use control expressions to display a loading state and a list of products. Try making a few changes and see how the screen automatically updates! For more information, see [help](/help).
- Text:
styles:
names: heading-3
fontSize: 24px
fontWeight: 800
text: My Products
- LoadingContainer:
isLoading: ${getDummyProducts.isLoading}
Expand Down
12 changes: 9 additions & 3 deletions apps/starter/src/ensemble/screens/menu.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ ViewGroup:
width: 240px
iconWidth: 20px
iconHeight: 20px
backgroundColor: '#f7fbfa'
backgroundColor: "#f7fbfa"
labelColor: "#171B2A"
selectedColor: "#171B2A"
labelFontSize: 1
Expand All @@ -14,6 +14,7 @@ ViewGroup:
header:
Image:
height: 50px
width: 100%
source: https://docs.ensembleui.com/images/logo.svg
items:
- label: Home
Expand All @@ -24,5 +25,10 @@ ViewGroup:
icon: HelpOutlineOutlined
page: help
footer:
Text:
text: Give us feedback
Row:
styles:
padding: 10px
justifyContent: center
children:
- Text:
text: Give us feedback
2 changes: 1 addition & 1 deletion packages/runtime/src/runtime/entry.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export const EnsembleEntry: React.FC<EnsembleEntryProps> = ({
/>
<div
style={{
flexGrow: 1,
flex: 1,
height: "100vh",
display: "flex",
flexDirection: "column",
Expand Down
20 changes: 3 additions & 17 deletions packages/runtime/src/runtime/menu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -170,24 +170,10 @@ export const SideBarMenu: React.FC<MenuBaseProps> = ({ id, ...props }) => {
: (values?.styles?.labelColor as string) ?? "grey",
display: "flex",
justifyContent: "center",
borderRadius: 0,
alignItems: "center",
fontSize:
selectedItem === item.label
? `${
parseInt(
`${
props.styles?.labelFontSize
? props.styles.labelFontSize
: 1
}` || "1",
) + 0.2
}rem`
: `${
props.styles?.labelFontSize
? props.styles.labelFontSize
: 1
}rem`,
fontSize: `${
props.styles?.labelFontSize ? props.styles.labelFontSize : 1
}rem`,
...(selectedItem === item.label
? props.styles?.onSelectStyles ?? {}
: {}),
Expand Down
Loading