-
Notifications
You must be signed in to change notification settings - Fork 40
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
Refactoring main character text #420
base: master
Are you sure you want to change the base?
Conversation
Coverage Report
File Coverage
|
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.
Vamos melhorar um pouco os testes principalmente!
src/components/CharacterLimitMainText/CharacterLimit.module.scss
Outdated
Show resolved
Hide resolved
src/components/CharacterLimitMainText/CharacterLimit.module.scss
Outdated
Show resolved
Hide resolved
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.
Só um ajuste, achei esquisito uma coisa aqui
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.
isso aqui não me parece estar integrado com a integração dos mocks de API
type Social = { | ||
id: string; | ||
maxLength: number; | ||
socialName: string; | ||
svg: string; | ||
}; |
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.
tipos devem ser declarados do types
file
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.
Verdade, my bad
const getSocialMedias = async (): Promise<void> => { | ||
const socialMedias: SocialMedia[] = await SocialMediaService.fetch([]); | ||
const value = socialMedias.map((socialMedia) => { | ||
const length: number = socialMedia.postModes.reduce((acc, data) => { | ||
if (!('text' in data.validators)) { | ||
return 0; | ||
} | ||
const { maxLength } = data.validators.text; | ||
return acc > maxLength ? acc : maxLength; | ||
}, 0); | ||
return { | ||
id: socialMedia.id, | ||
maxLength: length, | ||
socialName: socialMedia.name, | ||
svg: socialMedia.icon, | ||
}; | ||
}); | ||
setSocials(value); | ||
}; |
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.
Caramba isso ta muito esquisito
useEffect(() => { | ||
void getSocialMedias(); | ||
}, []); |
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.
Não precisamos disso
Closes #382
Feature
Refatoração do componente, exclusão de outros componentes desnecessários ao redor e melhoramento dos testes do componente.
Visual evidences 🖼️
Checklist
Additional info
N/A