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

feat(product-card): add stamp new #533

Closed
wants to merge 1 commit into from
Closed

Conversation

matheusgnreis
Copy link
Member

No description provided.

@matheusgnreis matheusgnreis linked an issue Sep 11, 2021 that may be closed by this pull request
Comment on lines +47 to +62
&__new-stamp {
background-color: var(--info);
color: var(--info-yiq);
min-width: 55px;
font-size: 80%;
line-height: 2.2;
text-align: center;
position: absolute;
z-index: 9;
top: 1rem;
left: 0;
border-radius: var(--border-radius);
transition: border-radius .3s;
opacity: .9;
font-weight: var(--font-bold);
}
Copy link
Member

Choose a reason for hiding this comment

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

Tá duplicando todos os estilos do &__offer-stamp 😐
Os estilos que eles compartilham deveriam ser escritos uma vez só:

&__offer-stamp,
&__new-stamp {
  // estilos compartilhados
}

&__offer-stamp {
  // só do offer stamp
}

&__new-stamp {
  // só do new stamp
}

Comment on lines +126 to +128
const today = new Date()
const createdAt = new Date(body.created_at)
const differenceDates = today.getTime() - createdAt.getTime()
Copy link
Member

Choose a reason for hiding this comment

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

Não precisa criar uma instância Date today pra pegar o timestamp corrente, Date.now() tá aí pra isso 😄

Suggested change
const today = new Date()
const createdAt = new Date(body.created_at)
const differenceDates = today.getTime() - createdAt.getTime()
const differenceDates = Date.now() - new Date(body.created_at).getTime()

@@ -2,7 +2,8 @@ import {
i19buy,
i19connectionErrorProductMsg,
i19outOfStock,
i19unavailable
i19unavailable,
i19new
Copy link
Member

Choose a reason for hiding this comment

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

Quebrou a ordem alfabética aí 😬

@@ -61,7 +62,11 @@ export default {
},
isLoaded: Boolean,
installmentsOption: Object,
discountOption: Object
discountOption: Object,
timeToNew: {
Copy link
Member

Choose a reason for hiding this comment

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

É o número de dias né, pensando na API do componente não fica mais claro a prop como daysToBeNew ou algo do tipo?

@leomp12 leomp12 closed this Feb 21, 2022
@leomp12 leomp12 deleted the mgnr-stamp-new branch February 21, 2022 16:25
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.

Tag de lançamento
2 participants