-
Notifications
You must be signed in to change notification settings - Fork 1
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: categories for Icons added #1
Conversation
@@ -29,6 +29,15 @@ interface FormProps { | |||
export const Form: FC<FormProps> = ({ onSubmit = () => {}, iconsMetaData }) => { | |||
const [state, setState] = useState<FormPayload>({ ...defaultState, iconsMetaData }); | |||
|
|||
useEffect(() => { | |||
if (iconsMetaData.length > 0) { |
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.
некритично
можно сделать инверсию
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.
поправил
@@ -24,6 +24,7 @@ export const prettify = (source: string) => prettier.format(source, prettierSett | |||
|
|||
export const getFilesPath = (iconName?: string, iconSize?: number) => ({ | |||
iconSourceExport: 'packages/plasma-icons/src/scalable/index.ts', | |||
iconSourceComponent: 'packages/plasma-icons/src/scalable/Icon.tsx', |
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.
а для чего этот файл тоже коммитить надо при экспорте иконок? 🤔 Он же вроде всегда статичный должен оставаться
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.
а, кажется понял, из-за появившейся возможности динамически добавлять категории
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.
да, из-за категорий
(octokit: Octokit, owner: string, repo: string) => | ||
<T>(fn: (...args: any[]) => Promise<T>) => | ||
(...args: any[]) => | ||
fn(octokit, owner, repo, ...args); |
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.
а здесь что-то поменялось? Не могу найти разницу кроме переноса строк
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.
видимо просто eslint
.trim() | ||
.replace(/^(\s*)[a-zA-Z_]+(\d\d)/g, '') | ||
.replace(/\s/g, ''); | ||
return upperFirstLetter(withoutPrefix); |
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.
можешь пожалуйста добавить в коментах пример строки, которая в итоге разбирается, и что получается из неё? А то я этого в своё время не сделал и сейчас этот код трудно читается
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.
добавил комменты
const { width, name } = selection; | ||
const { type } = selection; | ||
|
||
if (type === 'FRAME') { |
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.
давай инверсию сделаем? Кажется, что тут можно
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.
поправил
}); | ||
|
||
return await Promise.all( | ||
nodes.map(async (node) => { |
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.
я бы это вынес в какую-нибудь функцию, в которой по названию будет понятно, что тут происходит
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.
поправил
@@ -60,20 +44,29 @@ export const IconList: FC<IconListProps> = ({ onChangeIconsName, iconsMetaData } | |||
[state, onChangeIconsName], | |||
); | |||
|
|||
useEffect(() => { | |||
if (iconsMetaData.length > 0) { |
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.
тут тоже
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.
поправил
670929d
to
6ed059e
Compare
Добавлена логика для соответствия категории иконки.
Поправлены мелкие ошибки.