creating table components
This commit is contained in:
@@ -21,7 +21,9 @@ import {
|
||||
|
||||
function CafePage({
|
||||
sendParam,
|
||||
shopName,
|
||||
shopItems,
|
||||
shopClerks,
|
||||
socket,
|
||||
user,
|
||||
guestSides,
|
||||
@@ -46,7 +48,6 @@ function CafePage({
|
||||
if (user.cafeId != null && user.cafeId != shopId) {
|
||||
navigate("/" + user.cafeId);
|
||||
}
|
||||
if (user.password == "unsetunsetunset") setIsModalOpen(true);
|
||||
}, [user]);
|
||||
|
||||
useEffect(() => {
|
||||
@@ -95,9 +96,11 @@ function CafePage({
|
||||
<Header
|
||||
HeaderText={"Menu"}
|
||||
showProfile={true}
|
||||
isEdit={() => setModal("edit")}
|
||||
setModal={setModal}
|
||||
isLogout={handleLogout}
|
||||
shopId={shopId}
|
||||
shopName={shopName}
|
||||
shopClerks={shopClerks}
|
||||
tableId={tableId}
|
||||
user={user}
|
||||
guestSides={guestSides}
|
||||
|
||||
@@ -9,7 +9,7 @@ import { getOwnedCafes } from "../helpers/cafeHelpers";
|
||||
|
||||
import { ThreeDots } from "react-loader-spinner";
|
||||
|
||||
const Dashboard = ({ user }) => {
|
||||
const Dashboard = ({ user, setModal }) => {
|
||||
const navigate = useNavigate();
|
||||
const [loading, setLoading] = useState(true);
|
||||
const [isModalOpen, setIsModalOpen] = useState(false);
|
||||
@@ -58,6 +58,8 @@ const Dashboard = ({ user }) => {
|
||||
isEdit={() => setIsModalOpen(true)}
|
||||
isLogout={handleLogout}
|
||||
user={user}
|
||||
showProfile={true}
|
||||
setModal={setModal}
|
||||
/>
|
||||
{user && user.roleId < 2 && (
|
||||
<div className={styles.dashboard}>
|
||||
|
||||
@@ -42,7 +42,7 @@ const LoginPage = () => {
|
||||
}
|
||||
|
||||
// navigate(destination, { replace: true });
|
||||
window.location.href = window.location.hostname + destination;
|
||||
window.location.href = destination;
|
||||
}
|
||||
} else {
|
||||
console.error("Login failed");
|
||||
|
||||
@@ -1,15 +1,18 @@
|
||||
// src/CafePage.js
|
||||
import React, { useState } from "react";
|
||||
import { useParams, useSearchParams } from "react-router-dom";
|
||||
import { useParams, useSearchParams, useNavigate } from "react-router-dom";
|
||||
|
||||
import "../App.css";
|
||||
import SearchInput from "../components/SearchInput";
|
||||
import ItemLister from "../components/ItemLister";
|
||||
import Header from "../components/Header";
|
||||
|
||||
import { updateLocalStorage } from "../helpers/localStorageHelpers";
|
||||
|
||||
function SearchResult({ user, shopItems, sendParam }) {
|
||||
const [searchParams] = useSearchParams();
|
||||
const { shopId, tableId } = useParams();
|
||||
const navigate = useNavigate();
|
||||
sendParam({ shopId, tableId });
|
||||
|
||||
const [searchValue, setSearchValue] = useState(
|
||||
@@ -40,12 +43,7 @@ function SearchResult({ user, shopItems, sendParam }) {
|
||||
return (
|
||||
<div className="App">
|
||||
<header className="App-header">
|
||||
<Header
|
||||
HeaderText={"Search"}
|
||||
shopId={shopId}
|
||||
tableId={tableId}
|
||||
user={user}
|
||||
/>
|
||||
<Header HeaderText={"Search"} />
|
||||
<div style={{ marginTop: "5px" }}></div>
|
||||
<SearchInput
|
||||
shopId={shopId}
|
||||
|
||||
Reference in New Issue
Block a user