version bump.
This commit is contained in:
parent
d754f8657c
commit
dda3453d79
15
src/App.js
15
src/App.js
@ -214,13 +214,16 @@ function App() {
|
|||||||
{!isAuthReady && !error && <p>Authenticating...</p>}
|
{!isAuthReady && !error && <p>Authenticating...</p>}
|
||||||
</main>
|
</main>
|
||||||
<footer className="bg-slate-900 p-4 text-center text-sm text-slate-400 mt-8">
|
<footer className="bg-slate-900 p-4 text-center text-sm text-slate-400 mt-8">
|
||||||
TTRPG Initiative Tracker v0.1.34
|
TTRPG Initiative Tracker v0.2.0
|
||||||
</footer>
|
</footer>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// --- Confirmation Modal Component ---
|
// --- Confirmation Modal Component ---
|
||||||
|
// ... (ConfirmationModal, AdminView, CreateCampaignForm, CharacterManager, EncounterManager, CreateEncounterForm, ParticipantManager, EditParticipantModal, InitiativeControls, DisplayView, Modal, Icons remain the same as v0.1.29)
|
||||||
|
// For brevity, only the changed App component's footer is shown. Assume all other components are the same as the last complete code block you received.
|
||||||
|
|
||||||
function ConfirmationModal({ isOpen, onClose, onConfirm, title, message }) {
|
function ConfirmationModal({ isOpen, onClose, onConfirm, title, message }) {
|
||||||
if (!isOpen) return null;
|
if (!isOpen) return null;
|
||||||
return (
|
return (
|
||||||
@ -240,11 +243,9 @@ function ConfirmationModal({ isOpen, onClose, onConfirm, title, message }) {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// --- Admin View Component ---
|
|
||||||
function AdminView({ userId }) {
|
function AdminView({ userId }) {
|
||||||
const { data: campaignsData, isLoading: isLoadingCampaigns, error: campaignsError } = useFirestoreCollection(getCampaignsCollectionPath());
|
const { data: campaignsData, isLoading: isLoadingCampaigns, error: campaignsError } = useFirestoreCollection(getCampaignsCollectionPath());
|
||||||
const { data: initialActiveInfoData } = useFirestoreDocument(getActiveDisplayDocPath());
|
const { data: initialActiveInfoData } = useFirestoreDocument(getActiveDisplayDocPath());
|
||||||
|
|
||||||
const [campaignsWithDetails, setCampaignsWithDetails] = useState([]);
|
const [campaignsWithDetails, setCampaignsWithDetails] = useState([]);
|
||||||
const [selectedCampaignId, setSelectedCampaignId] = useState(null);
|
const [selectedCampaignId, setSelectedCampaignId] = useState(null);
|
||||||
const [showCreateCampaignModal, setShowCreateCampaignModal] = useState(false);
|
const [showCreateCampaignModal, setShowCreateCampaignModal] = useState(false);
|
||||||
@ -284,7 +285,6 @@ function AdminView({ userId }) {
|
|||||||
}
|
}
|
||||||
}, [initialActiveInfoData, campaignsWithDetails, selectedCampaignId]);
|
}, [initialActiveInfoData, campaignsWithDetails, selectedCampaignId]);
|
||||||
|
|
||||||
|
|
||||||
const handleCreateCampaign = async (name, backgroundUrl) => {
|
const handleCreateCampaign = async (name, backgroundUrl) => {
|
||||||
if (!db || !name.trim()) return;
|
if (!db || !name.trim()) return;
|
||||||
const newCampaignId = generateId();
|
const newCampaignId = generateId();
|
||||||
@ -317,7 +317,6 @@ function AdminView({ userId }) {
|
|||||||
await batch.commit();
|
await batch.commit();
|
||||||
await deleteDoc(doc(db, getCampaignDocPath(campaignId)));
|
await deleteDoc(doc(db, getCampaignDocPath(campaignId)));
|
||||||
if (selectedCampaignId === campaignId) setSelectedCampaignId(null);
|
if (selectedCampaignId === campaignId) setSelectedCampaignId(null);
|
||||||
|
|
||||||
const activeDisplayRef = doc(db, getActiveDisplayDocPath());
|
const activeDisplayRef = doc(db, getActiveDisplayDocPath());
|
||||||
const activeDisplaySnap = await getDoc(activeDisplayRef);
|
const activeDisplaySnap = await getDoc(activeDisplayRef);
|
||||||
if (activeDisplaySnap.exists() && activeDisplaySnap.data().activeCampaignId === campaignId) {
|
if (activeDisplaySnap.exists() && activeDisplaySnap.data().activeCampaignId === campaignId) {
|
||||||
@ -387,7 +386,6 @@ function AdminView({ userId }) {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// --- CreateCampaignForm (No Change from v0.1.33) ---
|
|
||||||
function CreateCampaignForm({ onCreate, onCancel }) {
|
function CreateCampaignForm({ onCreate, onCancel }) {
|
||||||
const [name, setName] = useState('');
|
const [name, setName] = useState('');
|
||||||
const [backgroundUrl, setBackgroundUrl] = useState('');
|
const [backgroundUrl, setBackgroundUrl] = useState('');
|
||||||
@ -410,7 +408,7 @@ function CreateCampaignForm({ onCreate, onCancel }) {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// --- CharacterManager (No Change from v0.1.33) ---
|
|
||||||
function CharacterManager({ campaignId, campaignCharacters }) {
|
function CharacterManager({ campaignId, campaignCharacters }) {
|
||||||
const [characterName, setCharacterName] = useState('');
|
const [characterName, setCharacterName] = useState('');
|
||||||
const [defaultMaxHp, setDefaultMaxHp] = useState(10);
|
const [defaultMaxHp, setDefaultMaxHp] = useState(10);
|
||||||
@ -836,9 +834,6 @@ function ParticipantManager({ encounter, encounterPath, campaignCharacters }) {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ... (EditParticipantModal, InitiativeControls, DisplayView, Modal, Icons)
|
|
||||||
// The rest of the components are assumed to be the same as v0.1.28 for this update.
|
|
||||||
|
|
||||||
function EditParticipantModal({ participant, onClose, onSave }) {
|
function EditParticipantModal({ participant, onClose, onSave }) {
|
||||||
const [name, setName] = useState(participant.name);
|
const [name, setName] = useState(participant.name);
|
||||||
const [initiative, setInitiative] = useState(participant.initiative);
|
const [initiative, setInitiative] = useState(participant.initiative);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user