Skip to content

Commit

Permalink
feat: adding z index to master
Browse files Browse the repository at this point in the history
  • Loading branch information
JasonNotJson committed Oct 9, 2023
2 parents c172d4a + 070820c commit 1c3b844
Show file tree
Hide file tree
Showing 10 changed files with 54 additions and 20 deletions.
File renamed without changes.
54 changes: 45 additions & 9 deletions apps/forum/src/components/App.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
import React, { useEffect, useState, lazy, Suspense } from "react";
import React, { useEffect, useState } from "react";
import { useTranslation } from "react-i18next";
import { BrowserRouter, Routes, Route, useNavigate } from "react-router-dom";
import {
BrowserRouter,
Routes,
Route,
useNavigate,
useLocation,
} from "react-router-dom";
import HeaderWithModal from "@app/components/common/HeaderWithModal";
import { ThemeContext } from "@app/utils/theme-context";
import Board from "./Board";
Expand All @@ -13,6 +19,7 @@ import ArrowBackIcon from "@mui/icons-material/ArrowBack";
import { API } from "@aws-amplify/api";
import { getUserAttr, getIdToken, LoadingSpinner } from "wasedatime-ui";
import { storeDate } from "@app/utils/storeDate";
import FilterAltIcon from "@mui/icons-material/FilterAlt";

const App = () => {
return (
Expand All @@ -35,13 +42,19 @@ const NotFound = () => {
};

const InnerApp = () => {
const location = useLocation();
const { t, i18n } = useTranslation();

const { theme, setTheme } = React.useContext(ThemeContext);
const [refresh, setRefresh] = useState(false);
const [board, setBoard] = useState("");
const [commentNotify, setCommentNotify] = useState(false);
const navigate = useNavigate();
const [filterButtonClicked, setFilterButtonClicked] = useState(false);

const isThreadRoute =
location.pathname.includes("forum/") &&
location.pathname.split("/").length === 4;

const handleReset = () => {
navigate("/forum");
Expand Down Expand Up @@ -71,6 +84,10 @@ const InnerApp = () => {
storeDate();
}, []);

const handleFilterButtonClick = () => {
setFilterButtonClicked(!filterButtonClicked);
};

return (
<>
<div className="flex h-[67px] shrink-0 grow-0">
Expand All @@ -89,25 +106,44 @@ const InnerApp = () => {
commentNotify={commentNotify}
/>
</div>
<div className="flex flex-col h-fit md:mt-[23px]">
{/* <div className="basis-[calc(100vh-187px)] lg:basis-[80%] dark:text-dark-text1"> */}
<div className="flex justify-between pl-2 gap-4 h-[calc(100vh-100px)]">
<div className="flex flex-col w-1/5">
{/* <BreadCrumbs onTriggerFetch={handleTriggerFetch} /> */}
<div className="flex flex-col h-fit mt-[23px]">
<div className="flex justify-between pl-2 gap-4 h-[calc(100vh-150px)] md:h-[calc(100vh-100px)]">
<div className="left-side flex flex-col w-1/5">
<div className="pl-2 lg:pl-10">
<button
onClick={handleReset}
className="p-2 bg-light-main text-white rounded-lg my-1 w-full"
>
{/* <HomeIcon fontSize="large" /> */}
<ArrowBackIcon fontSize="large" />
</button>
</div>
<FilterMenu />
<BoardMenu />
<FeedBackBox />
</div>
<div className="flex flex-col md:w-3/5 w-4/5">
{!isThreadRoute && (
<button
className="filterButton p-2 bg-light-main dark:bg-dark-main text-white rounded-full "
onClick={handleFilterButtonClick}
>
<FilterAltIcon style={{ fontSize: "35px" }} />
</button>
)}
{filterButtonClicked && (
<div className="filterModal rounded-lg standard-style">
<button
onClick={handleReset}
className="p-2 bg-light-main text-white rounded-lg my-1 w-full"
>
<ArrowBackIcon fontSize="large" />
</button>
<FilterMenu />
<BoardMenu />
<FeedBackBox />
</div>
)}

<div className="flex flex-col md:w-3/5">
<Routes>
<Route
element={<Board triggerRefresh={refresh} setBoard={setBoard} />}
Expand Down
3 changes: 2 additions & 1 deletion apps/forum/src/components/Board.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,8 @@ const Board = ({ triggerRefresh, setBoard }: any) => {

return (
// <div className="max-w-2/5 w-5/6 mx-auto h-full">
<div className="mx-auto px-2 h-full lg:w-5/6 max-w-[280px] sm:max-w-[900px] standard-style overflow-y-hidden">

<div className="mx-auto px-2 h-full lg:w-5/6 max-w-[380px] md:maw-w-[700px] lg:max-w-[900px] standard-style overflow-y-hidden">
<CreateThread onNewThread={handleNewThread} />
<div
className="overflow-auto h-[calc(100%-150px)] mt-4 md:mt-8 lg:mt-12"
Expand Down
2 changes: 1 addition & 1 deletion apps/forum/src/components/BoardMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import boards from "@app/constants/boards.json";
const BoardMenu = () => {
return (
<div className="pl-2 md:pl-4 lg:pl-10">
<h1 className="form-item-title">Topics</h1>
<h3 className="form-item-title">Topics</h3>
<div className="flex flex-col sm:text-xl text-sm text-light-text1 text-light-text1 dark:text-dark-text1">
{boards.map((board, i) => (
<div
Expand Down
2 changes: 1 addition & 1 deletion apps/forum/src/components/FeedBackBox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ type Props = {};
const FeedBackBox = (props: Props) => {
return (
<div className="pl-2 md:pl-4 lg:pl-10 overflow-y-auto">
<h1 className="form-item-title">Feedback</h1>
<h3 className="form-item-title">Feedback</h3>
<p className="text-light-text1 dark:text-dark-text1 ">
This is WasedaTime forum beta.
<br />
Expand Down
2 changes: 1 addition & 1 deletion apps/forum/src/components/FilterMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const FilterMenu = () => {
return (
<div className=" text-center pl-2 lg:pl-10">
<div className="my-2 mx-auto">
<h1 className="form-item-title">School</h1>
<h3 className="form-item-title">School</h3>
<button
className="w-full p-2 bg-light-main text-white rounded-lg my-1"
onClick={toggleSchoolFilter}
Expand Down
2 changes: 1 addition & 1 deletion apps/forum/src/components/Thread.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ const Thread = () => {
};

return (
<div className="border-2 w-full md:w-5/6 mx-auto rounded-xl shadow-lg py-6 px-4 standard-style max-w-[290px] sm:max-w-[900px] overflow-y-auto h-fit">
<div className="border-2 w-full md:w-5/6 mx-auto rounded-xl shadow-lg py-6 px-4 standard-style max-w-[390px] sm:max-w-[900px] overflow-y-auto h-fit">
{/* <CreateThread /> */}

<ThreadBlock isPreview={false} thread={thread} />
Expand Down
4 changes: 2 additions & 2 deletions apps/forum/src/components/ThreadBlock.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ const ThreadBlock = ({ isPreview, fromRoot, thread, onDelete }: Props) => {
<div
className={
isPreview
? `border-2 mb-10 mr-4 rounded-xl shadow-lg p-6 standard-style-hover max-w-[290px] lg:max-w-[900px]`
? `border-2 mb-10 mr-4 rounded-xl shadow-lg p-6 standard-style-hover lg:max-w-[900px]`
: `cursor-default bg-light-card1 standard-style`
}
>
Expand Down Expand Up @@ -262,7 +262,7 @@ const ThreadBlock = ({ isPreview, fromRoot, thread, onDelete }: Props) => {
<div className="flex flex-row justify-evenly pt-2 items-center">
{/* The down panel that has like button, views in total, etc...*/}

<div className="flex flex-row items-center justify-center">
<div className="flex flex-row items-center justify-center gap-2">
<button onClick={handleLike} className="clipboard-icon group">
<Favorite
color={userLiked ? "error" : undefined}
Expand Down
2 changes: 1 addition & 1 deletion apps/forum/src/root.component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { API } from "@aws-amplify/api";

import "@app/utils/i18n";
import "@app/styles/main.css";
// import "@app/styles/common.css";
import "@app/styles/common.css";

configAuth();

Expand Down
3 changes: 0 additions & 3 deletions apps/forum/src/styles/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,6 @@
filter: blur(2px);
border-radius: inherit; /* To maintain the same rounded corners as the parent */
}
<<<<<<< Updated upstream
=======

@media (max-width: 600px) {
.left-side {
Expand Down Expand Up @@ -96,4 +94,3 @@
left: 15%;
z-index: 99;
}
>>>>>>> Stashed changes

0 comments on commit 1c3b844

Please sign in to comment.