mirror of
https://github.com/microsoft/frontend-bootcamp.git
synced 2026-01-26 14:56:42 +08:00
adding a redux todo list to playground
This commit is contained in:
@@ -1,16 +1,22 @@
|
||||
import React from 'react';
|
||||
import { Stack } from '@uifabric/experiments';
|
||||
import { TodoListItem } from './TodoListItem';
|
||||
import { Pivot, PivotItem } from 'office-ui-fabric-react';
|
||||
import { TodoItem, FilterTypes } from '../store';
|
||||
|
||||
export class TodoList extends React.Component {
|
||||
export interface TodoListProps {
|
||||
todos: { [id: string]: TodoItem };
|
||||
filter: FilterTypes;
|
||||
}
|
||||
|
||||
export class TodoList extends React.Component<TodoListProps> {
|
||||
render() {
|
||||
const { filter, todos } = this.props;
|
||||
return (
|
||||
<Stack verticalGap={10}>
|
||||
<TodoListItem checked={false} label="nothing" />
|
||||
<TodoListItem checked={false} label="nothing" />
|
||||
<TodoListItem checked={false} label="nothing" />
|
||||
<TodoListItem checked={false} label="nothing" />
|
||||
{Object.keys(todos).map(id => {
|
||||
const todo = todos[id];
|
||||
return <TodoListItem key={id} checked={todo.completed} label={todo.label} />;
|
||||
})}
|
||||
</Stack>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user