-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: modified rgb style color to original fonts (#190)
* fix: modified rgb style color to original fonts * feat: image and name getValue emission * fix: changes required * feat: storybook created * fix: x * style: modified rgb style to color fonts and spacing adjustment * fix: removed margin from top of page * fix: inputText classList removed
- Loading branch information
1 parent
e5b2421
commit b52b17d
Showing
7 changed files
with
183 additions
and
17 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
import { Component } from 'pet-dex-utilities'; | ||
import TextInput from '../../../components/TextInput'; | ||
import UploadImage from '../../../components/UploadImage'; | ||
import Button from '../../../components/Button'; | ||
import './index.scss'; | ||
|
||
const events = ['submit']; | ||
|
||
const html = ` | ||
<div class='pet-register'> | ||
<div class='pet-register__container'> | ||
<div class='pet-register__image' data-select='upload-image-container'></div> | ||
<h1 class='pet-register__title'>Qual o nome do seu bichinho?</h1> | ||
<div class='pet-register__input' data-select='input-container'></div> | ||
</div> | ||
<div class='pet-register__button' data-select='button-container'></div> | ||
</div> | ||
`; | ||
|
||
export default function PetRegister() { | ||
Component.call(this, { html, events }); | ||
|
||
const $inputContainer = this.selected.get('input-container'); | ||
const $uploadImage = this.selected.get('upload-image-container'); | ||
const $buttonContainer = this.selected.get('button-container'); | ||
|
||
this.input = new TextInput({ | ||
placeholder: 'Nome do Pet', | ||
}); | ||
|
||
this.upload = new UploadImage(); | ||
this.button = new Button({ | ||
text: 'Continuar', | ||
isFullWidth: true, | ||
isDisabled: false, | ||
}); | ||
|
||
const updateButtonVisibility = () => { | ||
const input = this.input.getValue(); | ||
const image = this.upload.getImage(); | ||
|
||
this.button.setIsDisabled(!(input && image)); | ||
}; | ||
updateButtonVisibility(); | ||
|
||
this.upload.listen('value:change', updateButtonVisibility); | ||
this.input.listen('value:change', updateButtonVisibility); | ||
|
||
this.button.listen('click', () => { | ||
const image = this.upload.getValue(); | ||
const name = this.input.getValue(); | ||
this.emit('submit', { image, name }); | ||
}); | ||
|
||
this.upload.mount($uploadImage); | ||
this.input.mount($inputContainer); | ||
this.button.mount($buttonContainer); | ||
} | ||
|
||
PetRegister.prototype = Object.assign( | ||
PetRegister.prototype, | ||
Component.prototype, | ||
); |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
@use '~styles/breakpoints.scss' as breakpoints; | ||
@use '~styles/colors.scss' as colors; | ||
@use '~styles/fonts.scss' as fonts; | ||
|
||
.pet-register { | ||
display: flex; | ||
flex-direction: column; | ||
|
||
&__container { | ||
width: 100%; | ||
} | ||
|
||
&__image { | ||
max-width: 18.6rem; | ||
|
||
margin: 5rem auto; | ||
} | ||
|
||
&__title { | ||
font-family: fonts.$primaryFont; | ||
color: colors.$gray800; | ||
text-align: center; | ||
font-size: fonts.$xs; | ||
font-weight: fonts.$medium; | ||
|
||
margin: 7rem auto 3rem; | ||
} | ||
|
||
&__input { | ||
max-width: 32.7rem; | ||
|
||
margin: 0 auto; | ||
} | ||
|
||
&__button { | ||
width: 100%; | ||
|
||
margin-top: 16.8rem; | ||
padding: 2rem; | ||
box-sizing: border-box; | ||
|
||
box-shadow: 0 -3px 8px 0 rgba(73, 77, 90, 0.12156862745098039); | ||
border-radius: 1.7rem; | ||
} | ||
} | ||
|
||
@include breakpoints.from1024 { | ||
.pet-register { | ||
align-items: center; | ||
|
||
&__title { | ||
font-size: fonts.$sm; | ||
|
||
margin-top: 15rem; | ||
} | ||
|
||
&__input { | ||
max-width: 40rem; | ||
|
||
margin: 0 auto; | ||
} | ||
|
||
&__button { | ||
width: 43%; | ||
|
||
margin-top: 4rem; | ||
padding: unset; | ||
|
||
box-shadow: unset; | ||
} | ||
} | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import PetRegister from '../home/components/PetRegister'; | ||
|
||
export default { | ||
title: 'Pages/PetProfile', | ||
|
||
render: (args = {}) => { | ||
const $container = document.createElement('div'); | ||
const component = new PetRegister(args); | ||
component.mount($container); | ||
return $container; | ||
}, | ||
}; | ||
|
||
export const Default = {}; |