diff --git a/src/components/PerPartyMemberVoteResult.js b/src/components/PerPartyMemberVoteResult.js new file mode 100644 index 0000000..6b95fb7 --- /dev/null +++ b/src/components/PerPartyMemberVoteResult.js @@ -0,0 +1,105 @@ +import React from "react" +import { DESKTOP_MIN_WIDTH, media, DISPLAY_FONT } from "../styles" +import _ from "lodash" + +const mockData = [ + { + name: "นายประมูล อึ้งไปเลยสิย้ง", + zone: "ราชบุรี, เขต 3", + vote: "1234567", + percentage: "20", + }, + { + name: "นายย้ง อึ้งไปเลยสิประมูล", + zone: "ราชบุรี, เขต 3", + vote: "672367", + percentage: "20", + }, + { + name: "นายอึ้ง ย้ง", + zone: "ราชบุรี, เขต 3", + vote: "345", + percentage: "20", + }, + { + name: "นายย้ง อึ้ง", + zone: "ราชบุรี, เขต 3", + vote: "22344", + percentage: "20", + }, +] + +// @todo #1 Party View - binding data to ZonePartyMemberVoteResult +export default function ZonePartyMemberVoteResult({ data = mockData }) { + const active = { background: "#000", color: "#FFF" } + const tabHeaderStyle = { + padding: "15px", + width: "100%", + cursor: "pointer", + border: 0, + borderBottom: "1px solid #000", + ["&:hover"]: { + active, + }, + } + return ( +
+

ประมาณจำนวน สส. ที่ได้

+
+ {/* tab */} + { + // @todo #1 Party View - implement interactive tab + } +
+
    +
  • แบ่งเขต(31)
  • +
  • บัญชีรายชื่อ (13)
  • +
+
+ + {/* list */} +
+ {data.map(item => ( +
+ +
+
{item.name}
+
{item.zone}
+
+
+ + {item.vote.replace(/(\d)(?=(\d{3})+(?!\d))/g, "$1,")} + {" "} + - {item.percentage}% +
+
+ ))} +
+
+
+ ) +} diff --git a/src/components/PerPartyView.js b/src/components/PerPartyView.js index e9618ff..18db89f 100644 --- a/src/components/PerPartyView.js +++ b/src/components/PerPartyView.js @@ -6,6 +6,7 @@ import { FontAwesomeIcon } from "@fortawesome/react-fontawesome" import ErrorBoundary from "./ErrorBoundary" import ElectionMapContainer from "./ElectionMapContainer" import { Link } from "gatsby" +import PerPartyMemberVoteResult from "./PerPartyMemberVoteResult" export default function PerPartyView() { return ( @@ -26,7 +27,7 @@ export default function PerPartyView() { > - + ) @@ -122,23 +123,3 @@ function ZoneMapView() { ) } - -// @todo #1 show each party vote result -function ZonePartyVoteResult() { - return ( -
- {/* right zone */} -
ประมาณจำนวน สส. ที่ได้
-
- ) -}