Skip to content

Commit

Permalink
Se quita anchor tag a button de la sección main y se realizan las rut…
Browse files Browse the repository at this point in the history
…as del button de main a /lo-nuevo y de /lo-nuevo a /home
  • Loading branch information
LeoCoronel committed Sep 23, 2021
1 parent c6d8b4f commit 12e74eb
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 24 deletions.
7 changes: 1 addition & 6 deletions src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import Sucursales from "./views/sucursales/index.js"
import Gallery from './components/Gallery/index';
import AboutUS from './views/aboutUS';
import News from './views/news';
import CardMainDesktop from "./components/CardMainDesktop";
import { useState } from 'react';
import {
BrowserRouter as Router,
Expand All @@ -27,8 +26,6 @@ function App() {
<Navbar></Navbar>
<Switch>
<Route path="/home" exact>

<CardMainDesktop />
<Main />
<Information handleClick={handleClick} moreInfo={moreInfo} />
{moreInfo ? <Sucursales /> : null }
Expand All @@ -41,8 +38,6 @@ function App() {
<News></News>
</Route>
<Route path="/" exact>

<CardMainDesktop />
<Main />
<Information handleClick={handleClick} moreInfo={moreInfo} />
{moreInfo ? <Sucursales /> : null }
Expand All @@ -61,4 +56,4 @@ function AppWithProviders() {
);
}

export default AppWithProviders;
export default AppWithProviders;
10 changes: 9 additions & 1 deletion src/components/CardMainDesktop/index.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,18 @@
import React from 'react';
import './styles.scss';
import { useHistory } from 'react-router';
import { card } from './data';
import image from '../../assets/imagen-card-main.png';
import Button from "../Button";

const CardMainDesktop = () => {

const history = useHistory();

const handleClick = () => {
history.push("/home")
}

return (
<div className="card-main">
<div className="card-main__container">
Expand Down Expand Up @@ -45,7 +53,7 @@ const CardMainDesktop = () => {
<p>Uno de los problemas es que beber vino de arándano puede llegar a convertirse en adictivo con el tiempo. Los amantes de este vino, por lo tanto, tienen que aprender a <span>consumirlo con moderación</span>. Para conservarlo una vez abierto, lo mejor es volverlo a tapar con el corcho y asegurarse de que no queda expuesto al aire.</p>
</div>

<Button variant="secondary" text="Volver" clases='card-container__button'></Button>
<Button variant="secondary" text="Volver" clases='card-container__button' onClick={handleClick}></Button>
</div>
</div>
)
Expand Down
8 changes: 3 additions & 5 deletions src/components/CardMainMobile/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ function CardMainMobile() {
<div className = "card-container">
<div className = "card-container__main">
<h1 className = "card-container__main--title">
{card.title}
{card.title}
</h1>
<p className = "card-container__main--paragraph">
{card.description}
Expand All @@ -30,11 +30,9 @@ function CardMainMobile() {
</div>
)}
</div>
<a href="">
<Button variant="secondary" text="Volver" clases='card-container__button'></Button>
</a>
<Button variant="secondary" text="Volver" clases='card-container__button'></Button>
</div>
);
);
}

export default CardMainMobile;
3 changes: 2 additions & 1 deletion src/components/CardMainMobile/style.scss
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
@use 'src/styles/utils' as *;

.card-container {
background-color: white;
background-color: $color-bg;
margin-top: 20px;
&__main {
&--title {
font-style: normal;
Expand Down
12 changes: 9 additions & 3 deletions src/components/Main/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,16 @@ import React from "react";
import "./style.scss";
import imagen from "../../assets/portada.png";
import Button from "../Button";
import { useHistory } from 'react-router';


function Main() {
const history = useHistory();

const handleClick = () => {
history.push("/lo-nuevo")
}

return (
<main className="main">
<div className="main__texto">
Expand All @@ -22,9 +30,7 @@ function Main() {
la nuestra tampoco... <br />
</span>
</h1>
<a href="#">
<Button variant="primary" text="Conocé lo nuevo"></Button>
</a>
<Button variant="primary" text="Conocé lo nuevo" onClick={handleClick} ></Button>
</div>
<div className="main__img">
<img
Expand Down
8 changes: 0 additions & 8 deletions src/components/Main/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,6 @@
letter-spacing: 0.05em;
height: 58px;
}

a {
button {
z-index: 2;
margin-left: 25vw;
top: 82vh;
}
}
}


Expand Down

0 comments on commit 12e74eb

Please sign in to comment.