-
Notifications
You must be signed in to change notification settings - Fork 19
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(components): add new component #40
feat(components): add new component #40
Conversation
src/ui/formatted-date.tsx
Outdated
@@ -0,0 +1,47 @@ | |||
import React from 'react'; | |||
|
|||
const getDiffDays = (date: Date) => |
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.
Давай утилки вынесем в отдельный файлик и подберем понятные имена (getFormattedUnit)
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.
еще можно взглянуть на либу https://www.npmjs.com/package/pluraljs и похожие, тк есть подозрение, что такое понадобится
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.
Давай утилки вынесем в отдельный файлик и подберем понятные имена (getFormattedUnit)
Да согласен
еще можно взглянуть на либу...
Тут не очень понял на самом деле зачем либа, текущий код работает, а наша либа (react-developer-burger-ui-components) щас так красиво выглядит с минимумом зависимостей (не дев зависимостей), что не хочу ничего тащить если честно, а особенно вот такие конфиги:
https://github.com/kalpeshsingh/PluralJS/blob/master/src/helpers/dictionary.js#L5
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.
Так-с, в итоге нашел достаточно легкую либу plural-ru
:)
Утилитки перенес, но не уверен по структуре, я не нашел нигде не плоскую структуру для компонента, но кидать утилитки на уровень папки UI компонентов чет не хочется, если честно и по неймингу файлов тоже не гарантирую (возможно тут используется какая-то общепринятая структура, о которой я не знаю буду признателен, если ткнешь пальцем, где о ней почитать)
Коллеги, призовите меня пожалуйста как PR будет готов к вливанию и пройдет код-ревью |
39eae69
to
6474e59
Compare
OK |
Код-ревью прошел, так что можно вливать |
Только сейчас заметил, я качал библиотеки на рабочем ноутбуке и там сейчас яндексовый registry в ссылке на новую библиотеку, не мерджи пока плиз |
6474e59
to
1e275a1
Compare
1e275a1
to
17656f0
Compare
Готово, пофиксил registry, поребейсился, локально все огонь |
No description provided.