Skip to content
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

avatar button Issue 18 #55

Closed
wants to merge 3 commits into from
Closed

Conversation

carlosbryanp
Copy link

@carlosbryanp carlosbryanp commented Jan 12, 2024

Closes #18

Feature
Componente de avatar no formato de um botão, que ao ser clicado redirecionará o usuário para a página de adicionar um 
novo pet. Este componente também deve apresentar uma mini animação de hover que muda a cor do ícone central.
Changelog
Avatar⬎ 
         index.js 
         index.scss 
         Icon.svg 
         iconHover.svg 
N/A
Visual evidences 🖼️

-- Normal

image
--Hover

image

Checklist
  • Issue linked
  • Build working correctly
  • Tests created

Comment on lines +19 to +21
$image.addEventListener('mouseover', () => ($image.src = imageHover));
$image.addEventListener('mouseout', () => ($image.src = imageOriginal));
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pq precisou usar JS e não apenas um CSS?

.plus {
padding: 18px;
border-radius: 9999px;
border: 1.5px solid #fff;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pixel com ponto flutuante é bad

@@ -0,0 +1,12 @@
.plus {
padding: 18px;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Não usar pixel para padding, margin e afins, explico melhor nesse artigo: https://www.linkedin.com/pulse/unidades-css-um-guia-completo-alexandre-gomes/

import iconHover from './iconHover.svg';

const html = `
<a href="#" class="avatarButton" data-select="container">
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

O nome dessa classe não condiz com o BEM https://getbem.com/introduction/


const html = `
<a href="#" class="avatarButton" data-select="container">
<img class="plus" data-select="image" src="${icon}" alt="" />
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Não nomeie a classe com seu conteudo, no caso icon é melhor que plus pq se o icone mudar a classe ainda faz sentido

@Alecell
Copy link
Contributor

Alecell commented Feb 21, 2024

PR fechado decorrente de inatividade

@Alecell Alecell closed this Feb 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Criação do Componente de Avatar de Pet com Ação de Adição
2 participants