-
Notifications
You must be signed in to change notification settings - Fork 32
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
Conversation
&__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); | ||
} |
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.
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
}
const today = new Date() | ||
const createdAt = new Date(body.created_at) | ||
const differenceDates = today.getTime() - createdAt.getTime() |
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 precisa criar uma instância Date today
pra pegar o timestamp corrente, Date.now()
tá aí pra isso 😄
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 |
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.
Quebrou a ordem alfabética aí 😬
@@ -61,7 +62,11 @@ export default { | |||
}, | |||
isLoaded: Boolean, | |||
installmentsOption: Object, | |||
discountOption: Object | |||
discountOption: Object, | |||
timeToNew: { |
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.
É o número de dias né, pensando na API do componente não fica mais claro a prop como daysToBeNew
ou algo do tipo?
No description provided.