Sửa lỗi backend để chạy phần đăng ký
This commit is contained in:
Vendored
+16
-12
@@ -1,15 +1,19 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
const jsx_runtime_1 = require("react/jsx-runtime");
|
||||
const react_1 = require("react");
|
||||
const LandingPage_1 = require("./LandingPage");
|
||||
const TourDetailPage_1 = require("./TourDetailPage");
|
||||
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
||||
import { useState, useEffect } from 'react';
|
||||
import { LandingPage } from './LandingPage.js';
|
||||
import { TourDetailPage } from './TourDetailPage.js';
|
||||
import { ExploreMap } from './ExploreMap.js';
|
||||
import { SignupPage } from './SignupPage.js';
|
||||
const App = () => {
|
||||
const [isStarted, setIsStarted] = (0, react_1.useState)(false);
|
||||
const handleContinue = () => {
|
||||
setIsStarted(true);
|
||||
};
|
||||
return ((0, jsx_runtime_1.jsx)("div", { className: "app-container", children: !isStarted ? ((0, jsx_runtime_1.jsx)(LandingPage_1.LandingPage, { onContinue: handleContinue })) : ((0, jsx_runtime_1.jsx)(TourDetailPage_1.TourDetailPage, {})) }));
|
||||
const [view, setView] = useState('landing');
|
||||
const [isInitialSetup, setIsInitialSetup] = useState(false);
|
||||
useEffect(() => {
|
||||
fetch('http://localhost:3001/api/v1/auth/status')
|
||||
.then(res => res.json())
|
||||
.then(data => setIsInitialSetup(data.isInitialSetup))
|
||||
.catch(() => setIsInitialSetup(false));
|
||||
}, [view]);
|
||||
return (_jsxs("div", { className: "app-container", children: [view === 'landing' && (_jsx(LandingPage, { isInitialSetup: isInitialSetup, onContinue: () => setView('explore'), onGoToSignup: () => setView('signup'), onGoToMap: () => setView('explore') })), view === 'signup' && (_jsx(SignupPage, { onBack: () => setView('landing'), onSuccess: () => setView('landing') })), view === 'explore' && (_jsx(ExploreMap, { onBack: () => setView('landing') })), view === 'detail' && (_jsx(TourDetailPage, {}))] }));
|
||||
};
|
||||
exports.default = App;
|
||||
export default App;
|
||||
//# sourceMappingURL=App.js.map
|
||||
Reference in New Issue
Block a user