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

Issue 95 #113

Closed
wants to merge 22 commits into from
Closed

Issue 95 #113

wants to merge 22 commits into from

Conversation

JonySamarelli
Copy link
Contributor

Closes #95 #38

Feature

Creates filter component and update colors file

Visual evidences 🖼️

image
image
image
image
image

Checklist
  • Issue linked
  • Build working correctly
  • Tests created
Additional info

Need help to improve testing

@Alecell
Copy link
Contributor

Alecell commented Mar 20, 2024

Manin vc fez mais doque a task, um pedaço doque vc fez era a task da página em si que já foi feita por outra pessoa então pra darmos seguimento preciso que vc apague o que ta fora do escopo da task.

No caso isso aqui precisa ser removido
image

O escopo da task é apenas o botão de filtro
image

@JonySamarelli
Copy link
Contributor Author

Se fosse o contrário eu chorava pq esse botão me deu trabalho ;-;

import { Component } from 'pet-dex-utilities';
import './index.scss';

const events = ['selectNewOptions'];
Copy link
Contributor

Choose a reason for hiding this comment

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

Por que não apenas um evento de change ou select?

const events = ['selectNewOptions'];

const html = `
<div class="filter__drop-down" data-select="drop-down">
Copy link
Contributor

Choose a reason for hiding this comment

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

BEM não está sendo seguido corretamente
Olha na parte de blocks

https://getbem.com/naming/

Comment on lines +11 to +42
function addOption(htmlElement, option) {
const $title = document.createElement('h2');
$title.innerHTML = option.title;
$title.classList.add('filter__drop-down__title');
htmlElement.appendChild($title);

const $hr = document.createElement('hr');
$hr.classList.add('filter__drop-down__hr');
htmlElement.appendChild($hr);

const $options = document.createElement('div');
$options.classList.add('filter__drop-down__options');
htmlElement.appendChild($options);

option.values.forEach((value) => {
const $element = document.createElement('div');
const $elementValue = document.createElement('input');
const $elementLabel = document.createElement('label');
$elementValue.type = option.type;
$elementValue.value = value;
$elementValue.name = option.title;
$elementLabel.innerHTML = value;
$element.classList.add('filter__drop-down__options__element');
$elementValue.classList.add('filter__drop-down__options__value');
$elementLabel.classList.add('filter__drop-down__options__label');
$elementLabel.htmlFor = value;
$elementValue.id = value;
$element.appendChild($elementValue);
$element.appendChild($elementLabel);
$options.appendChild($element);
});
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Pelo amor de Deus joga isso para um componente.


function addOption(htmlElement, option) {
const $title = document.createElement('h2');
$title.innerHTML = option.title;
Copy link
Contributor

Choose a reason for hiding this comment

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

Evite o innerHTML o máximo que conseguir. Nesse caso aqui não parece ser necessário

Suggested change
$title.innerHTML = option.title;
$title.innerText = option.title;

$elementValue.type = option.type;
$elementValue.value = value;
$elementValue.name = option.title;
$elementLabel.innerHTML = value;
Copy link
Contributor

Choose a reason for hiding this comment

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

Evite o innerHTML o máximo que conseguir. Nesse caso aqui não parece ser necessário

Suggested change
$elementLabel.innerHTML = value;
$elementLabel.innerText = value;

border: 1px solid colors.$neutral100;

background: none;
border-radius: 8px;
Copy link
Contributor

Choose a reason for hiding this comment

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

Verique a necessidade do PX, provável que deva mudar para REM

Comment on lines +44 to +45
width: 20px;
height: 20px;
Copy link
Contributor

Choose a reason for hiding this comment

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

Verique a necessidade do PX, provável que deva mudar para REM

color: colors.$secondary800;

background-color: colors.$white;
border-radius: 100px;
Copy link
Contributor

Choose a reason for hiding this comment

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

Verique a necessidade do PX, provável que deva mudar para REM

&--selected {
color: colors.$white;

border: 1px solid colors.$secondary800;
Copy link
Contributor

Choose a reason for hiding this comment

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

Verique a necessidade do PX, provável que deva mudar para REM

Comment on lines +5 to +7
it('is a Function', () => {
expect(Filter).toBeInstanceOf(Function);
});
Copy link
Contributor

Choose a reason for hiding this comment

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

Esse teste é necessário?

@Alecell Alecell closed this Apr 5, 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 filtro para registro do Pet
3 participants