fix: gộp các nút thành viên và bỏ MemberDashboard
This commit is contained in:
@@ -37,13 +37,15 @@ interface MemberDashboardProps {
|
||||
onExploreTours: () => void;
|
||||
onViewTour: (tourId: string, fromPage?: 'explore' | 'dashboard') => void;
|
||||
onOpenMyPhotos: () => void;
|
||||
initialTab?: 'tours' | 'connections' | 'photos' | 'chats';
|
||||
}
|
||||
|
||||
export const MemberDashboard: React.FC<MemberDashboardProps> = ({
|
||||
user,
|
||||
onLogout,
|
||||
onExploreTours,
|
||||
onViewTour
|
||||
onViewTour,
|
||||
initialTab,
|
||||
}) => {
|
||||
// GUARD: Prevent guest users from accessing dashboard
|
||||
const guestToken = localStorage.getItem('guest_token');
|
||||
@@ -68,7 +70,13 @@ export const MemberDashboard: React.FC<MemberDashboardProps> = ({
|
||||
const publicTours = useTourStore(state => state.publicTours);
|
||||
const fetchPublicTours = useTourStore(state => state.fetchPublicTours);
|
||||
|
||||
const [activeTab, setActiveTab] = useState<'tours' | 'connections' | 'photos' | 'chats'>('tours');
|
||||
const [activeTab, setActiveTab] = useState<'tours' | 'connections' | 'photos' | 'chats'>(initialTab || 'tours');
|
||||
|
||||
useEffect(() => {
|
||||
if (initialTab) {
|
||||
setActiveTab(initialTab);
|
||||
}
|
||||
}, [initialTab]);
|
||||
const [connectionSubTab, setConnectionSubTab] = useState<'list' | 'search' | 'pending'>('list');
|
||||
|
||||
// Connection states
|
||||
|
||||
Reference in New Issue
Block a user