feat: dynamic preview per component type; cleanup field configs#26
Open
lakshitha25 wants to merge 3 commits intoDevelopmentfrom
Open
feat: dynamic preview per component type; cleanup field configs#26lakshitha25 wants to merge 3 commits intoDevelopmentfrom
lakshitha25 wants to merge 3 commits intoDevelopmentfrom
Conversation
pnpm-lock.yaml
Outdated
Collaborator
There was a problem hiding this comment.
Please Remove this file
| setConfig((prev) => ({ ...prev, muiProps: newMuiProps })); | ||
| }; | ||
|
|
||
| const validateInput = (value: string) => { |
Collaborator
There was a problem hiding this comment.
We don't need extra methods to validate the preview use
FFB for the preview. Remove all the extra items.
| boxSizing: "border-box", | ||
| }; | ||
|
|
||
| interface MUIPropsComponentProps { |
Collaborator
There was a problem hiding this comment.
Include this in the "types" folder under "json-generator"
| let textProps: string[] = []; | ||
| let showInputProps: string[] = []; | ||
|
|
||
| if (componentType === "multiline") { |
Collaborator
There was a problem hiding this comment.
Please use a switch case here
| let showInputProps: string[] = []; | ||
|
|
||
| if (componentType === "multiline") { | ||
| booleanProps = ["disabled", "error", "fullWidth", "autoFocus"]; |
Collaborator
There was a problem hiding this comment.
for all these
["disabled", "error", "fullWidth", "autoFocus"];
Maintain a constant and list them all, and render in a switch case
codewithshinde
requested changes
Sep 23, 2025
| </div> | ||
| <div style={{ flex: 1, paddingLeft: 16 }}> | ||
| <h3>Live Preview</h3> | ||
| {renderPreview()} |
Collaborator
There was a problem hiding this comment.
Use FFB (FormRenderer) component to preview here
| export const variantOptions = ["outlined", "filled", "standard"]; | ||
| export const colorOptions = ["primary", "secondary", "success", "error", "info", "warning"]; | ||
|
|
||
| export const colorMap: Record<string, string> = { |
Collaborator
There was a problem hiding this comment.
Move this to constants
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The preview panel is now dynamic per component type, ensuring that when a new component is selected from the dropdown, its configuration and preview are reset properly without carrying over previous props.