Skip to content

Commit 4c47d44

Browse files
Merge pull request #13 from lambda-mud/irvingduran
Irvingduran
2 parents 32cc655 + 0f6891c commit 4c47d44

19 files changed

Lines changed: 856 additions & 181 deletions

File tree

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
"axios": "^0.19.0",
99
"react": "^16.8.6",
1010
"react-dom": "^16.8.6",
11+
"react-draggable": "^3.3.0",
1112
"react-google-maps": "^9.4.5",
1213
"react-redux": "^7.1.0",
1314
"react-router": "^5.0.1",

src/App.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import {
1010
import GamePage from "./components/Gamepage/GamePage.js";
1111
import NotFound from "./components/PageNotFound/NotFound";
1212
import LoggedInNav from "./components/Header/LoggedInNav";
13+
import Aboutpage from "./components/AboutUs/aboutUs";
1314

1415
function App() {
1516
return (
@@ -21,6 +22,7 @@ function App() {
2122
<Switch>
2223
<Route path="/sign-up" component={SignUp} />
2324
<Route path="/log-in" component={Login} />
25+
<Route path="/team" component={Aboutpage} />
2426
<ProtectedRoute exact path="/" component={GamePage} />
2527
<Route path="*" component={NotFound} />
2628
</Switch>

src/components/AboutUs/aboutUs.js

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
import React, { Component } from "react";
2+
import "./index.css";
3+
4+
export default class Aboutpage extends Component {
5+
render() {
6+
return (
7+
<div className="homepage-container about">
8+
<div className="info team">
9+
<div className="member">
10+
<h1>Team Lead</h1>
11+
<img
12+
src="https://avatars1.githubusercontent.com/u/3112234?s=460&v=4"
13+
alt=""
14+
className="profileImg"
15+
/>
16+
<h2>Daniel Weinman</h2>
17+
</div>
18+
<div className="member">
19+
<h1>Back-End</h1>
20+
<img
21+
src="https://avatars1.githubusercontent.com/u/4283962?s=460&v=4"
22+
alt=""
23+
className="profileImg"
24+
/>
25+
<h2>Divya Nair</h2>
26+
</div>
27+
<div className="member">
28+
<h1>Back-End</h1>
29+
<img
30+
src="https://avatars0.githubusercontent.com/u/30749439?s=460&v=4"
31+
alt=""
32+
className="profileImg"
33+
/>
34+
<h2>Anubhav Bhambri</h2>
35+
</div>
36+
<div className="member">
37+
<h1>Back-End</h1>
38+
<img
39+
src="https://avatars2.githubusercontent.com/u/47379051?s=460&v=4"
40+
alt=""
41+
className="profileImg"
42+
/>
43+
<h2>Benjamin Chandler</h2>
44+
</div>
45+
<div className="member">
46+
<h1>Front-End</h1>
47+
<img
48+
src="https://avatars3.githubusercontent.com/u/47460334?s=460&v=4"
49+
alt=""
50+
className="profileImg"
51+
/>
52+
<h2>Josefia Magagnoli</h2>
53+
</div>
54+
<div className="member">
55+
<h1>Front-End</h1>
56+
<img
57+
src="https://avatars2.githubusercontent.com/u/32081816?s=460&v=4"
58+
alt=""
59+
className="profileImg"
60+
/>
61+
<h2>Irving Duran</h2>
62+
</div>
63+
</div>
64+
</div>
65+
);
66+
}
67+
}

src/components/AboutUs/index.css

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
.about {
2+
/* display: flex;
3+
align-items: center;
4+
justify-content: center; */
5+
margin-top: 60px;
6+
}
7+
.team {
8+
display: flex;
9+
flex-wrap: wrap;
10+
justify-content: center;
11+
margin: auto;
12+
}
13+
.member {
14+
width: 250px;
15+
margin: 10px;
16+
}
17+
.profileImg {
18+
width: 100%;
19+
border-radius: 100%;
20+
}

src/components/Gamepage/Dashboard/Dashboard.js

Lines changed: 165 additions & 77 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,72 @@
11
import React, { Component } from "react";
2-
import "./index.css"
2+
import "./index.css";
33

44
export default class Dashboard extends Component {
5+
getRandomArbitrary(min, max) {
6+
return Math.random() * (max - min) + min;
7+
}
8+
9+
buttonStyle = { color: "white", minWidth: "80px" };
10+
11+
directionDisabled = element => {
12+
if (element === 0) {
13+
return true;
14+
}
15+
};
16+
17+
directionHeader = () => {
18+
if (this.props.disableButton === true) {
19+
return <h2>You need gas money to travel!</h2>;
20+
} else {
21+
return <h2>Where to next?</h2>;
22+
}
23+
};
24+
25+
canWork = () => {
26+
const webJob = Math.floor(this.getRandomArbitrary(90, 500));
27+
if (this.props.currentRoom.map(e => e.can_make_money)[0] === true) {
28+
return (
29+
<div style={{ display: "flex", justifyContent: "space-between" }}>
30+
<p>Someone needs a HTML website for ${webJob}</p>
31+
<button
32+
name="job"
33+
value={webJob}
34+
onClick={this.props.moneyTransaction}
35+
className="authButton build"
36+
style={{ color: "white", minWidth: "80px" }}
37+
>
38+
Build
39+
</button>
40+
</div>
41+
);
42+
} else {
43+
return "";
44+
}
45+
};
46+
547
render() {
6-
const players = [this.props.players];
48+
// const players = [this.props.players];
749
// console.log(players);
50+
const north = this.props.currentRoom.map(e => e.n_to)[0];
51+
const west = this.props.currentRoom.map(e => e.w_to)[0];
52+
const south = this.props.currentRoom.map(e => e.s_to)[0];
53+
const east = this.props.currentRoom.map(e => e.e_to)[0];
54+
const canmakemoney = this.props.currentRoom.map(e => e.can_make_money)[0];
55+
console.log("north", north, this.directionDisabled(north));
56+
console.log("west", west, this.directionDisabled(west));
57+
console.log("south", south, this.directionDisabled(south));
58+
console.log("east", east, this.directionDisabled(east));
59+
60+
// const webJob = Math.floor(this.getRandomArbitrary(90, 500));
61+
62+
console.log(canmakemoney);
863

964
return (
1065
<div>
11-
{/* player info */}
1266
<div>
67+
{/* {this.directionDisabled(this.props.currentRoom.map(e => e.w_to))} */}
1368
<h3>Player Info</h3>
69+
1470
<div
1571
style={{
1672
display: "flex"
@@ -20,93 +76,125 @@ export default class Dashboard extends Component {
2076
<p>Welcome back {this.props.name}!</p>
2177
<p style={{ paddingBottom: "30px" }}>
2278
{/* Current Location: <br /> */}
23-
<i class="fas location fa-location-arrow"></i>
79+
<i class="fas location fa-location-arrow" />
2480
{this.props.title}
2581
</p>
2682
</div>
2783
<div className="money">
28-
<i className="fas fa-money-bill-wave"></i>
84+
<i className="fas fa-money-bill-wave" />
2985

3086
<h3>{this.props.cash}</h3>
31-
87+
</div>
3288
</div>
33-
</div>
34-
{/* Other players in this location */}
35-
<div>
36-
<hr />
37-
<h3>Players in this State</h3>
38-
{/* {this.players} */}
89+
{/* Other players in this location */}
3990
<div>
40-
{this.props.players.length > 0 &&
41-
this.props.players.map(player => {
42-
return <div>{player}</div>;
43-
})}
91+
<hr />
92+
<h3>Players in this State</h3>
93+
{/* {this.players} */}
94+
<div style={{ display: "flex", flexWrap: "wrap" }}>
95+
{this.props.players.length > 0 &&
96+
this.props.players.map(player => {
97+
return <div style={{ margin: "0 3px" }}>{player}</div>;
98+
})}
99+
</div>
44100
</div>
45-
</div>
46-
{/* actions */}
47-
<div>
101+
{/* actions */}
48102
<div>
49-
<h2>Actions:</h2>
50-
<div style={{ display: "flex", justifyContent:"space-between" }}>
51-
<p>Someone needs a HTML website for $400</p>
52-
<button
53-
name="job"
54-
value="400"
55-
className="build"
56-
onClick={this.props.moneyTransaction}
57-
>
58-
build
59-
</button>
60-
</div>
61-
<div style={{ display: "flex", justifyContent:"space-between" }}>
62-
<p>4 Star resturant -$100</p>
63-
<button
64-
name="job"
65-
value="-100"
66-
className="eat"
67-
onClick={this.props.moneyTransaction}
68-
>
69-
eat
70-
</button>
71-
</div>
72-
<div style={{ display: "flex", justifyContent:"space-between" }}>
73-
<p>Pizza -$4</p>
74-
<button
75-
name="job"
76-
value="-4"
77-
className="eat"
78-
onClick={this.props.moneyTransaction}
79-
>
80-
eat
81-
</button>
103+
<div>
104+
<h2>Actions:</h2>
105+
{this.canWork()}
106+
<div style={{ display: "flex", justifyContent: "space-between" }}>
107+
<p>4 Star resturant -$100</p>
108+
<button
109+
name="job"
110+
value="-100"
111+
onClick={this.props.moneyTransaction}
112+
className="authButton eat"
113+
style={{ color: "white", minWidth: "80px" }}
114+
disabled={this.props.disableButton}
115+
>
116+
Eat
117+
</button>
118+
</div>
119+
<div style={{ display: "flex", justifyContent: "space-between" }}>
120+
<p>Pizza -$4</p>
121+
<button
122+
name="job"
123+
value="-4"
124+
onClick={this.props.moneyTransaction}
125+
className="authButton eat"
126+
style={{ color: "white", minWidth: "80px" }}
127+
disabled={this.props.disableButton}
128+
>
129+
Eat
130+
</button>
131+
</div>
132+
{/* <div style={{ display: "flex", justifyContent: "space-between" }}>
133+
<p>Someone needs a HTML website for ${webJob}</p>
134+
<button
135+
name="job"
136+
value={webJob}
137+
onClick={this.props.moneyTransaction}
138+
className="authButton build"
139+
style={{ color: "white", minWidth: "80px" }}
140+
>
141+
Build
142+
</button>
143+
</div> */}
82144
</div>
83-
{/* <p>stuff</p>
84-
<p>stuff</p> */}
85145
</div>
86-
{/* <div>
87-
<input />
88-
<button>Do</button>
89-
</div> */}
90-
</div>
91-
{/* move direction buttons */}
92-
<h2>Where to next?</h2>
93-
<div className="directionContainer">
94-
<button className="direction ns" name="n" value="n" onClick={this.props.sendRequest}>
95-
N
96-
</button>
97-
<br></br>
98-
<button className="direction" name="w" value="w" onClick={this.props.sendRequest}>
99-
W
100-
</button>
101-
<button className="direction" name="e" value="e" onClick={this.props.sendRequest}>
102-
E
103-
</button>
104-
<br></br>
105-
<button className="direction ns" name="s" value="s" onClick={this.props.sendRequest}>
106-
S
107-
</button>
146+
{/* move direction buttons */}
147+
{/* <h2>Where to next?</h2> */}
148+
{this.directionHeader()}
149+
<div className="directionContainer">
150+
<button
151+
className="direction ns"
152+
name="n"
153+
value="n"
154+
onClick={this.props.sendRequest}
155+
disabled={
156+
this.directionDisabled(north) || this.props.disableButton
157+
}
158+
>
159+
N
160+
</button>
161+
<br />
162+
<button
163+
className="direction"
164+
name="w"
165+
value="w"
166+
onClick={this.props.sendRequest}
167+
disabled={
168+
this.directionDisabled(west) || this.props.disableButton
169+
}
170+
>
171+
W
172+
</button>
173+
<button
174+
className="direction"
175+
name="e"
176+
value="e"
177+
onClick={this.props.sendRequest}
178+
disabled={
179+
this.directionDisabled(east) || this.props.disableButton
180+
}
181+
>
182+
E
183+
</button>
184+
<br />
185+
<button
186+
className="direction ns"
187+
name="s"
188+
value="s"
189+
onClick={this.props.sendRequest}
190+
disabled={
191+
this.directionDisabled(south) || this.props.disableButton
192+
}
193+
>
194+
S
195+
</button>
196+
</div>
108197
</div>
109-
</div>
110198
</div>
111199
);
112200
}

0 commit comments

Comments
 (0)