Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Closing Menu #50

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 11 additions & 12 deletions html/src/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export default function App() {
const [outfitName, setOutfitName] = useState(null)

const openingMenu = (e) => {
let data = e.data
let data = e.data
switch (data.type) {
case 'newPlayer':
setNew(true)
Expand Down Expand Up @@ -98,8 +98,6 @@ export default function App() {

if(save) {
fetch('https://qbr-clothing/closeMenu', {method: 'POST', body: JSON.stringify({})})
} else {
fetch('https://qbr-clothing/closeMenu2', {method: 'POST', body: JSON.stringify({})})
}

}
Expand All @@ -116,7 +114,7 @@ export default function App() {
fetch('https://qbr-clothing/saveOutfit', {method: 'POST', body: JSON.stringify({
outfitName: outfitName
})})

closeMenu(true)
}
}
Expand Down Expand Up @@ -191,21 +189,21 @@ export default function App() {
<div className="contentWrapper_inner">
<div className="clothingSection">

{ navSelect === 1 &&
{ navSelect === 1 &&
<>
<p className="clothingMenu_header">Outfits</p>
<Outfits data={outfits} />
<Outfits data={outfits} />
</>
}
{ navSelect === 2 &&
{ navSelect === 2 &&
<>
<div className="clothingMenu_header">
<p>Skin Customization</p>
</div>
<Skins data={skins} />
</>
</>
}
{ navSelect === 3 &&
{ navSelect === 3 &&
<>
<p className="clothingMenu_header">Clothing Customization</p>
<Clothes data={clothes} />
Expand All @@ -216,8 +214,8 @@ export default function App() {
<button className='button button-solid' onClick={() => saveCharacter()}>
Save
</button>
{ (!newPlayer && menuType === 'outfits' || menuType === 'all') &&

{ (!newPlayer && menuType === 'outfits' || menuType === 'all') &&
<button className={navSelect === 1 ? 'button button-solid active' : 'button button-solid'} onClick={() => setMenu(1)} data-tip='Outfits'>
<FontAwesomeIcon icon="suitcase" />
</button>
Expand All @@ -235,7 +233,7 @@ export default function App() {
</button>
}

<button className='button button-solid' onClick={() => closeMenu(false)}>
<button className='button button-solid' onClick={() => closeMenu(true)}>
Close
</button>
</div>
Expand All @@ -246,3 +244,4 @@ export default function App() {
</main>
)
}