Skip to content

Comments

Dz lesson 16#8

Open
dmitryplus wants to merge 74 commits intomasterfrom
dz-lesson-16
Open

Dz lesson 16#8
dmitryplus wants to merge 74 commits intomasterfrom
dz-lesson-16

Conversation

@dmitryplus
Copy link
Owner

No description provided.

@@ -0,0 +1,149 @@
<?xml version="1.0" encoding="UTF-8"?>

Choose a reason for hiding this comment

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

в gitignore

Copy link
Owner Author

Choose a reason for hiding this comment

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

не могу - тогда папка coverage становится пустой и исчезает из репа. из-за этого на деплое не отрабатывает с тестами

export default {
title: 'ComponentWithState/Calculator/Button',
component: Button,
// eslint-disable-next-line prettier/prettier

Choose a reason for hiding this comment

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

думаю стоит поправить правило

Copy link
Owner Author

Choose a reason for hiding this comment

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

тогда prettier ругается на следующую строку где экспорт как ' as ComponentMeta'

}

export const Button = ({ label, onChildFontSizeChange }: ButtonProps) => {

Choose a reason for hiding this comment

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

лишний пробел

Copy link
Owner Author

Choose a reason for hiding this comment

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

поправил

onChildFontSizeChange: unknown;
}

export const Button = ({ label, onChildFontSizeChange }: ButtonProps) => {

Choose a reason for hiding this comment

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

FC + дженерик

Copy link
Owner Author

Choose a reason for hiding this comment

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

поправил


export const Button = ({ label, onChildFontSizeChange }: ButtonProps) => {

const childHandleInputChange = useCallback(

Choose a reason for hiding this comment

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

а нужна ли мемоизация?

import { Button } from './Button';
import { BlockFontSize } from '../types/fontSize';

export const Panel = ({ onFontSizeChange }) => {

Choose a reason for hiding this comment

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

и как тс не поругался на any?

Copy link
Owner Author

Choose a reason for hiding this comment

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

добавил тип пропсов и FC

return (
<div className='buttons-row'>
{needFontSizes.map((fontSize) => (
<Button

Choose a reason for hiding this comment

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

потерял key, настроить линтер

Copy link
Owner Author

Choose a reason for hiding this comment

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

добавил key

}

export const Block =
styled.div <

Choose a reason for hiding this comment

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

что-то с отступами

Copy link
Owner Author

Choose a reason for hiding this comment

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

prettier так ставит, незнаю что за опция

src/index.js Outdated

const root = ReactDOM.createRoot(document.getElementById('root'));
root.render(
<React.StrictMode>

Choose a reason for hiding this comment

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

помнить о двойном рендере

Copy link
Owner Author

Choose a reason for hiding this comment

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

убрал спасибо

@@ -0,0 +1,13 @@
export type BlockFontSize =

Choose a reason for hiding this comment

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

точно ли нужен такой тип?

Copy link
Owner Author

Choose a reason for hiding this comment

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

размер шрифта строго от 1 до 2 в em
думаю да

@dmitryplus dmitryplus temporarily deployed to github-pages June 21, 2023 15:47 — with GitHub Actions Inactive
@dmitryplus dmitryplus temporarily deployed to github-pages June 21, 2023 15:57 — with GitHub Actions Inactive
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.

2 participants