Closed saqsun closed 6 years ago
To have separate components for similar emitter configs.
Duplicate code for too similar emitter configs.
Instead of this code:
<ExpansionPanel> <ExpansionPanelSummary expandIcon={<ExpandMoreIcon />}> <Typography>Acceleration</Typography> </ExpansionPanelSummary> <ExpansionPanelDetails> <Grid container spacing={40}> <Grid item xs={6}> <FormLabel component="legend">X</FormLabel> <CompositeProperty configName="accelerationX" /> </Grid> <Grid item xs={6}> <FormLabel component="legend">Y</FormLabel> <CompositeProperty configName="accelerationY" /> </Grid> </Grid> </ExpansionPanelDetails> </ExpansionPanel>
<ExpansionPanel> <ExpansionPanelSummary expandIcon={<ExpandMoreIcon />}> <Typography>Max Velocity</Typography> </ExpansionPanelSummary> <ExpansionPanelDetails> <Grid container spacing={40}> <Grid item xs={6}> <FormLabel component="legend">X</FormLabel> <CompositeProperty configName="maxVelocityX" /> </Grid> <Grid item xs={6}> <FormLabel component="legend">Y</FormLabel> <CompositeProperty configName="maxVelocityY" /> </Grid> </Grid> </ExpansionPanelDetails> </ExpansionPanel>
have this:
<ExpansionPanelXY composite typography="Acceleration" configNameX="accelerationX" configNameY="accelerationY" />
<ExpansionPanelXY composite typography="Max Velocity" configNameX="maxVelocityX" configNameY="maxVelocityY" />
To make code more clear and reusable.
Expected Behavior
To have separate components for similar emitter configs.
Current Behavior
Duplicate code for too similar emitter configs.
Possible Solution
Instead of this code:
have this:
Context
To make code more clear and reusable.