We proudly present to you Glints Aries made by Front End Engineers of Glints. It is a Frontend framework to simplify and speed up your development. This project rebuilt with React and Styled Components. We are still actively develop this project day by day. So there are still a ton of amazing components to be built.
npm install -S glints-aries
Import the component into your file.
import { ... } from 'glints-aries'
Before you start implementing the component, it's always a good start to always wrap your root component with . We created that Container to adapt with every screen sizes, so Users will always have best experience whenever they visit your site from their devices. GlintsContainer also consists global style of glints-aries, so that it becomes a complement to the components. For more details, you can read this at Utilities, then GlintsContainer section.
import { GlintsContainer } from 'glints-aries'
<GlintsContainer>
<Component />
</GlintsContainer>
yarn storybook
then open your browser on port 9001
- Open terminal in
glints-aries
. - Run
yarn link
. - Open terminal in your project.
- Run
yarn link glints-aries
. - Run
yarn build
inglints-aries
when finish changes and want to test locally in your project.
Run yarn unlink glints-aries
and re-install glints-aries
when you want to stop using local glints-aries
- Always do alphabetically when importing file.
- Put file on proper folder based on each respective uses.
- Use 2 Indent Spaces and Tab on the code.
- Follow this import structure for your code
- First: always import React library at first.
- Second: third-party.
- Third: glints-aries component.
- Fourth: glints-aries utilities.
- Fifth: styling.
import React from 'react'; // React
import classNames from 'classnames'; // Third-party
import PropTypes from 'prop-types'; // Third-party
import Modal from '../../Display/Modal'; // Glints Aries component
import { escEvent } from '../../Utils/DomUtils'; // Glints Aries utilities
import { Container, ModalBackground, ModalArea } from '../../Style/ModalStyle'; // Styling
Always give line break between different section when importing.
- Follow this code structure for your code
- First: Constructor / State
- Second: Local Function
- Third: React life cycle
- Forth: Render
- Always do line break whenever your import or variable is so long. You can do it like this but you can do it in another format as long as it can be legible and not long.
const {
type,
children,
className,
...defaultProps
} = this.props;
- Use Color library instead of writing hex color.
background-color: #EC272B; // Wrong
background-color: ${PrimaryColor.glintsred}; // Right
- Use Device Size instead of writing pixel size number.
@media (max-width: 600px) { ... } // Wrong
@media ${Device.mobileL} { ... } //Right
- For styling always use the component name followed by the role of that style.
CheckboxContainer
1. Checkbox is name of the component.
2. Container is outer part of the component.
JobcardImageWrapper
1. Jobcard is name of the component.
2. ImageWrapper is wrapper of the image inside Job Card.
- Don’t offer styling props on component.
<Collapsible onHoverColor="#FAFAFA" /> // Wrong
- Most of the time use em and rem, but still can use px for fixed dimension.
- Don't create to many element nodes inside the Component. Always do it in a simple way.
// Wrong
<div className="container">
<div className="wrapper">
<div>
<h1>This is Heading</h1>
</div>
</div>
</div>
- Use proper naming for interface, like isOpen or onClose.
- Always fix eslint before push your code.
- Using ThemeProvider for distributing color.
- Improve every aspects of component, like
- Code structure
- Interface name into proper one
- Component name into proper one
- Accessibility
- Remove styling props
- Remove component that shouldn't be a component.
- Improve accessibility.
- Fix all of eslint problem.
- Improve keyboard events on components.
- Improve flexibility of component.
- Delete unused assets.
- Improve interface documentation on each component section.
- Handle multiple same events inside component.
- Glints Aries should be able handle any possible case.
- Doing Accessibility Testing in storybook.
- Doing Component Testing.
- Trying Knobs.