Skip to content
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
18 changes: 9 additions & 9 deletions app/containers/login/login.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { React } from 'globalImports'
import { React, Link } from 'globalImports'

const validEmailRegex = new RegExp(/[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?/)
const validPasswordRegex = new RegExp(/^(?=.*?[A-Z])(?=.*?[a-z])(?=.*?[0-9]).{8,}$/)
Expand All @@ -15,29 +15,30 @@ export default class Login extends React.Component {
validPassword: false,
error: ''
}
this.handleSubmit = this.handleSubmit.bind(this)
this.handleInput = this.handleInput.bind(this)
this.renderSubmit = this.renderSubmit.bind(this)
this.resetForm = this.resetForm.bind(this)
}



renderLogin() {

return (
<div className="login-render-container">
<h1>Sign In</h1>
{this.renderError()}
<input type="text" placeholder={this.state.placeholderEmail} onChange={this.handleSubmit} ref="emailInput"/>
<input type="password" placeholder={this.state.placeholderPassword} onChange={this.handleSubmit} ref="passwordInput"/>
<input type="text" placeholder={this.state.placeholderEmail} onChange={this.handleInput} ref="emailInput"/>
<input type="password" placeholder={this.state.placeholderPassword} onChange={this.handleInput} ref="passwordInput"/>
{this.renderSubmit()}
<button className="reset-button" onClick={this.resetForm}>Reset</button>
<Link to="/signup">
<button>SignUp</button>
</Link>
</div>
)
}
// TODO: render submit as unclickable when email and password aren't valid
// then if it is valid become clickable
handleSubmit(event) {

handleInput(event) {
event.preventDefault()
const validEmail = this.state.validEmail
const validPassword = this.state.validPassword
Expand Down Expand Up @@ -115,7 +116,6 @@ export default class Login extends React.Component {
password: '',
validPassword: false,
})
// this.render()
}

renderError() {
Expand Down
21 changes: 15 additions & 6 deletions app/containers/menu/menu.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import { React } from "globalImports"
import { React, Link } from "globalImports"
import Login from '../login/login'


export default class Menu extends React.Component {

Expand All @@ -18,13 +20,13 @@ export default class Menu extends React.Component {
this.setState({
services_clicked : x
})
console.log("toggle")
}

renderFAQ() {
const faq = 'FAQ'
return (
<div>
<button className="secondary-buttons">FAQ</button>
<button className="secondary-buttons">{faq}</button>
</div>
)
}
Expand Down Expand Up @@ -79,9 +81,13 @@ export default class Menu extends React.Component {

renderAuthButtons(){
if(this.state.authed){
return <div>
<button className="auth-button primary-buttons">Login</button>
</div>
return (
<div>
<Link to="/login" activeClassName="active">
<button className="auth-button primary-buttons">Login</button>
</Link>
</div>
)
}
else{
return <div>
Expand Down Expand Up @@ -131,6 +137,9 @@ export default class Menu extends React.Component {
<div>
{this.renderServicesMenu()}
</div>
<div>
{this.props.children}
</div>
</div>
)
}
Expand Down
2 changes: 2 additions & 0 deletions app/containers/menu/menu.scss
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@
width: 100%;
align-items: center;
padding-left: 5%;
z-index: 100;
position: absolute;
}

.services-menu-button {
Expand Down
50 changes: 50 additions & 0 deletions app/containers/services_offered/services_offered.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
import { React, Link } from 'globalImports'

export default class Services extends React.Component {
constructor(props) {
super(props)
this.state = {
services :
[
'Birth Control',
'Urinary Tract Infection',
'Erectyle Disfunction',
'Sinus Infection',
'Acid Reflux',
'Acne',
'Flu',
'Hair Loss'
]
}
this.renderServiceBox = this.renderServiceBox.bind(this)
}
renderServiceBox() {
const Services = ({services}) => (
<div>

{services.map(service => (
<button className="services-offered-button">
{/* <Link to={`/service/${service}`}> TODO:add services links to separate pages*/}
{service}
{/* </Link> */}
</button>
))}

</div>
)

return (
<Services services={this.state.services} />
)
}



render() {
return (
<div className="services-offered-container">
{this.renderServiceBox()}
</div>
)
}
}
22 changes: 22 additions & 0 deletions app/containers/services_offered/services_offered.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
.services-offered-container {
border: 2px solid black;
display: flex;
justify-content: space-around;
align-items: center;
flex-direction: column;
flex-wrap: wrap;
height: 40rem;
width: 80%;
margin-left: 10%;
padding: 10%;
}
.services-offered-button {
margin-top: 2.5%;
margin-left: 2.5%;
margin-right: 2.5%;
height: 7rem;
width: 10rem;
background-color: white;
color: blue;
font-size: 12px;
}
Loading