Search Townhall by date
This commit is contained in:
parent
cba0f42e13
commit
48669b6712
|
@ -1,5 +1,5 @@
|
|||
import React, { Component } from 'react'
|
||||
import TownhallSection from "./TownhallSection/TownhallSection";
|
||||
import TownhallSection from "./Townhall/TownhallSection/TownhallSection";
|
||||
import 'antd/lib/button/style/index.css';
|
||||
import 'antd/lib/menu/style/index.css';
|
||||
import 'antd/lib/dropdown/style/index.css';
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import React from "react";
|
||||
import { Input } from "antd";
|
||||
|
||||
const Search = Input.Search;
|
||||
const { Search } = Input;
|
||||
|
||||
export const TitleSearch = ({ onSearch, ...props }) => (
|
||||
<div {...props}>
|
|
@ -2,7 +2,7 @@ import React, { Component } from "react";
|
|||
import { connect } from 'react-redux'
|
||||
import styles from "./style.module.css";
|
||||
import { TownhallTable } from "../TownhallTable";
|
||||
import { TitleSearch } from "../TitleSearch";
|
||||
import { TitleSearch } from "./TitleSearch";
|
||||
|
||||
const townhallData = [
|
||||
{
|
||||
|
@ -130,8 +130,8 @@ class TownhallSection extends Component {
|
|||
};
|
||||
|
||||
handleSearch = searchText => {
|
||||
const filteredEvents = townhallData.filter(({ title }) => {
|
||||
return title.includes(searchText);
|
||||
const filteredEvents = townhallData.filter(({ date }) => {
|
||||
return date.includes(searchText);
|
||||
});
|
||||
|
||||
this.setState({
|
|
@ -3,7 +3,6 @@ import Table from "antd/lib/table";
|
|||
|
||||
import Button from "antd/lib/button";
|
||||
|
||||
|
||||
import { actionService } from "./townhallService";
|
||||
|
||||
const TownhallTable = ({ townhallData }) => {
|
||||
|
@ -23,7 +22,7 @@ const TownhallTable = ({ townhallData }) => {
|
|||
key: "title"
|
||||
},
|
||||
{
|
||||
title: "Date",
|
||||
title: "Date (YYYY-MM-DD)",
|
||||
dataIndex: "date",
|
||||
key: "date"
|
||||
},
|
Loading…
Reference in New Issue