diff --git a/src/feature-module/inventory/addWeddingGuest.jsx b/src/feature-module/inventory/addWeddingGuest.jsx
index b97332c..08e6ad2 100644
--- a/src/feature-module/inventory/addWeddingGuest.jsx
+++ b/src/feature-module/inventory/addWeddingGuest.jsx
@@ -1,8 +1,9 @@
import React, { useState } from 'react';
-import { Form, Input, InputNumber, Select, Button, Card, message, Row, Col } from 'antd';
+import { Form, Input, InputNumber, Select, message } from 'antd';
import { useNavigate, Link } from 'react-router-dom';
-import { ArrowLeft, Save, Heart } from 'react-feather';
+import { ArrowLeft, Save, Users, FileText, Gift } from 'react-feather';
import { weddingGuestService } from '../../services/weddingGuestService';
+import { LoadingButton } from '../../components/Loading';
const { Option } = Select;
const { TextArea } = Input;
@@ -54,135 +55,153 @@ const AddWeddingGuest = () => {
@@ -191,171 +210,230 @@ const AddWeddingGuest = () => {
-
-
- Thêm khách mời đám cưới
-
- Thêm khách mời mới vào danh sách
+ Thêm khách mời đám cưới
+ Tạo thông tin khách mời mới cho đám cưới
-
-
}
- >
- Quay lại
-
+
+
+ Quay lại danh sách
{/* Form */}
-
-
);
diff --git a/src/feature-module/inventory/editWeddingGuest.jsx b/src/feature-module/inventory/editWeddingGuest.jsx
index 741f300..3872220 100644
--- a/src/feature-module/inventory/editWeddingGuest.jsx
+++ b/src/feature-module/inventory/editWeddingGuest.jsx
@@ -1,8 +1,9 @@
import React, { useState, useEffect } from 'react';
-import { Form, Input, InputNumber, Select, Button, Card, message, Spin, Row, Col } from 'antd';
+import { Form, Input, InputNumber, Select, message, Spin } from 'antd';
import { useParams, useNavigate, Link } from 'react-router-dom';
-import { ArrowLeft, Save, Heart } from 'react-feather';
+import { ArrowLeft, Save, Users, FileText, Gift } from 'react-feather';
import { weddingGuestService } from '../../services/weddingGuestService';
+import { LoadingButton } from '../../components/Loading';
const { Option } = Select;
const { TextArea } = Input;
@@ -14,85 +15,8 @@ const EditWeddingGuest = () => {
const [loading, setLoading] = useState(false);
const [submitting, setSubmitting] = useState(false);
const [guestData, setGuestData] = useState(null);
- const [isDarkTheme, setIsDarkTheme] = useState(false);
- // Check theme with multiple approaches
- useEffect(() => {
- const checkTheme = () => {
- const htmlElement = document.documentElement;
- const bodyElement = document.body;
- // Get all possible theme indicators
- const layoutMode = htmlElement.getAttribute('data-layout-mode');
- const dataTheme = htmlElement.getAttribute('data-theme');
- const bodyClass = bodyElement.className;
- const colorSchema = localStorage.getItem('colorschema');
-
- // Check multiple ways to detect dark mode
- const isDarkByLayoutMode = layoutMode === 'dark_mode';
- const isDarkByDataTheme = dataTheme === 'dark';
- const isDarkByLocalStorage = colorSchema === 'dark_mode';
- const isDarkByBodyClass = bodyClass.includes('dark') || bodyClass.includes('dark-mode');
-
- // Use any method that indicates dark mode
- const isDark = isDarkByLayoutMode || isDarkByDataTheme || isDarkByLocalStorage || isDarkByBodyClass;
-
- console.log('🎨 Theme debug (Edit):', {
- layoutMode,
- dataTheme,
- bodyClass,
- colorSchema,
- isDarkByLayoutMode,
- isDarkByDataTheme,
- isDarkByLocalStorage,
- isDarkByBodyClass,
- finalIsDark: isDark
- });
-
- setIsDarkTheme(isDark);
- };
-
- // Initial check
- checkTheme();
-
- // Check again after a short delay to catch late theme application
- setTimeout(checkTheme, 100);
- setTimeout(checkTheme, 500);
-
- // Listen for all possible theme changes
- const observer = new MutationObserver(() => {
- console.log('🔄 DOM mutation detected (Edit), rechecking theme...');
- checkTheme();
- });
-
- observer.observe(document.documentElement, {
- attributes: true,
- attributeFilter: ['data-layout-mode', 'data-theme', 'class']
- });
-
- observer.observe(document.body, {
- attributes: true,
- attributeFilter: ['class', 'data-theme']
- });
-
- // Listen for localStorage changes
- const handleStorageChange = (e) => {
- if (e.key === 'colorschema') {
- console.log('📦 localStorage colorschema changed (Edit):', e.newValue);
- setTimeout(checkTheme, 50);
- }
- };
- window.addEventListener('storage', handleStorageChange);
-
- // Also check periodically as fallback
- const interval = setInterval(checkTheme, 2000);
-
- return () => {
- observer.disconnect();
- window.removeEventListener('storage', handleStorageChange);
- clearInterval(interval);
- };
- }, []);
// Load guest data
const loadGuestData = async () => {
@@ -168,40 +92,7 @@ const EditWeddingGuest = () => {
}
};
- // Dynamic styles based on theme
- const getInputStyle = () => ({
- color: isDarkTheme ? '#ffffff' : '#000000',
- backgroundColor: isDarkTheme ? '#1f1f1f' : '#ffffff',
- borderColor: isDarkTheme ? '#434343' : '#d9d9d9',
- });
- const getLabelStyle = () => ({
- color: isDarkTheme ? '#ffffff' : '#000000',
- });
-
- // Force DOM styling update
- useEffect(() => {
- const forceCardStyling = () => {
- // Find all ant-card elements
- const cards = document.querySelectorAll('.ant-card, .wedding-guest-form');
- cards.forEach(card => {
- if (card) {
- card.style.backgroundColor = isDarkTheme ? '#141432' : '#FAFBFE';
- card.style.background = isDarkTheme ? '#141432' : '#FAFBFE';
- card.style.borderColor = isDarkTheme ? '#434343' : '#d9d9d9';
- card.style.color = isDarkTheme ? '#ffffff' : '#000000';
- }
- });
- };
-
- // Apply immediately
- forceCardStyling();
-
- // Apply after a short delay to catch any late-rendered elements
- const timer = setTimeout(forceCardStyling, 100);
-
- return () => clearTimeout(timer);
- }, [isDarkTheme]);
// Load data on component mount
useEffect(() => {
@@ -225,105 +116,154 @@ const EditWeddingGuest = () => {
@@ -773,9 +936,8 @@ const WeddingGuestList = () => {
type="primary"
icon={
}
className="btn btn-added"
- style={{ backgroundColor: '#ff69b4', borderColor: '#ff69b4' }}
>
- Thêm khách mời
+ Thêm mới
@@ -835,6 +997,11 @@ const WeddingGuestList = () => {
+
+
+ Danh sách khách mời
+
+
{
onChange={(e) => handleSearch(e.target.value)}
style={{
width: 300,
- color: '#000000 !important',
- backgroundColor: '#ffffff',
border: '1px solid #d9d9d9'
}}
className="wedding-guest-search-input"