-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
304d242
commit b9639d6
Showing
2 changed files
with
160 additions
and
51 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
import React, { useState, useEffect } from 'react'; | ||
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; | ||
import { faCaretDown, faCaretRight, faIndianRupeeSign } from '@fortawesome/free-solid-svg-icons'; | ||
import { faCaretDown, faCaretRight, faIndianRupeeSign, faGlobe, faPhone, faEnvelope, faMapMarkerAlt } from '@fortawesome/free-solid-svg-icons'; | ||
import axios from 'axios'; | ||
|
||
function App() { | ||
|
@@ -14,7 +14,7 @@ function App() { | |
|
||
const fetchProducts = async () => { | ||
try { | ||
const response = await axios.get('http://localhost:3000/common/products?status=ALL'); | ||
const response = await axios.get('http://api.newrajshreesweets.com/common/products?status=ALL'); | ||
const products = response.data.data; | ||
|
||
// Group products by category and sort products within each category | ||
|
@@ -61,35 +61,50 @@ function App() { | |
<svg xmlns="http://www.w3.org/2000/svg" width="200" height="200" viewBox="0 0 200 200"> | ||
<defs> | ||
<linearGradient id="grad" x1="0%" y1="0%" x2="100%" y2="100%"> | ||
<stop offset="0%" style="stop-color:#f3d9ff;stop-opacity:1" /> | ||
<stop offset="100%" style="stop-color:#d9e3ff;stop-opacity:1" /> | ||
<stop offset="0%" style="stop-color:#ffe4e6;stop-opacity:1" /> | ||
<stop offset="100%" style="stop-color:#fef3c7;stop-opacity:1" /> | ||
</linearGradient> | ||
</defs> | ||
<rect width="200" height="200" fill="url(#grad)"/> | ||
<text x="100" y="90" font-family="Arial, sans-serif" font-size="18" fill="#2d3436" text-anchor="middle" font-weight="bold">Image not found</text> | ||
<text x="100" y="130" font-family="Arial, sans-serif" font-size="24" fill="#6c5ce7" text-anchor="middle">(•︵•)</text> | ||
<text x="100" y="90" font-family="Arial, sans-serif" font-size="18" fill="#e11d48" text-anchor="middle" font-weight="bold">Image not found</text> | ||
<text x="100" y="130" font-family="Arial, sans-serif" font-size="24" fill="#e11d48" text-anchor="middle">•︵•</text> | ||
</svg> | ||
`; | ||
e.target.src = `data:image/svg+xml;charset=utf-8,${encodeURIComponent(svgPlaceholder)}`; | ||
}; | ||
|
||
if (loading) { | ||
return <div className="loading">Loading...</div>; | ||
return <div className="loading">Loading delicious treats...</div>; | ||
} | ||
|
||
return ( | ||
<div className="menu-container"> | ||
<div className="misc-details"> | ||
<img src={require('./assets/logo.png')} alt='logo' className='logo' /> | ||
<h1 className='text-3xl font-bold menu-title mb-3'>NEW RAJSHREE SWEETS PRIVATE LIMITED</h1> | ||
<p className='text-xl font-bold'>S 6/109-110 ORDERLY BAZAR ROAD</p> | ||
<p className='text-xl font-bold'>GOLGHAR KACHAHARI</p> | ||
<p className='text-xl font-bold mb-5'>VARANASI - 221002</p> | ||
<p className='text-l'><span className='font-bold'>CIN :</span> U15490UP2021PTC156096</p> | ||
<p className='text-l'><span className='font-bold'>GSTIN :</span> 09AAHCN9500A1ZP</p> | ||
<p className='text-l'><span className='font-bold'>FSSAI LIC NO :</span> 12714038000517</p> | ||
<p className='text-l'><span className='font-bold'>Phone :</span> 0542-2504477</p> | ||
<p className='text-l'><span className='font-bold'>Email :</span> [email protected]</p> | ||
<h1 className='text-3xl md:text-4xl font-bold menu-title'>NEW RAJSHREE SWEETS</h1> | ||
<div className="contact-info"> | ||
<div className="contact-item"> | ||
<FontAwesomeIcon icon={faMapMarkerAlt} className="contact-icon" /> | ||
<p>S 6/109-110 Orderly Bazar Road, Golghar Kachahari, Varanasi - 221002</p> | ||
</div> | ||
<div className="contact-item"> | ||
<FontAwesomeIcon icon={faPhone} className="contact-icon" /> | ||
<a href="tel:+919792677770">+91-9792677770</a> | ||
</div> | ||
<div className="contact-item"> | ||
<FontAwesomeIcon icon={faEnvelope} className="contact-icon" /> | ||
<a href="mailto:[email protected]">[email protected]</a> | ||
</div> | ||
<div className="contact-item"> | ||
<FontAwesomeIcon icon={faGlobe} className="contact-icon" /> | ||
<a href="https://newrajshreesweets.com" target="_blank" rel="noopener noreferrer">newrajshreesweets.com</a> | ||
</div> | ||
</div> | ||
<div className="company-info"> | ||
<p><span>CIN:</span> U15490UP2021PTC156096</p> | ||
<p><span>GSTIN:</span> 09AAHCN9500A1ZP</p> | ||
<p><span>FSSAI:</span> 12714038000517</p> | ||
</div> | ||
</div> | ||
{Object.keys(categories).map((category) => ( | ||
<div key={category} className="category-container"> | ||
|
@@ -98,7 +113,7 @@ function App() { | |
<FontAwesomeIcon icon={showMenu[category] ? faCaretDown : faCaretRight} className='caret' /> | ||
</div> | ||
{showMenu[category] && ( | ||
<div className="items-container grid"> | ||
<div className="items-container"> | ||
{categories[category].map((item) => ( | ||
<div key={item.id} className="item-wrapper"> | ||
<img | ||
|
@@ -109,7 +124,7 @@ function App() { | |
/> | ||
<div className="item-details"> | ||
<h3 className='item-title'>{item.name}</h3> | ||
<p className='shelf-life'>Shelf Life: {item.shelfLife} Days</p> | ||
<p className='shelf-life'><strong>Shelf Life</strong>: {item.shelfLife} Days</p> | ||
<p className='item-rate'> | ||
<FontAwesomeIcon icon={faIndianRupeeSign} /> {item.price.toLocaleString('en-IN')} / {item.quantityType} | ||
</p> | ||
|
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