Commit 71fdecb0 authored by Jiawen Lyu's avatar Jiawen Lyu

add key for each list item

parent 591d93a5
......@@ -101,11 +101,11 @@ const extractUvDateInfo = (uvs) => {
const withUVs = WrappedComponent => props => {
const { data, logins } = props;
const { data } = props;
const uvs = extractUvDateInfo(data)
console.log("uvs: ", uvs)
return <WrappedComponent events={demoData} logins={demoLogins} {...props} />;
return <WrappedComponent events={demoData} {...props} />;
}
......
.scheduler-container {
height: calc(100vh - 200px);
height: calc(100vh - 100px);
/* width: 100vw; */
}
\ No newline at end of file
......@@ -14,12 +14,13 @@ const toColorName = index => (
4: "grey"
}[index]
)
const changeColorForEachStudent = (events, logins) => events.map(event => {
event.color = toColorName(logins.indexOf(event.login))
event.text = event.text + "\n" + event.login
scheduler.updateEvent(event.id)
const changeColorForEachStudent = (events, logins) =>
events.map(event => {
event.color = toColorName(logins.indexOf(event.login))
event.text = event.text + "\n" + event.login
scheduler.updateEvent(event.id)
})
})
export default class Scheduler extends Component {
initSchedulerEvents() {
......
......@@ -7,7 +7,7 @@ export const StudentsList = (props) => {
<>
<ul class="list-group" id="studentList">
{
logins.map(login => (<li class="list-group-item">
logins.map(login => (<li class="list-group-item" key={login}>
{
login
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment