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

styledFeed&Card #38

Merged
merged 1 commit into from
Dec 11, 2020
Merged
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
42 changes: 33 additions & 9 deletions src/Components/Home/FeedCard.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,27 @@ import search from "../../Assets/search.svg";
import { BaseUrl } from "../../Constants/BaseUrl";
import { useRequestData } from "../../Hooks/UseRequestData";
import { goToRestaurantsDetailsPage } from '../../Routes/Cordinator'
import styled from 'styled-components'

const Rectangle =styled.div`
display: flex;
flex-direction: column;
align-items: center;
border-radius: 8px;
border: solid 1px #b8b8b8;
margin:10px;
p{
padding:10px;
text-align:justify;
}
`
const Img=styled.img`
width:130px;
height:120px;
`
const AreaInfo=styled.div`
display:flex;
`

export default function FeedCard(props) {
const restaurants = useRequestData(`${BaseUrl}/restaurants`, []);
Expand All @@ -17,14 +38,17 @@ export default function FeedCard(props) {
console.log (props.id)

return (

<S.DivisaoPrincipal onClick={() => goToRestaurantsDetailsPage(history, props.id)}>
{/* <Header title={"Rappi4"}/>
<S.RectangleFeed><img src = {search}/></S.RectangleFeed> */}
<S.DivText> <S.Text>{props.category} </S.Text> </S.DivText>
<S.ScreenShot src = {props.logoUrl}/>
<S.Description>{props.description}</S.Description>
<S.Rest>{props.name}</S.Rest> <S.Time>{props.deliveryTime} - min</S.Time> <S.DivTextDeliveryFee><S.deliveryFee> Frete R$ {props.shipping}</S.deliveryFee> </S.DivTextDeliveryFee>
</S.DivisaoPrincipal>

<Rectangle onClick={() => goToRestaurantsDetailsPage(history, props.id)}>
<p><b>{props.category} </b></p>
<Img src = {props.logoUrl}/>
<p>{props.description}</p>
<AreaInfo>
<p><b>{props.name}</b></p>
<p>{props.deliveryTime} - min</p>
<p> Frete R$ {props.shipping}</p>
</AreaInfo>
</Rectangle>

);
}
6 changes: 3 additions & 3 deletions src/Components/RestaurantCard/RestaurantCard.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ function RestaurantCard(props) {

return (

<S.Rectangle>
<div>
<S.AreaImg>
<S.ImgBurguer src = {props.Photo} />
</S.AreaImg>
Expand All @@ -22,7 +22,7 @@ function RestaurantCard(props) {
</S.AreaItensLanche>


</S.Rectangle>
</div>
)
}
export default Regit adstaurantCard
export default RestaurantCard
19 changes: 15 additions & 4 deletions src/Screens/Home/FeedPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,26 @@ import { useRequestData } from "../../Hooks/UseRequestData";
import FeedCard from "../../Components/Home/FeedCard";
import { goToRestaurantsDetailsPage } from '../../Routes/Cordinator'
import { useHistory } from 'react-router-dom'
import * as S from '../../Screens/ScreenStyled'

import Header from '../../Components/Header/Header'
import { goToLoginPage } from '../../Routes/Cordinator'
import ChevronLeftIcon from "@material-ui/icons/ChevronLeft";

export default function FeedPage(props) {
const restaurants = useRequestData(`${BaseUrl}/restaurants`, []);
const history = useHistory()
console.log (props.id)
return (
<div>

<S.Container>
<Header />
<ChevronLeftIcon onClick={()=>goToLoginPage(history)}/>

{restaurants.map((restaurant) => {
return (

<FeedCard

restaurant = {restaurant}
key={restaurant.id}
id={restaurant.id}
Expand All @@ -24,9 +33,11 @@ export default function FeedPage(props) {
description={restaurant.description}
deliveryTime={restaurant.deliveryTime}
shipping={restaurant.shipping}
/>
/>

);
})}
</div>

</S.Container>
);
}
4 changes: 3 additions & 1 deletion src/Screens/Restaurants/RestaurantPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,9 @@ function Restaurant(props) {
<Header title={"Restaurante"}/>
<S.RestaurantDetails>
{restaurantDetails && restaurantDetails.restaurant && restaurantDetails.map((Item)=>{})}
<S.image> <img img src = {restaurantDetails.logoUrl}/> </S.image >
<S.AreaLogoRest>
<S.image src = {restaurantDetails.logoUrl}/>
</S.AreaLogoRest>
<S.RestaurantTitle> {restaurantDetails.name} </S.RestaurantTitle>
<S.Burger> {restaurantDetails.category} </S.Burger>
<S.Areatempo>
Expand Down
17 changes: 9 additions & 8 deletions src/Screens/ScreenStyled.js
Original file line number Diff line number Diff line change
Expand Up @@ -184,15 +184,16 @@ export const title = styled.div`
margin: 20px 92px 0 54px;
padding: 13px 45.5px 12px;
`;
export const AreaLogoRest = styled.div`
display:flex;
align-items:center;
margin-left:105px;
`;

export const image = styled.img`
width: 150px;
height: 150px;

export const image = styled.div`
width: 328px;
height: 120px;
margin: 17px 16px 12px;
object-fit: contain;
display: flex;
flex-direction: column;
align-items: center;
`;
export const RestaurantTitle = styled.div`
width: 328px;
Expand Down