Skip to content

Commit

Permalink
fix login and register conflict with components
Browse files Browse the repository at this point in the history
  • Loading branch information
vanessacor committed Jan 24, 2021
1 parent 7c6f39c commit 10a28cd
Show file tree
Hide file tree
Showing 10 changed files with 141 additions and 139 deletions.
215 changes: 103 additions & 112 deletions public/js/app.js

Large diffs are not rendered by default.

21 changes: 0 additions & 21 deletions resources/js/components/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,32 +3,11 @@ import ReactDOM from "react-dom";
import AboutUs from "./aboutUs/AboutUs.js";
import UserProfiles from "./userProfiles/UserProfiles.js";
import UserCard from "./userCard/UserCard.js";
import Example from "./Example";
import Course from "./course/Course";
import Registerbuyform from "./registerbuyform/Registerbuyform";
import Cart from "./cart/Cart";
import Hero from "./hero/Hero";
import Footer from "./footer/Footer";
import UserProfile from "./user-profile/UserProfile";

function App() {
return (
<div className="container">
<AboutUs />
<UserProfiles />
<UserCard />
<Course />
<Registerbuyform />
<Cart />
<Hero />
<UserProfile />
<Footer />
</div>
);
}

export default App;

if (document.getElementById("app")) {
ReactDOM.render(<App />, document.getElementById("app"));
}
5 changes: 5 additions & 0 deletions resources/js/components/aboutUs/AboutUs.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,8 @@ function AboutUs() {
};

export default AboutUs;


if (document.getElementById("about-us")) {
ReactDOM.render(<AboutUs />, document.getElementById("about-us"));
}
5 changes: 5 additions & 0 deletions resources/js/components/course/Course.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,3 +58,8 @@ function Course() {
}

export default Course;

if (document.getElementById("course")) {
ReactDOM.render(<Course />, document.getElementById("course"));
}

4 changes: 4 additions & 0 deletions resources/js/components/footer/Footer.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,7 @@ function Footer() {
}

export default Footer;

if (document.getElementById("footer")) {
ReactDOM.render(<Footer />, document.getElementById("footer"));
}
6 changes: 3 additions & 3 deletions resources/js/components/hero/Hero.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@ function Hero() {

export default Hero;

// if (document.getElementById("welcome")) {
// ReactDOM.render(<Welcome />, document.getElementById("welcome"));
// }
if (document.getElementById("hero")) {
ReactDOM.render(<Hero />, document.getElementById("hero"));
}
9 changes: 7 additions & 2 deletions resources/js/components/userProfiles/UserProfiles.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,17 @@ function UserProfiles() {
<div className="userCards">
<img src="../assets/vanessa.png"/>
<h3>Vanessa Poppe</h3>
<p>Front-End developer, CSS, Ract y JavaScript</p>
<p>Front-End developer, CSS, React y JavaScript</p>
</div>
</div>

</div>
);
};

export default UserProfiles;
export default UserProfiles;


if (document.getElementById("user-profiles")) {
ReactDOM.render(<UserProfiles />, document.getElementById("user-profiles"));
}
1 change: 1 addition & 0 deletions resources/views/layouts/app.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@

<main class="py-4">
@yield('content')

</main>
</div>
</body>
Expand Down
10 changes: 9 additions & 1 deletion resources/views/welcome.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,16 @@
</div>
@endif

<div>

<div id="app"></div>
<div id="hero"></div>
<div id="about-us"></div>
<div id="course"></div>
<div id="user-profiles"></div>
<div id="footer"></div>

</div>

</div>


Expand Down
4 changes: 4 additions & 0 deletions routes/web.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@
return view('welcome');
});

// Route::get('/', function () {
// return view('welcome');
// });

Auth::routes();

Route::get('/home', [App\Http\Controllers\HomeController::class, 'index'])->name('home');

0 comments on commit 10a28cd

Please sign in to comment.