Skip to content

Commit ea56a06

Browse files
authored
Merge pull request #28 from AX99:staging
url
2 parents 60f4bb0 + c3b4574 commit ea56a06

6 files changed

Lines changed: 127 additions & 113 deletions

File tree

gatsby-config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ module.exports = {
163163
{
164164
resolve: `gatsby-plugin-offline`,
165165
options: {
166-
precachePages: [`/`, `/blog/*`, `/property/*`],
166+
precachePages: [`/`, `/blog/*`, `/properties/*`],
167167
workboxConfig: {
168168
runtimeCaching: [
169169
{

gatsby-node.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,10 @@ exports.createPages = async ({ actions, graphql, reporter }) => {
6969
// Create a page for each property
7070
propertyResult.data.allSanityProperty.nodes.forEach((node) => {
7171
// Use slug if available, otherwise use ID
72-
const path = node.slug?.current
73-
? `/property/${node.slug.current}/`
74-
: `/property/${node._id}/`;
75-
72+
const path = node.slug?.current
73+
? `/properties/${node.slug.current}/`
74+
: `/properties/${node._id}/`;
75+
7676
createPage({
7777
path,
7878
component: propertyDetailTemplate,

makefile

Lines changed: 25 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,57 @@
1-
init:
1+
NODE_VERSION := $(shell node -v 2>/dev/null)
2+
REQUIRED_NODE := v18.20.8
3+
4+
check-node:
5+
@if [ -z "$(NODE_VERSION)" ]; then \
6+
echo "Error: Node.js is not installed. Please install Node.js $(REQUIRED_NOTE)"; \
7+
exit 1; \
8+
elif [ "$(NODE_VERSION)" != "$(REQUIRED_NODE)" ]; then \
9+
echo "Error: Wrong Node.js version. Please switch to $(REQUIRED_NODE) (current: $(NODE_VERSION))"; \
10+
echo "Run: nvm use lts/hydrogen"; \
11+
exit 1; \
12+
fi
13+
14+
init: check-node
215
yarn install
316

417
clean:
518
rm -rf .cache || true
619
rm -rf public || true
720
yarn run clean
821

9-
clean-dev:
22+
clean-dev: check-node
1023
make clean || true
1124
make dev
1225

13-
dev:
26+
dev: check-node
1427
yarn run develop
1528

16-
dev-m:
29+
dev-m: check-node
1730
yarn run develop-net
1831

19-
clean-dev-m:
32+
clean-dev-m: check-node
2033
make clean || true
2134
make dev-m
2235

23-
format:
36+
format: check-node
2437
yarn run format
2538

26-
build:
39+
build: check-node
2740
yarn run build
2841

29-
serve:
42+
serve: check-node
3043
yarn run serve
3144

32-
serve-m:
45+
serve-m: check-node
3346
yarn run serve-net
3447

35-
docker-buildup:
48+
docker-buildup: check-node
3649
docker-compose build || true
3750
docker-compose up
3851

39-
docker-up:
52+
docker-up: check-node
4053
docker-compose up
54+
4155
# deploy-live:
4256
# git pull upstream master || true
4357
# git push origin master

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
"@types/mapbox-gl": "^3.4.1",
3030
"dotenv": "^16.4.5",
3131
"framer-motion": "^11.1.7",
32-
"gatsby": "~5.13.4",
32+
"gatsby": "^5.14.5",
3333
"gatsby-plugin-gatsby-cloud": "~5.13.1",
3434
"gatsby-plugin-google-adsense": "^1.1.3",
3535
"gatsby-plugin-google-gtag": "~5.13.1",

src/components/PropertyCard.js

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,13 @@ const PropertyCard = ({ property }) => {
1515
const imageData = mainImage?.asset?.gatsbyImageData
1616

1717
// Format location string from location object
18-
const locationString = location?.city ?
19-
`${location.city}${location.state ? `, ${location.state}` : ''}` :
18+
const locationString = location?.city ?
19+
`${location.city}${location.state ? `, ${location.state}` : ''}` :
2020
'Location not specified'
21-
21+
2222
// Status badge styling
2323
const getStatusBadge = () => {
24-
switch(status) {
24+
switch (status) {
2525
case 'sold':
2626
return (
2727
<div className="absolute top-0 left-0 bg-red-600 text-white px-4 py-2 rounded-br-lg font-semibold">
@@ -44,23 +44,23 @@ const PropertyCard = ({ property }) => {
4444
return null;
4545
}
4646
};
47-
47+
4848
// Check if property is sold or rented
4949
const isUnavailable = status === 'sold' || status === 'rented';
50-
50+
5151
return (
52-
<motion.div
52+
<motion.div
5353
className="bg-white rounded-lg shadow-lg overflow-hidden h-full flex flex-col"
5454
whileHover={{ y: -5 }}
5555
transition={{ duration: 0.3 }}
5656
>
5757
<div className="relative h-52 bg-neutral-200">
5858
{/* Image with overlay link to full details */}
59-
<Link to={`/property/${slug?.current || property._id}`} className="block h-full">
59+
<Link to={`/properties/${slug?.current || property._id}`} className="block h-full">
6060
{imageData ? (
6161
<>
62-
<GatsbyImage
63-
image={imageData}
62+
<GatsbyImage
63+
image={imageData}
6464
alt={title}
6565
className="h-full w-full object-cover"
6666
/>
@@ -84,16 +84,16 @@ const PropertyCard = ({ property }) => {
8484
</div> */}
8585
{getStatusBadge()}
8686
</div>
87-
87+
8888
<div className="p-6 flex-grow">
89-
<Link to={`/property/${slug?.current || property._id}`} className="block hover:text-primary-600 transition-colors">
89+
<Link to={`/properties/${slug?.current || property._id}`} className="block hover:text-primary-600 transition-colors">
9090
<h3 className="text-xl font-semibold mb-2">{title}</h3>
9191
</Link>
9292
<div className="flex items-center text-neutral-600 mb-4">
9393
<FaMapMarkerAlt className="mr-2 text-primary-600" />
9494
<span>{locationString}</span>
9595
</div>
96-
96+
9797
<div className="grid grid-cols-3 gap-4 mb-4">
9898
<div className="flex items-center">
9999
<FaBed className="mr-2 text-primary-600" />
@@ -108,24 +108,24 @@ const PropertyCard = ({ property }) => {
108108
<span>{area ? `${area} ${property.areaUnit || 'sqft'}` : 'N/A'}</span>
109109
</div>
110110
</div>
111-
111+
112112
{description && (
113113
<div className="text-neutral-600 mb-4 line-clamp-3">
114114
{description[0]?.children?.map(child => child.text).join(' ') || 'No description available'}
115115
</div>
116116
)}
117-
117+
118118
{amenities && amenities.length > 0 && (
119-
<div className="flex flex-wrap gap-2 mb-4">
119+
<div className="flex flex-wrap gap-2 mb-4">
120120
{amenities.slice(0, 3).map((amenity, index) => (
121-
<span key={index} className="bg-neutral-100 text-neutral-700 px-2 py-1 rounded-full text-xs">
121+
<span key={index} className="bg-neutral-100 text-neutral-700 px-2 py-1 rounded-full text-xs">
122122
{amenity}
123-
</span>
124-
))}
125-
</div>
123+
</span>
124+
))}
125+
</div>
126126
)}
127127
</div>
128-
128+
129129
<div className="p-6 pt-0">
130130
{isUnavailable ? (
131131
<motion.button
@@ -148,7 +148,7 @@ const PropertyCard = ({ property }) => {
148148
<FaEye className="mr-2" />
149149
Quick View
150150
</motion.button>
151-
151+
152152
<motion.div
153153
className="flex-1 text-center rounded-md"
154154
whileHover={{ scale: 1.02 }}
@@ -158,7 +158,7 @@ const PropertyCard = ({ property }) => {
158158
formType={FORM_TYPES.PROPERTY_ENQUIRY}
159159
buttonText="Enquire"
160160
buttonClass="bg-primary-600 w-full hover:bg-primary-700 text-white font-semibold py-3 px-4 rounded-md transition-colors"
161-
data={{
161+
data={{
162162
property: `${title} (${slug?.current || property._id})`
163163
}}
164164
/>

0 commit comments

Comments
 (0)