Skip to content

Commit a5b7a4f

Browse files
committed
feat: add stellar contract dependencies and integration setup
2 parents 9f66e11 + bba2a3c commit a5b7a4f

40 files changed

Lines changed: 3878 additions & 1387 deletions

apps/web/.storybook/main.ts

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import type { StorybookConfig } from '@storybook/nextjs';
2+
3+
const config: StorybookConfig = {
4+
stories: ['../src/**/*.mdx', '../src/**/*.stories.@(js|jsx|mjs|ts|tsx)'],
5+
addons: [
6+
'@storybook/addon-links',
7+
'@storybook/addon-essentials',
8+
'@storybook/addon-interactions',
9+
],
10+
framework: {
11+
name: '@storybook/nextjs',
12+
options: {},
13+
},
14+
docs: {
15+
autodocs: 'tag',
16+
},
17+
staticDirs: ['../public'],
18+
};
19+
export default config;

apps/web/.storybook/preview.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import type { Preview } from '@storybook/react';
2+
3+
import '../src/app/globals.css';
4+
5+
const preview: Preview = {
6+
parameters: {
7+
actions: { argTypesRegex: '^on[A-Z].*' },
8+
controls: {
9+
matchers: {
10+
color: /(background|color)$/i,
11+
date: /Date$/i,
12+
},
13+
},
14+
},
15+
};
16+
17+
export default preview;

apps/web/biome_errors.txt

Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
src/app/tenant-dashboard/page.tsx:119:39 lint/suspicious/noExplicitAny ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
2+
3+
× Unexpected any. Specify a different type.
4+
5+
117 │ }, []);
6+
118 │
7+
> 119 │ const handleViewDetails = (booking: any): void => {
8+
│ ^^^
9+
120 │ // Legacy mapping or handle directly
10+
121 │ const found = apiBookings.find((b) => b.id === booking.id);
11+
12+
i any disables many type checking rules. Its use should be avoided.
13+
14+
15+
src/app/tenant-dashboard/page.tsx:128:41 lint/suspicious/noExplicitAny ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
16+
17+
× Unexpected any. Specify a different type.
18+
19+
126 │ };
20+
127 │
21+
> 128 │ const handleCancelBooking = (booking: any): void => {
22+
│ ^^^
23+
129 │ const found = apiBookings.find((b) => b.id === booking.id);
24+
130 │ if (found) {
25+
26+
i any disables many type checking rules. Its use should be avoided.
27+
28+
29+
src/app/tenant-dashboard/page.tsx:359:29 lint/suspicious/noExplicitAny ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
30+
31+
× Unexpected any. Specify a different type.
32+
33+
357 │ ) : user ? (
34+
358 │ <ProfileManagement
35+
> 359 │ user={user as any}
36+
│ ^^^
37+
360 │ onUpdateProfile={handleUpdateUser as any}
38+
361 │ onUploadAvatar={async (file) => {
39+
40+
i any disables many type checking rules. Its use should be avoided.
41+
42+
43+
src/app/tenant-dashboard/page.tsx:360:52 lint/suspicious/noExplicitAny ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
44+
45+
× Unexpected any. Specify a different type.
46+
47+
358 │ <ProfileManagement
48+
359 │ user={user as any}
49+
> 360 │ onUpdateProfile={handleUpdateUser as any}
50+
│ ^^^
51+
361 │ onUploadAvatar={async (file) => {
52+
362 │ await apiUploadAvatar(user.id.toString(), file);
53+
54+
i any disables many type checking rules. Its use should be avoided.
55+
56+
57+
src/app/tenant-dashboard/page.tsx:396:45 lint/suspicious/noExplicitAny ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
58+
59+
× Unexpected any. Specify a different type.
60+
61+
394 │ walletBalance={walletBalance}
62+
395 │ pendingTransactions={pendingTransactions}
63+
> 396 │ transactions={transactions as any}
64+
│ ^^^
65+
397 │ onExportTransactions={apiExportTransactions}
66+
398 │ />
67+
68+
i any disables many type checking rules. Its use should be avoided.
69+
70+
71+
src/app/tenant-dashboard/page.tsx format ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
72+
73+
× Formatter would have printed the following content:
74+
75+
207 207 │ <div className="fixed top-4 right-4 z-50 max-w-sm">
76+
208 208 │ <div
77+
209 │ - ··········className={`rounded-lg·p-4·shadow-lg·${toast.type·===·'success'
78+
210 │ - ············?·'bg-green-100·border·border-green-200·text-green-800'
79+
211 │ - ············:·'bg-red-100·border·border-red-200·text-red-800'
80+
212 │ - ············}`}
81+
209 │ + ··········className={`rounded-lg·p-4·shadow-lg·${
82+
210 │ + ············toast.type·===·'success'
83+
211 │ + ··············?·'bg-green-100·border·border-green-200·text-green-800'
84+
212 │ + ··············:·'bg-red-100·border·border-red-200·text-red-800'
85+
213 │ + ··········}`}
86+
213 214 │ >
87+
214 215 │ <div className="flex items-center">
88+
······· │
89+
316 317 │ type="button"
90+
317 318 │ onClick={() => setActiveTab(tab.id)}
91+
318 │ - ··················className={`flex·items-center·space-x-2·py-4·px-1·border-b-2·font-medium·text-sm·${activeTab·===·tab.id
92+
319 │ - ····················?·'border-blue-500·text-blue-600·dark:text-blue-400'
93+
320 │ - ····················:·'border-transparent·text-gray-500·dark:text-white·hover:border-gray-300'
94+
321 │ - ····················}`}
95+
319 │ + ··················className={`flex·items-center·space-x-2·py-4·px-1·border-b-2·font-medium·text-sm·${
96+
320 │ + ····················activeTab·===·tab.id
97+
321 │ + ······················?·'border-blue-500·text-blue-600·dark:text-blue-400'
98+
322 │ + ······················:·'border-transparent·text-gray-500·dark:text-white·hover:border-gray-300'
99+
323 │ + ··················}`}
100+
322 324 │ >
101+
323 325 │ <Icon className="w-5 h-5" />
102+
103+
104+
Checked 1 file in 7ms. No fixes applied.
105+
Found 6 errors.
106+
check ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
107+
108+
× Some errors were emitted while running checks.
109+
110+

apps/web/package.json

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,11 @@
99
"lint": "next lint",
1010
"test:e2e": "playwright test",
1111
"test:e2e:ui": "playwright test --ui",
12-
"test:e2e:headed": "playwright test --headed"
12+
"test:e2e:headed": "playwright test --headed",
13+
"storybook": "storybook dev -p 6006",
14+
"build-storybook": "storybook build",
15+
"test": "vitest run",
16+
"test:watch": "vitest"
1317
},
1418
"dependencies": {
1519
"stellar-social-sdk": "file:./stellar-social-sdk",
@@ -51,16 +55,32 @@
5155
},
5256
"devDependencies": {
5357
"@playwright/test": "^1.55.0",
58+
"@storybook/addon-essentials": "8.6.14",
59+
"@storybook/addon-interactions": "8.6.14",
60+
"@storybook/addon-links": "8.6.14",
61+
"@storybook/blocks": "8.6.14",
62+
"@storybook/nextjs": "8.6.14",
63+
"@storybook/react": "8.6.14",
64+
"@storybook/test": "8.6.14",
65+
"@testing-library/jest-dom": "^6.9.1",
66+
"@testing-library/react": "14.2.2",
67+
"@testing-library/user-event": "14.5.2",
68+
"@types/jest": "^30.0.0",
69+
"@types/jsdom": "^27.0.0",
5470
"@types/leaflet": "^1.9.19",
5571
"@types/node": "^20",
5672
"@types/react": "^18",
5773
"@types/react-dom": "^18",
74+
"@vitejs/plugin-react": "^5.1.2",
5875
"autoprefixer": "^10.4.17",
5976
"eslint": "^8",
6077
"eslint-config-next": "14.1.0",
78+
"jsdom": "^27.4.0",
6179
"node-loader": "^2.1.0",
6280
"postcss": "^8.4.35",
81+
"storybook": "8.6.14",
6382
"tailwindcss": "^3.4.1",
64-
"typescript": "^5"
83+
"typescript": "^5",
84+
"vitest": "^4.0.18"
6585
}
6686
}

apps/web/src/app/booking/page.tsx

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import { BookingConfirmation } from '@/components/booking/BookingConfirmation';
33
import { BookingForm } from '@/components/booking/BookingForm';
44
import { WalletConnectionModal } from '@/components/booking/WalletConnectionModal';
55
import { useWallet } from '@/hooks/useWallet';
6-
import { useTheme } from 'next-themes';
76
import { useRouter } from 'next/navigation';
87
import { useState } from 'react';
98
import type { DateRange } from 'react-day-picker';
@@ -20,10 +19,8 @@ interface BookingPageProps {
2019
type BookingFlowStep = 'form' | 'payment' | 'confirmation';
2120

2221
export default function BookingPage({ params }: BookingPageProps) {
23-
const { theme: _theme } = useTheme();
2422
const _router = useRouter();
2523
const { isConnected, connect, publicKey } = useWallet();
26-
2724
const [_selectedDates, _setSelectedDates] = useState<DateRange | undefined>({
2825
from: undefined,
2926
to: undefined,
@@ -54,7 +51,7 @@ export default function BookingPage({ params }: BookingPageProps) {
5451
const _property = {
5552
id: params.propertyId,
5653
title: 'Luxury Beachfront Villa',
57-
image: '/images/property-placeholder.jpg',
54+
image: '/images/property-placeholder.webp',
5855
pricePerNight: 150,
5956
deposit: 500,
6057
commission: 0.00001,
@@ -107,21 +104,23 @@ export default function BookingPage({ params }: BookingPageProps) {
107104
propertyId: data.property.id,
108105
userId: publicKey,
109106
dates: data.dates,
107+
checkIn: data.dates.from.toISOString(),
108+
checkOut: data.dates.to.toISOString(),
110109
guests: data.guests,
111-
total: data.totalAmount,
110+
totalAmount: data.totalAmount,
112111
deposit: data.depositAmount,
113112
});
114113

115114
toast.dismiss('create-booking');
116115
toast.success('Booking created! Proceeding to payment.');
117116

118117
setCurrentBookingData({
119-
bookingId: createdBooking.bookingId,
118+
bookingId: createdBooking.data.id,
120119
property: data.property,
121120
dates: data.dates,
122121
guests: data.guests,
123122
totalAmount: data.totalAmount,
124-
escrowAddress: createdBooking.escrowAddress,
123+
escrowAddress: createdBooking.data.escrowAddress || '',
125124
});
126125

127126
setBookingStep('payment');

0 commit comments

Comments
 (0)