-
Notifications
You must be signed in to change notification settings - Fork 5
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 #92 from boacausa/adoption-flow
Create adoption flow with new layout
- Loading branch information
Showing
57 changed files
with
1,011 additions
and
73 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
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
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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
class AdoptionController < UserAreaController | ||
def index | ||
@pets = Pet.actived | ||
@pets = Pet.active | ||
end | ||
|
||
def show | ||
|
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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
class NgosController < UserAreaController | ||
def index | ||
@ngos = Ngo.actived | ||
@ngos = Ngo.active | ||
end | ||
|
||
def show | ||
|
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
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,29 @@ | ||
class V1::PetsForAdoptionController < ApplicationController | ||
skip_before_action :verify_authenticity_token | ||
|
||
def index | ||
render json: { | ||
pets: ListPets.new.all(Pet.active, params[:user_email]) | ||
}.to_json | ||
end | ||
|
||
def register_interest | ||
response = { success: "Finished with success" } | ||
status = :ok | ||
|
||
begin | ||
::RegisterAdoptionInterest.new.save!(register_interest_params[:user_email], register_interest_params[:pet_id]) | ||
rescue ActiveRecord::RecordNotFound | ||
response = { error: "User not found" } | ||
status = :not_found | ||
end | ||
|
||
render json: response.to_json, status: status | ||
end | ||
|
||
private | ||
|
||
def register_interest_params | ||
params.require(:register_interest).permit(:user_email, :pet_id) | ||
end | ||
end |
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
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,8 @@ | ||
import React from 'react'; | ||
import styles from './Backdrop.sass'; | ||
|
||
const backdrop = (props) => ( | ||
props.show ? <div className={styles.Backdrop} onClick={props.clicked}></div> : null | ||
); | ||
|
||
export default backdrop; |
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,8 @@ | ||
.Backdrop | ||
width: 100% | ||
height: 100% | ||
position: fixed | ||
z-index: 100 | ||
left: 0 | ||
top: 0 | ||
background-color: rgba(0, 0, 0, 0.5) |
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,18 @@ | ||
import React from 'react'; | ||
import styles from './SelectInput.sass'; | ||
|
||
const SelectInput = (props) => { | ||
return ( | ||
<div className={styles.SelectInput} style={{width: props.width, marginRight: props.marginRight}}> | ||
<label>{props.label}</label> | ||
<select name="color"> | ||
<option value="">{props.placeholder}</option> | ||
{props.options && props.options.length > 0 && props.options.map(opt => { | ||
return <option key={opt.id} value={opt.id}>{opt.name}</option> | ||
})} | ||
</select> | ||
</div> | ||
); | ||
}; | ||
|
||
export default SelectInput; |
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,29 @@ | ||
.SelectInput | ||
border: 0 | ||
border-radius: 4px | ||
margin-bottom: 10px | ||
width: 200px | ||
height: 50px | ||
background-color: #ebebeb | ||
font-size: 0 | ||
padding: 6px | ||
|
||
*:focus | ||
outline: none | ||
|
||
.SelectInput label | ||
font-size: 10px | ||
font-family: Roboto, sans-serif | ||
color: #9b9b9b | ||
padding: 2px 8px 0 | ||
margin-bottom: 0 | ||
|
||
.SelectInput select | ||
color: #232628 | ||
font-size: 14px | ||
font-family: Roboto, sans-serif | ||
border: 0 | ||
width: 100% | ||
background: none | ||
-webkit-appearance: none | ||
padding-left: 8px |
10 changes: 10 additions & 0 deletions
10
app/javascript/components/SimpleCircularButton/SimpleCircularButton.jsx
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,10 @@ | ||
import React from 'react'; | ||
import styles from './SimpleCircularButton.sass'; | ||
|
||
const SimpleCircularButton = (props) => { | ||
return ( | ||
<button onClick={props.clicked} className={styles.SimpleCircularButton}>{props.name}</button> | ||
); | ||
}; | ||
|
||
export default SimpleCircularButton; |
18 changes: 18 additions & 0 deletions
18
app/javascript/components/SimpleCircularButton/SimpleCircularButton.sass
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,18 @@ | ||
.SimpleCircularButton | ||
width: 240px | ||
height: 50px | ||
border-radius: 29px | ||
background-color: #83be7d | ||
font-family: Roboto, sans-serif | ||
font-size: 16px | ||
font-weight: normal | ||
font-style: normal | ||
font-stretch: normal | ||
line-height: normal | ||
letter-spacing: normal | ||
color: #ffffff | ||
text-transform: uppercase | ||
border: 0 | ||
|
||
.SimpleCircularButton:hover | ||
background-color: #68af60 |
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
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,32 @@ | ||
import React from 'react'; | ||
import styles from './SimpleModal.sass'; | ||
import Backdrop from '../Backdrop/Backdrop'; | ||
|
||
class SimpleModal extends React.Component { | ||
shouldComponentUpdate(nextProps) { | ||
return nextProps.show !== this.props.show; | ||
} | ||
|
||
componentWillUpdate() { | ||
console.log('[SimpleModal] WillUpdate') | ||
} | ||
|
||
render() { | ||
return ( | ||
<div> | ||
<Backdrop show={this.props.show} clicked={this.props.modalClosed}/> | ||
<div | ||
className={styles.SimpleModal} | ||
style={{ | ||
transform: this.props.show ? 'translateY(0)' : 'translateY(-100vh)', | ||
opacity: this.props.show ? '1' : '0' | ||
}} | ||
> | ||
{this.props.children} | ||
</div> | ||
</div> | ||
) | ||
} | ||
} | ||
|
||
export default SimpleModal; |
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,17 @@ | ||
.SimpleModal | ||
position: fixed | ||
z-index: 500 | ||
background-color: white | ||
width: 70% | ||
border: 1px solid #ccc | ||
box-shadow: 1px 1px 1px black | ||
padding: 16px | ||
left: 15% | ||
top: 30% | ||
box-sizing: border-box | ||
transition: all 0.3s ease-out | ||
|
||
@media (min-width: 600px) | ||
.SimpleModal | ||
width: 500px | ||
left: calc(50% - 250px) |
10 changes: 10 additions & 0 deletions
10
app/javascript/components/SimpleSubmitButton/SimpleSubmitButton.jsx
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,10 @@ | ||
import React from 'react'; | ||
import styles from './SimpleSubmitButton.sass'; | ||
|
||
const SimpleSubmitButton = (props) => { | ||
return ( | ||
<input className={styles.SimpleSubmitButton} type="submit" value={props.name} /> | ||
); | ||
}; | ||
|
||
export default SimpleSubmitButton; |
18 changes: 18 additions & 0 deletions
18
app/javascript/components/SimpleSubmitButton/SimpleSubmitButton.sass
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,18 @@ | ||
.SimpleSubmitButton | ||
width: 200px | ||
height: 50px | ||
border-radius: 4px | ||
background-color: #ffa0a0 | ||
font-family: Roboto, sans-serif | ||
font-size: 16px | ||
font-weight: normal | ||
font-style: normal | ||
font-stretch: normal | ||
line-height: normal | ||
letter-spacing: normal | ||
color: #ffffff | ||
text-transform: uppercase | ||
border: 0 | ||
|
||
.SimpleSubmitButton:hover | ||
background-color: #ff8a8a |
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,12 @@ | ||
import React from 'react'; | ||
import styles from './TextInput.sass'; | ||
|
||
const TextInput = (props) => { | ||
return ( | ||
<div className={styles.TextInput} style={{width: props.width, marginRight: props.marginRight}}> | ||
<input placeholder={props.placeholder} /> | ||
</div> | ||
); | ||
}; | ||
|
||
export default TextInput; |
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,17 @@ | ||
.TextInput | ||
border: 0 | ||
border-radius: 4px | ||
margin-bottom: 10px | ||
width: 300px | ||
height: 50px | ||
background-color: #ebebeb | ||
padding: 12px 6px | ||
|
||
.TextInput input | ||
color: #232628 | ||
font-size: 14px | ||
font-family: Roboto, sans-serif | ||
border: 0 | ||
width: 100% | ||
background: none | ||
padding-left: 8px |
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
10 changes: 10 additions & 0 deletions
10
app/javascript/containers/AdoptionCard/AdoptionButton/AdoptionButton.jsx
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,10 @@ | ||
import React from 'react'; | ||
import styles from './AdoptionButton.sass'; | ||
|
||
const AdoptionButton = (props) => { | ||
return ( | ||
<button onClick={props.clicked} className={styles.AdoptionButton}>{props.name}</button> | ||
); | ||
}; | ||
|
||
export default AdoptionButton; |
Oops, something went wrong.