progressbar and dialogue update

added props to progressbar
fixed dialogue for nesting
This commit is contained in:
gononono64 committed 2025-02-22 06:42:11 -06:00
1 parent 58782dfcd0
commit f8d46b9f7b
7 files changed
+85 -121

No files matched your search

+1 -1
View File
@@ -10,7 +10,7 @@
.dialogue-container {
position: fixed;
bottom: 30px;
width: 66.666%;
width: 50%;
background: transparent;
padding: 25px;
left: 50%;
+3 -4
View File
@@ -1,8 +1,8 @@
import { useState } from 'react'
import { fetchNui } from './fetch'
import './dialogue.css'
function Dialogue() {
console.log("Dialogue component loaded")
const [count, setCount] = useState(0)
const [dialogueOptions, setDialogueOption] = useState([])
const [currentText, setCurrentText] = useState("Welcome traveler! How can I help you today?")
@@ -11,11 +11,10 @@ function Dialogue() {
const handleMessage = (event) => {
var data = event.data;
if (data !== undefined && data.type === "hide") {
if (data !== undefined && data.type === "close") {
document.getElementById('root').classList.add("hidden");
}
if (data !== undefined && data.type === "open") {
console.log("Received data: ", data.text)
setDialogueOption(data.options);
setCurrentText(data.text);
setSpeakerName(data.name);
@@ -39,7 +38,7 @@ function Dialogue() {
{dialogueOptions.map((option) => (
<button
key={option.id}
onClick={() => console.log(`Selected: ${option.label}`)}
onClick={() => fetchNui("dialogue:SelectOption", { name: speakerName, id: option.id })}
className="dialogue-button"
>
{option.label}