Skip to content
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

added header #20

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

added header #20

wants to merge 3 commits into from

Conversation

SoldatovMikhaul
Copy link
Collaborator

image

client/src/components/MyHeader.tsx Outdated Show resolved Hide resolved
client/src/components/MyHeader.tsx Outdated Show resolved Hide resolved
client/src/App.tsx Outdated Show resolved Hide resolved
client/src/components/TeachersTable.tsx Outdated Show resolved Hide resolved
client/src/components/TeachersTable.tsx Outdated Show resolved Hide resolved

export default function DataGridDemo() {
return (
<div style={{ height: 400, width: '100%' }}>
<DataGrid rows={rows} columns={columns} pageSize={5} checkboxSelection />
<DataGrid rows={getRooms()} columns={columns} pageSize={5} checkboxSelection />
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
<DataGrid rows={getRooms()} columns={columns} pageSize={5} checkboxSelection />
<DataGrid rows={rows} columns={columns} pageSize={5} checkboxSelection />

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Можно пожалуйста текстовое пояснение проблемы я не очень понял что не так у меня

Copy link
Member

Choose a reason for hiding this comment

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

@SoldatovMikhaul у тебя выше на 23-ей строке уже есть переменная rows

{ id: 6, roomNumber: 'A202' },
{ id: 7, roomNumber: 'A107' },
];
const rows = getRooms
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
const rows = getRooms
const rows = getRooms()

Copy link
Contributor

Choose a reason for hiding this comment

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

вообще тащите в UseEffects

@@ -1,4 +1,5 @@
import * as React from 'react';
import { getRooms } from "./TeacherService"
Copy link
Member

Choose a reason for hiding this comment

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

Опусти на строчку ниже

{ id: 7, roomNumber: 'A107' },
];
}

Copy link
Member

Choose a reason for hiding this comment

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

Добавь пустую строку в конце файла

Comment on lines +1 to +11
export const getRooms = () => {
return [
{ id: 1, roomNumber: 'A100' },
{ id: 2, roomNumber: 'A102' },
{ id: 3, roomNumber: 'A103' },
{ id: 4, roomNumber: 'A201' },
{ id: 5, roomNumber: 'A310' },
{ id: 6, roomNumber: 'A202' },
{ id: 7, roomNumber: 'A107' },
];
}
Copy link
Member

Choose a reason for hiding this comment

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

отформатируй код, убери лишний return и добавь тип возвращаемого значения

Suggested change
export const getRooms = () => {
return [
{ id: 1, roomNumber: 'A100' },
{ id: 2, roomNumber: 'A102' },
{ id: 3, roomNumber: 'A103' },
{ id: 4, roomNumber: 'A201' },
{ id: 5, roomNumber: 'A310' },
{ id: 6, roomNumber: 'A202' },
{ id: 7, roomNumber: 'A107' },
];
}
export const getRooms = () => [
{ id: 1, roomNumber: 'A100' },
{ id: 2, roomNumber: 'A102' },
{ id: 3, roomNumber: 'A103' },
{ id: 4, roomNumber: 'A201' },
{ id: 5, roomNumber: 'A310' },
{ id: 6, roomNumber: 'A202' },
{ id: 7, roomNumber: 'A107' },
];

}),
);

export default function ButtonAppBar() {
Copy link
Member

Choose a reason for hiding this comment

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

Твой текущий файл называется Header.tsx а компонент внутри ButtonAppBar, имя компонента должно совпадать с именем файла

Suggested change
export default function ButtonAppBar() {
export default function Header() {


export default function DataGridDemo() {
return (
<div style={{ height: 400, width: '100%' }}>
<DataGrid rows={rows} columns={columns} pageSize={5} checkboxSelection />
<DataGrid rows={getRooms()} columns={columns} pageSize={5} checkboxSelection />
Copy link
Member

Choose a reason for hiding this comment

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

@SoldatovMikhaul у тебя выше на 23-ей строке уже есть переменная rows

@jskonst
Copy link
Contributor

jskonst commented Jun 29, 2021

@SoldatovMikhaul Есть ли исправления по MR ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants