Created
June 9, 2020 14:56
-
-
Save jsmanifest/3caedc608947163cb95d4ed9493ea6ae to your computer and use it in GitHub Desktop.
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
function start(component) { | |
// Restrict it from displaying in a smaller size | |
if (component.style.height < 300) { | |
component.style['height'] = 300 | |
} | |
if (component.type === 'button') { | |
// Give all button components a dashed teal border | |
component.style['border'] = '1px dashed teal' | |
} | |
if (component.type === 'input') { | |
if (component.inputType === 'email') { | |
// Uppercase every letter for email inputs | |
component.style.textTransform = 'uppercase' | |
} | |
} | |
return component | |
} | |
const component = { | |
type: 'div', | |
style: { | |
height: 250, | |
fontSize: 14, | |
fontWeight: 'bold', | |
textAlign: 'center', | |
}, | |
} | |
const result = start(component) | |
console.log(result) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment