fix: cập nhật giao diện và các trang dashboard từ máy B

This commit is contained in:
2026-06-27 11:44:28 +07:00
parent b5b6082d26
commit accda67b22
4 changed files with 166 additions and 87 deletions
+12 -5
View File
@@ -32,13 +32,13 @@ export const TourChat: React.FC<TourChatProps> = ({ tourId, embedded = false })
const mentionRef = useRef<HTMLDivElement>(null);
const getHeaders = () => ({
'Authorization': `Bearer ${localStorage.getItem('token')}`,
'Authorization': `Bearer ${localStorage.getItem('token') || localStorage.getItem('guest_token')}`,
'Content-Type': 'application/json'
});
const currentUserId = (() => {
try {
const token = localStorage.getItem('token');
const token = localStorage.getItem('token') || localStorage.getItem('guest_token');
if (!token) return null;
const base64Url = token.split('.')[1];
const base64 = base64Url.replace(/-/g, '+').replace(/_/g, '/');
@@ -311,7 +311,7 @@ export const TourChat: React.FC<TourChatProps> = ({ tourId, embedded = false })
const res = await fetch('/api/v1/upload', {
method: 'POST',
headers: {
'Authorization': `Bearer ${localStorage.getItem('token')}`
'Authorization': `Bearer ${localStorage.getItem('token') || localStorage.getItem('guest_token')}`
},
body: formData
});
@@ -562,7 +562,7 @@ export const TourChat: React.FC<TourChatProps> = ({ tourId, embedded = false })
)}
{/* Locked Chat Input Footer */}
<div className="locked-chat-input-footer !flex-shrink-0 !w-full !border-t border-gray-200 bg-white !z-40" style={{ paddingBottom: 'env(safe-area-inset-bottom, 12px)' }}>
<div className="locked-chat-input-footer relative !flex-shrink-0 !w-full !border-t border-gray-200 bg-white !z-40" style={{ paddingBottom: 'env(safe-area-inset-bottom, 12px)' }}>
{/* Mention list dropdown */}
{showMentionList && filteredParticipants.length > 0 && (
<div
@@ -573,7 +573,14 @@ export const TourChat: React.FC<TourChatProps> = ({ tourId, embedded = false })
<button
key={member.id}
type="button"
onClick={() => insertMention(member)}
onMouseDown={(e) => {
e.preventDefault();
insertMention(member);
}}
onClick={(e) => {
e.preventDefault();
insertMention(member);
}}
className={`px-3 py-2 text-left text-xs font-semibold flex items-center gap-2 transition-colors ${
index === mentionIndex
? 'bg-blue-50 text-blue-700'