Skip to content

Commit

Permalink
chore: another announcement pass
Browse files Browse the repository at this point in the history
  • Loading branch information
Golbolco committed Aug 22, 2024
1 parent 78445ec commit 324b0a1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 34 deletions.
37 changes: 6 additions & 31 deletions react_main/src/Main.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,6 @@ import { BadTextContrast } from "./components/alerts/BadTextContrast";
function Main() {
var cacheVal = window.localStorage.getItem("cacheVal");
const [isLoading, setLoading] = useState(true);
// const [showChatTab, setShowChatTab] = useState(
// localStorage.getItem("showChatTab") == "false" ? false : true
// ); // TODO: Remove comments
const [showAnnouncementTemporarily, setShowAnnouncementTemporarily] =
useState(false);

Expand All @@ -69,6 +66,10 @@ function Main() {
window.localStorage.setItem("cacheVal", cacheVal);
}

const openAnnouncements = () => {
setShowAnnouncementTemporarily(true);
};

const user = useUser();
const siteInfo = useSiteInfo({
alerts: [],
Expand Down Expand Up @@ -206,7 +207,6 @@ function Main() {
<div className="site-wrapper">
<div className="main-container">
<Header
// setShowChatTab={setShowChatTab} // TODO: Remove comments
setShowAnnouncementTemporarily={
setShowAnnouncementTemporarily
}
Expand Down Expand Up @@ -240,8 +240,7 @@ function Main() {
<Footer />
<AlertList />
{
/* {showChatTab && */ <Chat
// setShowChatTab={setShowChatTab} // TODO: Remove comments
<Chat
SiteNotifs={SiteNotifs}
/>
}
Expand All @@ -260,11 +259,6 @@ function Main() {
function Header({ setShowAnnouncementTemporarily }) {
const user = useContext(UserContext);

// const openChatTab = () => {
// setShowChatTab(true);
// localStorage.setItem("showChatTab", true);
// }; // TODO: Remove comments

const openAnnouncements = () => {
setShowAnnouncementTemporarily(true);
};
Expand Down Expand Up @@ -339,7 +333,7 @@ function Header({ setShowAnnouncementTemporarily }) {
style={{ display: "flex", alignItems: "flex-start" }}
>
<UserNotifications
// openChatTab={openChatTab} // TODO: Remove comments
openAnnouncements={openAnnouncements}
user={user}
SiteNotifs={SiteNotifs}
/>
Expand All @@ -355,10 +349,6 @@ function Header({ setShowAnnouncementTemporarily }) {
}}
>
<Nav>
{/* melodic-e: implement mobile-friendly menu
TODO: refactor into css files (need help or more time to do it myself)
Reason: lack of documentation
*/}
<NavLink
to="/play"
className={"glow-on-hover"}
Expand Down Expand Up @@ -400,7 +390,6 @@ function Header({ setShowAnnouncementTemporarily }) {
style={{ display: smallWidth === true ? "none" : "flex" }}
>
<UserNotifications
// openChatTab={openChatTab} // TODO: Remove comments
user={user}
SiteNotifs={SiteNotifs}
/>
Expand Down Expand Up @@ -583,20 +572,6 @@ function Footer() {
return (
<div className="footer">
<div className="footer-inner">
{/*<a*/}
{/* href="https://discord.gg/C5WMFpYRHQ"*/}
{/* target="blank"*/}
{/* style={{*/}
{/* display: "flex",*/}
{/* justifyContent: "center",*/}
{/* alignItems: "flex-end",*/}
{/* color: "var(--theme-color-text)",*/}
{/* }}*/}
{/*>*/}
{/* <i className="fab fa-discord" />*/}
{/* <Box sx={{ mx: 0.5 }}>Join us on Discord</Box>*/}
{/* <i className="fab fa-discord" />*/}
{/*</a>*/}
<div
style={{
fontSize: "xx-large",
Expand Down
4 changes: 1 addition & 3 deletions react_main/src/pages/User/UserNotifications.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import { Avatar } from "./User";
import "../../css/main.css";

export default function UserNotifications({
// setShowChatTab, // TODO: Remove comments
openAnnouncements,
user,
SiteNotifs,
Expand All @@ -17,8 +16,7 @@ export default function UserNotifications({
onClick={() => openAnnouncements()}
style={{ fontSize: "14px" }}
/>
{/* <i className="fas fa-comments" onClick={() => openChatTab()} // TODO: Remove comments /> */}
<SiteNotifs /*setShowChatTab={setShowChatTab} // TODO: Remove comments */
<SiteNotifs
/>
<div style={{ marginLeft: "6px" }}>
<Link to="/user" className="profile-link">
Expand Down

0 comments on commit 324b0a1

Please sign in to comment.