-
Notifications
You must be signed in to change notification settings - Fork 22
added button like and dislike #30
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
base: master
Are you sure you want to change the base?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,48 @@ | ||
| <script> | ||
| import IconCollab from '../components/IconCollab.svelte' | ||
| let deslikes = 0 | ||
|
|
||
| function handleClick() { | ||
| deslikes += 1; | ||
| } | ||
| </script> | ||
|
|
||
| <style> | ||
| button { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Evite usar tags diretamente, sempre tenha preferencia pelo uso de classes para manter a mantenabilidade e a facilidade da leitura. E não sei ao certo sobre o scoped do Svelte, se ele adiciona escopo em tags diretamente, o que pode gerar conflitos com outros componentes. Apesar que acho que o Svelte também coloca escopo. Recomendo sempre utilizar o nome do componente na tag raiz, assim como os demais componentes presentes no repositório. <button on:click={handleClick} class="dislike-button"> |
||
| height: 40px; | ||
| width: 100px; | ||
| border-radius: 20px; | ||
| border: none; | ||
| cursor: pointer; | ||
| padding: 5px 15px; | ||
| background: rgb(255, 252, 238, 0.1); | ||
| margin: 20px 0 20px 16px; | ||
| } | ||
|
|
||
| button:last-child { | ||
| margin: 20px 0 0 5px; | ||
| } | ||
|
|
||
| button > div { | ||
| display: flex; | ||
| justify-content: space-evenly; | ||
| align-items: center; | ||
| } | ||
|
|
||
| button > div > p { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Este é um exemplo, |
||
| color: #FFF; | ||
| font-size: 16px; | ||
| line-height: 24px; | ||
| letter-spacing: 0.5px; | ||
| font-family: Comfortaa; | ||
| } | ||
| </style> | ||
|
|
||
| <button on:click={handleClick}> | ||
| <div> | ||
| <IconCollab | ||
| name="deslike_button" | ||
| alt="Deslike Button" /> | ||
| <p>{deslikes}</p> | ||
| </div> | ||
| </button> | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,44 @@ | ||
| <script> | ||
| import IconCollab from '../components/IconCollab.svelte' | ||
| let likes = 0 | ||
|
|
||
| function handleClick() { | ||
| likes += 1; | ||
| } | ||
| </script> | ||
|
|
||
| <style> | ||
| button { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. O mesmo caso dos comentários sobre os usos de classes vale para este componente também |
||
| height: 40px; | ||
| width: 100px; | ||
| border-radius: 20px; | ||
| border: none; | ||
| cursor: pointer; | ||
| padding: 5px 15px; | ||
| background: rgb(255, 252, 238, 0.1); | ||
| margin: 20px 0 20px 16px; | ||
| } | ||
|
|
||
| button > div { | ||
| display: flex; | ||
| justify-content: space-evenly; | ||
| align-items: center; | ||
| } | ||
|
|
||
| button > div > p { | ||
| color: #FFF; | ||
| font-size: 16px; | ||
| line-height: 24px; | ||
| letter-spacing: 0.5px; | ||
| font-family: Comfortaa; | ||
| } | ||
| </style> | ||
|
|
||
| <button on:click={handleClick}> | ||
| <div> | ||
| <IconCollab | ||
| name="like_button" | ||
| alt="Like Button" /> | ||
| <p>{likes}</p> | ||
| </div> | ||
| </button> | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A tradução correta de "não gostei" é "dislike"