-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
clicking outside about etc. closes it + some refactor
- Loading branch information
1 parent
ab2af7c
commit d1690b1
Showing
11 changed files
with
131 additions
and
85 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
import React from "react"; | ||
import About from "./About"; | ||
import Topics from "./Topics"; | ||
import Contact from "./Contact"; | ||
import Share from "./Share"; | ||
import ResetWarning from "./ResetWarning"; | ||
|
||
function CouncilOverlays({ activeOverlay, options, removeOverlay }) { | ||
|
||
const closeWrapperStyle = { | ||
height: "100%", | ||
width: "100%", | ||
display: "flex", | ||
alignItems: "center", | ||
justifyContent: "center", | ||
}; | ||
|
||
const closeInnerStyle = { | ||
height: "calc(100% - 110px)", | ||
width: "100%", | ||
display: "flex", | ||
marginTop: "110px", | ||
}; | ||
|
||
const clickerStyle = { | ||
flex: 1, | ||
}; | ||
|
||
const middleColumn = { | ||
display: "flex", | ||
flexDirection: "column", | ||
}; | ||
|
||
// Conditional rendering of overlay content based on activeOverlay state | ||
const renderOverlayContent = () => { | ||
switch (activeOverlay) { | ||
case "about": | ||
return <About />; | ||
case "settings": | ||
return ( | ||
<Topics | ||
currentTopic={options.topic} | ||
onReset={options.onReset} | ||
onCancel={removeOverlay} | ||
/> | ||
); | ||
case "contact": | ||
return <Contact />; | ||
case "share": | ||
return <Share />; | ||
case "reset": | ||
return ( | ||
<ResetWarning | ||
onReset={() => options.onReset()} | ||
onCancel={removeOverlay} | ||
/> | ||
); | ||
default: | ||
return null; // No overlay content if no section is active | ||
}; | ||
}; | ||
|
||
return ( | ||
<div style={closeWrapperStyle}> | ||
<div style={closeInnerStyle}> | ||
<div style={clickerStyle} onClick={removeOverlay} /> | ||
<div style={middleColumn}> | ||
<div style={clickerStyle} onClick={removeOverlay}/> | ||
{renderOverlayContent()} | ||
<div style={clickerStyle} onClick={removeOverlay}/> | ||
</div> | ||
<div style={clickerStyle} onClick={removeOverlay}/> | ||
</div> | ||
</div> | ||
); | ||
} | ||
|
||
export default CouncilOverlays; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
import React from "react"; | ||
|
||
function Share() { | ||
return <div></div>; | ||
return <div>Share this...TODO</div>; | ||
} | ||
|
||
export default Share; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.