Skip to content

Commit

Permalink
Merge pull request #1210 from harshita1611/Harshita
Browse files Browse the repository at this point in the history
Harshita
  • Loading branch information
codervivek5 authored May 30, 2024
2 parents d20e3d3 + 03ab5c4 commit 31b7c9c
Show file tree
Hide file tree
Showing 14 changed files with 202 additions and 82 deletions.
50 changes: 49 additions & 1 deletion Front-with-React/VigyBag/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion Front-with-React/VigyBag/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@
},
"dependencies": {
"react": "^18.2.0",
"react-dom": "^18.2.0"
"react-dom": "^18.2.0",
"react-icons": "^5.2.1",
"react-router-dom": "^6.23.1"
},
"devDependencies": {
"@types/react": "^18.2.66",
Expand Down
42 changes: 0 additions & 42 deletions Front-with-React/VigyBag/src/App.css
Original file line number Diff line number Diff line change
@@ -1,42 +0,0 @@
#root {
max-width: 1280px;
margin: 0 auto;
padding: 2rem;
text-align: center;
}

.logo {
height: 6em;
padding: 1.5em;
will-change: filter;
transition: filter 300ms;
}
.logo:hover {
filter: drop-shadow(0 0 2em #646cffaa);
}
.logo.react:hover {
filter: drop-shadow(0 0 2em #61dafbaa);
}

@keyframes logo-spin {
from {
transform: rotate(0deg);
}
to {
transform: rotate(360deg);
}
}

@media (prefers-reduced-motion: no-preference) {
a:nth-of-type(2) .logo {
animation: logo-spin infinite 20s linear;
}
}

.card {
padding: 2em;
}

.read-the-docs {
color: #888;
}
52 changes: 19 additions & 33 deletions Front-with-React/VigyBag/src/App.jsx
Original file line number Diff line number Diff line change
@@ -1,35 +1,21 @@
import { useState } from 'react'
import reactLogo from './assets/react.svg'
import viteLogo from '/vite.svg'
import './App.css'

function App() {
const [count, setCount] = useState(0)
import React from "react";
import { BrowserRouter as Router, Route, Routes } from "react-router-dom";
import LandingPage from "./pages/LadingPage";
import Gifts from "./pages/Gifts";
import Categories from "./pages/Categories";
import AboutUs from "./pages/AboutUs";
import Dashboard from "./pages/Dashboard";

export default function App() {
return (
<>
<div>
<a href="https://vitejs.dev" target="_blank">
<img src={viteLogo} className="logo" alt="Vite logo" />
</a>
<a href="https://react.dev" target="_blank">
<img src={reactLogo} className="logo react" alt="React logo" />
</a>
</div>
<h1>Vite + React</h1>
<div className="card">
<button onClick={() => setCount((count) => count + 1)}>
count is {count}
</button>
<p>
Edit <code>src/App.jsx</code> and save to test HMR
</p>
</div>
<p className="read-the-docs">
Click on the Vite and React logos to learn more
</p>
</>
)
}

export default App
<Router>
<Routes>
<Route path="/" element={<LandingPage />} />
<Route path="/gifts" element={<Gifts />} />
<Route path="/categories" element={<Categories />} />
<Route path="/about" element={<AboutUs />} />
<Route path="/dashboard" element={<Dashboard />} />
</Routes>
</Router>
);
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 0 additions & 1 deletion Front-with-React/VigyBag/src/assets/react.svg

This file was deleted.

57 changes: 57 additions & 0 deletions Front-with-React/VigyBag/src/components/Navbar/Navbar.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
import React from 'react';
import { FaSearch, FaShoppingCart, FaBell, FaUserCircle } from 'react-icons/fa';
import { Link } from 'react-router-dom';

// ...

<Link to="/dashboard">
<FaUserCircle className="mx-2 text-black cursor-pointer size-10" />
<span className="mx-2 text-black font-semibold text-2xl">Hi, Vivek</span>
</Link>

const Navbar = () => {
return (
<nav className="flex items-center justify-between bg-[#fdf1e8] p-4">
{/* Logo and Navigation Links */}
<div className="flex gap-10 items-center">
<img src="" alt="Logo" className="h-10" />
<div className="ml-4">
{/* Home Link */}
<a href="/" className="mx-2 text-black text-2xl font-bold">Home</a>

{/* Gifts Dropdown */}
<div className="inline-block relative">
<a href="/gifts" className="mx-2 text-2xl text-black font-bold">Gifts</a>
</div>

{/* Categories Dropdown */}
<div className="inline-block relative">
<a href="/categories" className="mx-2 text-2xl text-black font-bold">Categories</a>
</div>

{/* About Us Link */}
<a href="/about" className="mx-2 text-2xl text-black font-bold">About Us</a>
</div>
</div>
{/* Search Bar */}
<div className="flex gap-10 items-center rounded-full border-black border-2 bg-gray-200 px-4 py-1">
<input type="text" placeholder="Search" className="bg-transparent outline-none" />
<FaSearch className="text-gray-600" />
</div>

{/* User Actions */}
<div className="flex gap-2 items-center">
<FaShoppingCart className="mx-2 text-black cursor-pointer size-10" />
<FaBell className="mx-2 text-black cursor-pointer size-10" />
<Link to="/dashboard">
<div className='flex'>
<FaUserCircle className="mx-2 text-black cursor-pointer size-10" />
<span className="mx-2 text-black font-semibold text-2xl">Hi, Vivek</span>
</div>
</Link>
</div>
</nav>
);
};

export default Navbar;
4 changes: 2 additions & 2 deletions Front-with-React/VigyBag/src/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
@tailwind components;
@tailwind utilities;

:root {
/* :root {
font-family: Inter, system-ui, Avenir, Helvetica, Arial, sans-serif;
line-height: 1.5;
font-weight: 400;
Expand Down Expand Up @@ -69,4 +69,4 @@ button:focus-visible {
button {
background-color: #f9f9f9;
}
}
} */
5 changes: 3 additions & 2 deletions Front-with-React/VigyBag/src/main.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@ import ReactDOM from 'react-dom/client'
import App from './App.jsx'
import './index.css'


ReactDOM.createRoot(document.getElementById('root')).render(
<React.StrictMode>
<>
<App />
</React.StrictMode>,
</>,
)
13 changes: 13 additions & 0 deletions Front-with-React/VigyBag/src/pages/AboutUs.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import React from "react";
import Navbar from "../components/Navbar/Navbar";

function AboutUs() {
return (
<div>
<Navbar />
<h1>About Us</h1>
</div>
);
}

export default AboutUs;
13 changes: 13 additions & 0 deletions Front-with-React/VigyBag/src/pages/Categories.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import React from "react";
import Navbar from "../components/Navbar/Navbar";

function Categories() {
return (
<div>
<Navbar />
<h1>Categories</h1>
</div>
);
}

export default Categories;
13 changes: 13 additions & 0 deletions Front-with-React/VigyBag/src/pages/Dashboard.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import React from "react";
import Navbar from "../components/Navbar/Navbar";

function Dashboard() {
return (
<div>
<Navbar />
<h1>Dashboard</h1>
</div>
);
}

export default Dashboard;
13 changes: 13 additions & 0 deletions Front-with-React/VigyBag/src/pages/Gifts.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import React from "react";
import Navbar from "../components/Navbar/Navbar";

function Gifts() {
return (
<div>
<Navbar />
<h1>Gifts</h1>
</div>
);
}

export default Gifts;
17 changes: 17 additions & 0 deletions Front-with-React/VigyBag/src/pages/LadingPage.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import React from 'react';
import Navbar from "../components/Navbar/Navbar";
import background from "../assets/images/background.png";

function LandingPage() {
return (
<div style={{ backgroundImage: `url(${background})`, backgroundSize: 'cover', height: '100vh', position: 'relative' }}>
<Navbar />
<h1>Welcome to Vigy Bag</h1>
<h1>Your Eco-Friendly</h1>
<h1>Shopping Heaven</h1>

</div>
);
}

export default LandingPage;

0 comments on commit 31b7c9c

Please sign in to comment.