Skip to content

Commit

Permalink
Merge pull request #1 from pusher/update-ui
Browse files Browse the repository at this point in the history
update UI
  • Loading branch information
HannaLTC authored Jan 19, 2021
2 parents e74e63a + b7c1c5c commit 2f64fac
Show file tree
Hide file tree
Showing 13 changed files with 320 additions and 114 deletions.
Binary file removed src/Blue icon.png
Binary file not shown.
4 changes: 4 additions & 0 deletions src/images/arrow-left.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions src/images/pusher-logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 0 additions & 1 deletion src/logo.svg

This file was deleted.

109 changes: 109 additions & 0 deletions src/userComponents/details/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
import arrow from "../../images/arrow-left.svg";

export default function Modal(props) {
return (
<div style={{ display: "flex", flexDirection: "row", width: "100%" }}>
<div style={{}}>
<button
style={{
color: "white",
backgroundColor: "#7F7FA3",
borderRadius: "4px",
fontSize: "16px",
lineHeight: "28px",
fontWeight: 600,
padding: "4px 16px",
border: "none",
cursor: "pointer",
marginBottom: "12px",
marginTop: "16px",
}}
onClick={() => props.setShowDetails(false)}
>
<img src={arrow} alt="" /> Back
</button>
<h3
style={{
position: "relative",
fontWeight: 500,
fontSize: "34px",
lineHeight: "48px",
fontFamily: "Maison Neue",
color: "#300D4F",
marginTop: "40px",
marginBottom: "32px",
paddingLeft: "16px",
}}
>
<div
style={{
position: "absolute",
left: "0px",
top: "0px",
backgroundColor: props.col,
height: "48px",
width: "4px",
}}
/>
{props.candidate}
</h3>

<table
style={{
textAlign: "left",
width: "727px",
borderCollapse: "collapse",
marginBottom: "24px",
}}
>
<thead
style={{
color: "#300D4F",
fontSize: "20px",
lineHeight: "34px",
fontFamily: "Maison Neue",
}}
>
<tr
style={{
backgroundColor: "#F7F5FF",
padding: "11px 16px",
height: "56px",
}}
>
<th
style={{ paddingLeft: "16px", fontWeight: 500, width: "241px" }}
>
Region Name
</th>
<th style={{ fontWeight: 500, width: "250px" }}>Votes</th>
<th style={{ fontWeight: 500 }}>Status</th>
</tr>
</thead>
<tbody>
{props.regions.map((region, i) => {
return (
<tr
style={{
backgroundColor: i % 2 === 0 ? "white" : "#F7F5FF",
color: "#6A52FF",
height: "40px",
fontFamily: "Maison Neue",
fontSize: "20px",
lineHeight: "34px",
}}
>
<td style={{ paddingLeft: "16px", fontWeight: 500 }}>
{region[1]}
</td>
<td style={{ fontWeight: 500 }}>{region[props.index + 2]}</td>
<td style={{ fontWeight: 500 }}>{region[10]}</td>
</tr>
);
})}
</tbody>
</table>
</div>
</div>
);
}
54 changes: 45 additions & 9 deletions src/userComponents/footer/footer.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,51 @@
import sampleData from './allregions'
import sampleData from "./allregions";
export default function Footer() {
return (
<div>
<main style={{display:"flex",flexDirection:"column", justifyContent:"space-around", bottom:0, left:"0%"}}>
<h4 style={{color: "#300D4F" , width:"100%", fontFamily:"Maison Neue", fontWeight: 500, fontSize: "20px"}}>Available regions</h4>
<div className="" style={{display:"flex", flexDirection:"row", }}>
{sampleData.map((navigation)=>{
return <h4 style={{fontStyle:"normal",fontSize:"20px", fontWeight:"500", margin: "2px", fontFamily:"Maison Neue", color:"#8282AE"}}>{navigation},</h4>
})}
</div>
<main
style={{
display: "flex",
flexDirection: "column",
justifyContent: "space-around",
bottom: 0,
left: "0%",
marginBottom: "100px",
}}
>
<h4
style={{
color: "#300D4F",
width: "100%",
fontFamily: "Maison Neue",
fontWeight: 500,
fontSize: "20px",
lineHeight: "34px",
margin: "0px",
marginTop: "24px",
}}
>
Available regions
</h4>
<div className="" style={{ display: "flex", flexDirection: "row" }}>
{sampleData.map((navigation) => {
return (
<h4
style={{
fontStyle: "normal",
fontSize: "20px",
lineHeight: "34px",
fontWeight: "500",
margin: "2px",
fontFamily: "Maison Neue",
color: "#8282AE",
}}
>
{navigation},
</h4>
);
})}
</div>
</main>
</div>
)
);
}
47 changes: 40 additions & 7 deletions src/userComponents/header/nav/nav.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,43 @@
import navigations from './navlinks'
import logo from "../pusher_logo.png"
export default function Nav() {
return (
<main style={{display:"flex", flexDirection: "column", width:"540px"}}>
<div style={{display:"flex", justifyContent:"center",paddingBottom:"0%", width:"106px", height:"28px", border:"none", borderRadius:"31px", backgroundColor: "#EBEAF4"}}><h4 style={{fontFamily:"Maison Neue", fontSize:"16px", color:"#300D4F",marginTop:"4px" }} >Polling app</h4></div>
<span style={{display:"flex", flexDirection: "row", fontFamily:"Maison Neue", fontSize:"46px", color:"#300D4F", fontWeight:"500" }} >Pusher Tutorial</span>
</main>
)
<main style={{ display: "flex", flexDirection: "column" }}>
<div
style={{
display: "flex",
justifyContent: "center",
paddingBottom: "0%",
width: "106px",
height: "28px",
border: "none",
borderRadius: "31px",
backgroundColor: "#EBEAF4",
}}
>
<h4
style={{
fontFamily: "Maison Neue",
fontSize: "16px",
fontWeight: "600",
color: "#300D4F",
marginTop: "4px",
}}
>
Polling app
</h4>
</div>
<span
style={{
display: "flex",
flexDirection: "row",
fontFamily: "Maison Neue",
fontSize: "46px",
color: "#300D4F",
fontWeight: "500",
marginTop: "13px",
}}
>
Pusher Tutorial
</span>
</main>
);
}
5 changes: 0 additions & 5 deletions src/userComponents/header/nav/navlinks.js

This file was deleted.

Binary file removed src/userComponents/header/pusher_logo.png
Binary file not shown.
34 changes: 0 additions & 34 deletions src/userComponents/modal/index.js

This file was deleted.

90 changes: 71 additions & 19 deletions src/userComponents/state/index.js
Original file line number Diff line number Diff line change
@@ -1,24 +1,76 @@
import { useState } from "react"

import Modal from "../modal/index"
export default function State(props) {
console.log(props)
const [display, setDisplay] = useState('none')
return (
<main style={{ }}>
<div style={{display:"flex", flexDirection:"row", justifyContent: "space-between", height:"76px",backgroundColor:"#F2F1F9", marginBottom:"24px", borderRadius:"8px"}}>
<main style={{}}>
<div
style={{
display: "flex",
justifyContent: "space-between",
alignItems: "center",
backgroundColor: "#F7F5FF",
marginBottom: "24px",
padding: "9px 16px 8px 28px",
}}
>
<div>
<h4 style={{color: "#300D4F",fontFamily:"Maison Neue", fontWeight:500, fontSize:"20px", letterSpacing: "0.5px", marginTop:"-2px", marginBottom:"-4px",marginLeft:"16px"}}><span style={{color: props.color, fontSize:"30px", fontWeight:900}}>|</span> {props.name}</h4>
<div>
<p style={{marginLeft:"28px",fontFamily:"Maison Neue", color: "#300D4F", fontWeight:700}}>Total votes: {props.total.message[props.index + 6]} </p>
</div>
</div>
<h4
style={{
color: "#300D4F",
fontFamily: "Maison Neue",
fontWeight: 500,
fontSize: "20px",
lineHeight: "34px",
letterSpacing: "0.5px",
margin: "0px",
position: "relative",
}}
>
<div
style={{
position: "absolute",
left: "-11px",
top: "4px",
backgroundColor: props.color,
height: "24px",
width: "4px",
}}
/>
{props.name}
</h4>
<div>
<p
style={{
fontFamily: "Maison Neue",
color: "#300D4F",
fontWeight: 700,
fontSize: "16px",
lineHeight: "24px",
margin: "0px",
marginTop: "1px",
}}
>
Total votes: {props.total.message[props.index + 6]}{" "}
</p>
</div>
</div>
<div>
<button style={{marginRight: "20px", marginTop: "30px", color: "white", backgroundColor:"#7F7FA3", width:"71px", height: "36px", borderRadius:"4px"}} onClick={()=>setDisplay("")}>More</button>
{/* <button>bid</button> */}
</div>
</div>
<Modal index={props.index} display={display} regions={props.data} src={props.src} setDisplay={setDisplay} col={props.color} candidate={props.name} />
</main>
)
<button
style={{
color: "white",
backgroundColor: "#7F7FA3",
borderRadius: "4px",
fontSize: "16px",
lineHeight: "28px",
fontWeight: 600,
padding: "4px 16px",
border: "none",
cursor: "pointer",
}}
onClick={() => props.setShowDetails(props.index)}
>
More
</button>
</div>
</div>
</main>
);
}
Loading

0 comments on commit 2f64fac

Please sign in to comment.