Search Townhall by date

This commit is contained in:
jinhojang6 2020-04-21 23:53:45 +09:00
parent cba0f42e13
commit 48669b6712
No known key found for this signature in database
GPG Key ID: 0E7AA62CB0D9E6F3
7 changed files with 6 additions and 7 deletions

View File

@ -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';

View File

@ -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}>

View File

@ -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({

View File

@ -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"
},