Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Icon cutoff fix #68

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions client/src/App.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { Component } from 'react';
import EpicMenu from './EpicMenu';
import Menu from './Menu';

import logo from './logo.png';
class App extends Component {
Expand All @@ -13,7 +13,7 @@ class App extends Component {

return (
<div className="container center">
<EpicMenu links={links} logo={logo} />
<Menu links={links} logo={logo} />
</div>
);
}
Expand Down
4 changes: 2 additions & 2 deletions client/src/Menu.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
background-color: white;
box-shadow: 0px 2px 24px 0px rgba(0, 0, 0, 0.15);
border-radius: 8px;
width: 752px;
height: 80px;
width: 800px;
height: 120px;
display: flex;
justify-content: space-between;
padding: 0 40px;
Expand Down
11 changes: 6 additions & 5 deletions client/src/Menu.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { Component } from 'react';
import './EpicMenu.css';
import './Menu.css';
import searchIcon from './search-icon.png';

class Menu extends Component {
Expand Down Expand Up @@ -28,8 +28,8 @@ class Menu extends Component {
let linkMarkup = link.active ? (
<a className="menu__link menu__link--active" href={link.link}>{link.label}</a>
) : (
<a className="menu__link" href={link.link}>{link.label}</a>
);
<a className="menu__link" href={link.link}>{link.label}</a>
);

return (
<li key={index} className="menu__list-item">
Expand All @@ -41,7 +41,8 @@ class Menu extends Component {
return (
<nav className="menu">
<h1 style={{
backgroundImage: 'url(' + this.props.logo + ')'
backgroundImage: 'url(' + this.props.logo + ')',
width: '120px'
}} className="menu__logo">Epic Co.</h1>

<div className="menu__right">
Expand All @@ -50,7 +51,7 @@ class Menu extends Component {
</ul>

<button onClick={this.showForm.bind(this)} style={{
backgroundImage: 'url(' + searchIcon + ')'
backgroundImage: 'url(' + searchIcon + ')'
}} className="menu__search-button"></button>

{searchForm}
Expand Down
126 changes: 75 additions & 51 deletions client/src/pages/SignUpForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,66 +2,90 @@ import React, { Component } from 'react';
import { Link } from 'react-router-dom';

class SignUpForm extends Component {
constructor() {
super();
constructor() {
super();

this.state = {
email: '',
password: '',
name: '',
hasAgreed: false
};
this.state = {
email: '',
password: '',
name: '',
hasAgreed: false,
disabledButtonColor: '#9fcfff',
disabledTextColor: '#808080'
};

this.handleChange = this.handleChange.bind(this);
this.handleSubmit = this.handleSubmit.bind(this);
}
this.handleChange = this.handleChange.bind(this);
this.handleSubmit = this.handleSubmit.bind(this);
}

handleChange(e) {
let target = e.target;
let value = target.type === 'checkbox' ? target.checked : target.value;
let name = target.name;
handleChange(e) {
let target = e.target;
let value = target.type === 'checkbox' ? target.checked : target.value;
let name = target.name;

this.setState({
[name]: value
});
}
this.setState({
[name]: value
});
}

handleSubmit(e) {
e.preventDefault();
handleSubmit(e) {
e.preventDefault();

console.log('The form was submitted with the following data:');
console.log(this.state);
}
console.log('The form was submitted with the following data:');
console.log(this.state);
}

render() {

render() {
return (
let content = null;
if (this.state.email.length && this.state.password.length && this.state.name.length && this.state.hasAgreed) {
content = <button className="FormField__Button mr-20"
onClick={() => { console.log(this.state.isValid) }}
>Sign Up</button>
}
else {
content = <button className="FormField__Button mr-20"
style={
{
backgroundColor: this.state.disabledButtonColor,
color: this.state.disabledTextColor
}
}
disabled
>Sign Up</button>
}

return (
<div className="container">
<div className="FormCenter">
<form onSubmit={this.handleSubmit} className="FormFields">
<div className="FormField">
<label className="FormField__Label" htmlFor="name">Full Name</label>
<input type="text" id="name" className="FormField__Input" placeholder="Enter your full name" name="name" value={this.state.name} onChange={this.handleChange} />
</div>
<div className="FormField">
<label className="FormField__Label" htmlFor="password">Password</label>
<input type="password" id="password" className="FormField__Input" placeholder="Enter your password" name="password" value={this.state.password} onChange={this.handleChange} />
</div>
<div className="FormField">
<label className="FormField__Label" htmlFor="email">E-Mail Address</label>
<input type="email" id="email" className="FormField__Input" placeholder="Enter your email" name="email" value={this.state.email} onChange={this.handleChange} />
</div>
<form onSubmit={this.handleSubmit} className="FormFields">
<div className="FormField">
<label className="FormField__Label" htmlFor="name">Full Name</label>
<input type="text" id="name" className="FormField__Input" placeholder="Enter your full name" name="name" value={this.state.name} onChange={this.handleChange} />
</div>
<div className="FormField">
<label className="FormField__Label" htmlFor="password">Password</label>
<input type="password" id="password" className="FormField__Input" placeholder="Enter your password" name="password" value={this.state.password} onChange={this.handleChange} />
</div>
<div className="FormField">
<label className="FormField__Label" htmlFor="email">E-Mail Address</label>
<input type="email" id="email" className="FormField__Input" placeholder="Enter your email" name="email" value={this.state.email} onChange={this.handleChange} />
</div>

<div className="FormField">
<label className="FormField__CheckboxLabel">
<input className="FormField__Checkbox" type="checkbox" name="hasAgreed" value={this.state.hasAgreed} onChange={this.handleChange} /> I agree all statements in <a href="" className="FormField__TermsLink">terms of service</a>
</label>
</div>
<div className="FormField">
<label className="FormField__CheckboxLabel">
<input className="FormField__Checkbox" type="checkbox" name="hasAgreed" value={this.state.hasAgreed} onChange={this.handleChange} /> I agree all statements in <a href="" className="FormField__TermsLink">terms of service</a>
</label>
</div>

<div className="FormField">
<button className="FormField__Button mr-20">Sign Up</button> <Link to="/sign-in" className="FormField__Link">I'm already member</Link>
</div>
</form>
</div>
);
}
<div className="FormField">
{content}
<Link to="/sign-in" className="FormField__Link">I'm already member</Link>
</div>
</form>
</div>
</div>
);
}
}
export default SignUpForm;