Skip to content
This repository was archived by the owner on Apr 16, 2024. It is now read-only.

pkg.components.videoplayer#66

Open
AlexanderLukomsky wants to merge 6 commits into
stagingfrom
9964808
Open

pkg.components.videoplayer#66
AlexanderLukomsky wants to merge 6 commits into
stagingfrom
9964808

Conversation

@AlexanderLukomsky

Copy link
Copy Markdown
Contributor

Screenshot 2023-07-05 102326

@vercel

vercel Bot commented Jul 5, 2023

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
xiworkshop ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 6, 2023 10:44am
1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
xieffect ⬜️ Ignored (Inspect) Jul 6, 2023 10:44am

@unknownproperty unknownproperty left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Ревью готово


const [open, setOpen] = useState(false);

const handleOpen = () => {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

я бы отрефакторил обе функции в handleToggle

<>
<Button onClick={handleOpen}>Open video</Button>

<Button onClick={() => setSelectedVideo((prev) => (prev === 0 ? 1 : 0))}>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

а вот эту бы функцию вынес


return (
<>
{!open && (

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

вместо !open && ... open && ...
можно open ? ... : ...

import { formatTime } from './helpers';
import 'pkg.config.muidts';

type ControlsProps = {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

я бы добавил комментарии за что отвечает каждый проп

})}
>
<Stack direction="row" alignItems="center" sx={controlsRowStyle}>
{!playing && (

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

тут тоже самое, что с open

<VolumeControl volume={volume} onChange={onVolumeChange} />

<IconButton sx={iconButtonStyle} onClick={onToggleScreenMode}>
{isFullScreen && <Minimize sx={iconStyle} />}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

и тут

setPlayerState((prev) => ({ ...prev, playing: false }));
};

const handleVolumeChange = (event: Event, value: number | number[]) => {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

а если всё же прилетит массив чисел? тут явно надо подумать, as не выход

};

const handlePlayerTimeChange = (event: Event, value: number | number[]) => {
reactPlayerRef.current?.seekTo((value as number) - 0.01);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

тут тоже as

return (
<Box sx={{ position: 'relative', ml: 'auto' }}>
<IconButton onClick={handleIconClick} sx={iconButtonStyle}>
{volume > 0 && <SoundOn sx={iconStyle} />}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

тут тоже можно на ? :

"eslint": "^7.32.0",
"eslint-config-custom": "*",
"pkg.config.typescript": "*",
"react": "^18.2.0",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

react тут лишний, он уже есть в dependencies

@AlexanderLukomsky

Copy link
Copy Markdown
Contributor Author

Исправил все замечания, так же отредактировал названия переменных.

@unknownproperty unknownproperty left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Хорошо, спасибо, поставил аппрув, можно отнести отправить на тестирование

@unknownproperty unknownproperty added the ready to test request is waiting for QA-engineer to test label Jul 9, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

ready to test request is waiting for QA-engineer to test

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants