blocks
blocks copied to clipboard
Better resource naming
Problem: Sometimes, when we are importing the optimus resources, we accidentally import blocks resources that have the same name.
Proposed solution: It would be nice to have a different name for the blocks resources. We could rename the resources adding the Loadsmart or Blocks words:
-
BlocksColors/LoadsmartColors -
BlocksFonts/LoadsmartFonts -
BlocksImages/LoadsmartImages - so on...
Good point. Maybe this could be related to the way we're using the resources in the same file. Do you think that by using import aliases it would be OK? I'm just asking so we avoid redundancy by adding the Blocks prefix to everything we export from blocks.
Aliases would work like:
// anywhere in Optimus
import { Colors as BlocksColors } from '@loadsmart/blocks'
import { Colors as OptimusColors } from 'resources/colors' // not sure if this is the path
// ...
const styles = Stylesheet.create({
button: {
backgroundColor: BlocksColors.AlgaeGreen,
textColor: OptimusColors.White
}
})
What do you think, @lenoirzamboni ?