-
Notifications
You must be signed in to change notification settings - Fork 145
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #119 from AimeTPGM/party-member-vote
Party member vote result panel
- Loading branch information
Showing
2 changed files
with
107 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 ( | ||
<div | ||
css={{ | ||
[media(DESKTOP_MIN_WIDTH)]: { | ||
display: "block", | ||
order: 3, | ||
margin: "0", | ||
padding: "16px", | ||
width: "320px", | ||
textAlign: "center", | ||
}, | ||
}} | ||
> | ||
<h2 css={{ fontFamily: DISPLAY_FONT }}>ประมาณจำนวน สส. ที่ได้</h2> | ||
<div> | ||
{/* tab */} | ||
{ | ||
// @todo #1 Party View - implement interactive tab | ||
} | ||
<div> | ||
<ul | ||
css={{ | ||
display: "flex", | ||
listStyle: "none", | ||
padding: 0, | ||
margin: 0, | ||
width: "100%", | ||
}} | ||
> | ||
<li css={{ ...tabHeaderStyle, ...active }}>แบ่งเขต(31)</li> | ||
<li css={{ ...tabHeaderStyle }}>บัญชีรายชื่อ (13)</li> | ||
</ul> | ||
</div> | ||
|
||
{/* list */} | ||
<div css={{ textAlign: "left", padding: "5px" }}> | ||
{data.map(item => ( | ||
<div | ||
css={{ display: "flex", position: "relative", marginTop: "15px" }} | ||
> | ||
<img | ||
src={require(`../styles/images/pmcan/1-s.png`)} | ||
css={{ width: "30px", height: "30px", borderRadius: "50%" }} | ||
/> | ||
<div css={{ marginLeft: "5px", fontFamily: DISPLAY_FONT }}> | ||
<div css={{ fontWeight: "bold" }}>{item.name}</div> | ||
<div css={{ fontSize: "0.8em" }}>{item.zone}</div> | ||
</div> | ||
<div css={{ float: "right", position: "absolute", right: 0 }}> | ||
<span css={{ fontWeight: "bold" }}> | ||
{item.vote.replace(/(\d)(?=(\d{3})+(?!\d))/g, "$1,")} | ||
</span>{" "} | ||
- {item.percentage}% | ||
</div> | ||
</div> | ||
))} | ||
</div> | ||
</div> | ||
</div> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3a201df
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Puzzle
1-edaaced4
disappeared fromsrc/components/ZonePartyView.js
, that's why I closed #117. Please, remember that the puzzle was not necessarily removed in this particular commit. Maybe it happened earlier, but we discovered this fact only now.3a201df
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Puzzle
1-50f0f6bf
discovered insrc/components/PerPartyMemberVoteResult.js
and submitted as #120. Please, remember that the puzzle was not necessarily added in this particular commit. Maybe it was added earlier, but we discovered it only now.3a201df
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Puzzle
1-c71f393e
discovered insrc/components/PerPartyMemberVoteResult.js
and submitted as #122. Please, remember that the puzzle was not necessarily added in this particular commit. Maybe it was added earlier, but we discovered it only now.