Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
d382138
delete old graphql button
yonas-seyoum Oct 26, 2023
0224a7f
refactor leftDrawer
yonas-seyoum Oct 26, 2023
ecdafe2
add drawer context provider
yonas-seyoum Oct 26, 2023
fca4b07
update how props is passed to children
yonas-seyoum Oct 26, 2023
650173d
update unit test
yonas-seyoum Oct 26, 2023
d79fb36
refactor main content
yonas-seyoum Oct 26, 2023
130e471
refactor footer
yonas-seyoum Oct 26, 2023
04ce5ad
change folder path of navbar
yonas-seyoum Oct 26, 2023
4b59e6b
Merge branch 'development' into Refactor-Frontend
yonas-seyoum Oct 29, 2023
b07b47e
refacor userpage
yonas-seyoum Oct 31, 2023
5c4b2b9
update types
yonas-seyoum Nov 1, 2023
f43115f
update configs
yonas-seyoum Nov 1, 2023
3799d6b
add mutation hook
yonas-seyoum Nov 1, 2023
af08b12
refactor folder structure
yonas-seyoum Nov 1, 2023
1868ab3
add useUpdateUser hook
yonas-seyoum Nov 1, 2023
5e5c0d1
update detailHolder
yonas-seyoum Nov 1, 2023
9aeaf28
add grid item component
yonas-seyoum Nov 3, 2023
1d97b96
refactor detail holder
yonas-seyoum Nov 3, 2023
994818a
update constants
yonas-seyoum Nov 3, 2023
793d090
remove code smell
yonas-seyoum Nov 6, 2023
1a4b2ab
update custom mutation hook
yonas-seyoum Nov 12, 2023
297e1e0
add useUserEntry hook
yonas-seyoum Nov 12, 2023
66943ec
update UserPageContextProovider
yonas-seyoum Nov 12, 2023
f469ba2
update detailHolder
yonas-seyoum Nov 12, 2023
026b1cb
Merge branch 'Refactor-Frontend' of https://github.com/humanitech-net…
yonas-seyoum Nov 12, 2023
4b77d1e
remove code smell
yonas-seyoum Nov 12, 2023
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
82 changes: 0 additions & 82 deletions applications/webapp/src/Components/Button.test.tsx

This file was deleted.

64 changes: 0 additions & 64 deletions applications/webapp/src/Components/Button.tsx

This file was deleted.

106 changes: 0 additions & 106 deletions applications/webapp/src/Components/leftDrawer.tsx

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
/**
* Humanitech Supply Trail
*
* Copyright (c) Humanitech, Peter Rogov and Contributors
*
* Website: https://humanitech.net
* Repository: https://github.com/humanitech-net/supply-trail
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/

import React, { ReactNode, createContext, useState, useMemo } from "react";

interface DrawerContextProps {
open: boolean;
setOpen: (open: boolean) => void;
}

interface DrawerProviderProps {
children: ReactNode;
}

export const DrawerContext = createContext<DrawerContextProps>({
open: false,
setOpen: () => {},
});

export const DrawerProvider: React.FC<DrawerProviderProps> = ({ children }) => {
const [open, setOpen] = useState(false);

const props = useMemo(() => ({ open, setOpen }), [open, setOpen]);

return (
<DrawerContext.Provider value={props}>{children}</DrawerContext.Provider>
);
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
/**
* Humanitech Supply Trail
*
* Copyright (c) Humanitech, Peter Rogov and Contributors
*
* Website: https://humanitech.net
* Repository: https://github.com/humanitech-net/supply-trail
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/

import React, { useContext } from "react";
import { IconButton, styled } from "@mui/material";

import MenuIcon from "@mui/icons-material/Menu";
import { DrawerContext } from "../../ContextProvider/drawerProvider";

export default function DrawerHeader() {
const { open, setOpen } = useContext(DrawerContext);

const closeDrawer = React.useCallback(() => {
setOpen(false);
}, [open]);

const Header = styled("div")(({ theme }) => ({
display: "flex",
alignItems: "center",
padding: theme.spacing(0, 1),
...theme.mixins.toolbar,
justifyContent: "flex-start",
paddingLeft: 22,
backgroundColor: "#011C27",
}));

return (
<Header>
<IconButton
color="inherit"
aria-label="close drawer"
onClick={closeDrawer}
edge="start"
sx={{ color: "white" }}
>
<MenuIcon />
</IconButton>
</Header>
);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
/**
* Humanitech Supply Trail
*
* Copyright (c) Humanitech, Peter Rogov and Contributors
*
* Website: https://humanitech.net
* Repository: https://github.com/humanitech-net/supply-trail
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/

import React from "react";
import { List, ListItem, ListItemButton, ListItemText } from "@mui/material";
import { drawerMenu } from "../util/constants";

export default function DrawerMenu() {
return (
<List
sx={{
backgroundColor: "#011C27",
color: "white",
}}
>
{drawerMenu.map((text) => (
<ListItem key={text} disablePadding>
<ListItemButton
sx={{
display: "flex",
flexDirection: "column",
justifyContent: "center",
alignItems: "center",
}}
>
<ListItemText primary={text} />
</ListItemButton>
</ListItem>
))}
</List>
);
}
Loading