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

Improve components structure #52

Open
irwinschmitt opened this issue Sep 2, 2021 · 1 comment
Open

Improve components structure #52

irwinschmitt opened this issue Sep 2, 2021 · 1 comment
Labels
enhancement New feature or request

Comments

@irwinschmitt
Copy link
Collaborator

Is your feature request related to a problem? Please describe.
Several components are not following the standard structure.

Describe the solution you'd like
A component should have the following structure:

  • /ComponentName
    • /index.jsx
    • /styles.js

All frequently used properties in a component must be added to a new component created from styled-components:

index.jsx

import { StyledGridContainer, StyledGridItem, StyledGridItemContainer } from "./styles";

// ...

<StyledGridContainer />
<StyledGridItem />
<StyledGridItemContainer />

styles.js

import styled from "styled-components";
import MuiGrid from '@material-ui/core/Grid';

// ...

export const StyledGridContainer = styled(MuiGrid).attrs(() => ({
  grid: true,
}))`
  border-radius: 5px;
  // ...
`

export const StyledGridItem = styled(MuiGrid).attrs(() => ({
  item: true,
}))`
  // ...
`

export const StyledGridItemContainer = styled(MuiGrid).attrs(() => ({
  grid: true,
  item: true,
}))`
  // ...
`

Describe alternatives you've considered
We will be happy with any suggestions for improvement you give us.

@mansogf mansogf added the enhancement New feature or request label Sep 3, 2021
@aquiles23
Copy link
Contributor

aquiles23 commented Oct 4, 2021

I will make that for the circuit component. I saw that all circles have r=4 attribute and all rect have a rx=4 attribute, i can simplify them with a styles.js file. The other values doesn't have a pattern so i will not touch them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants