Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/Gather307/Gather
Browse files Browse the repository at this point in the history
  • Loading branch information
SilveerDusk committed Jun 4, 2024
2 parents fe4b7d0 + fca97ca commit 1d008d2
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 8 deletions.
7 changes: 2 additions & 5 deletions frontend/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,19 +54,16 @@ function App() {
};

useEffect(() => {
getUser().then(() => {
setLoggedIn(!loggedIn);
});
getUser();
}, [token]);

const [user, setUser] = useState<IUser | null>(null);
const [loggedIn, setLoggedIn] = useState(false);

return (
<ChakraProvider theme={theme}>
<Router>
<Box width="100vw" height="100vh" display="flex" flexDirection="column">
{loggedIn && username != "" ? (
{token ? (
<NavbarSignedIn
stateVariable={{ username, token }}
updateState={{ setUser, setToken }}
Expand Down
5 changes: 4 additions & 1 deletion frontend/src/components/NavbarSignedIn.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ import logo from "../../public/TheLeaf.png";
import { ReactNode } from "react";
import { useNavigate, Link as ReactLink } from "react-router-dom";

// const vite_backend_url = import.meta.env.VITE_BACKEND_URL as string;
const vite_backend_url = "https://gather-app-307.azurewebsites.net";

const NavLink = ({
children,
handleClick,
Expand Down Expand Up @@ -99,7 +102,7 @@ const NavbarSignedIn = ({ stateVariable, updateState }: Props) => {
>
<Avatar
name={stateVariable.username}
src={`http://localhost:3001/${stateVariable._id}/avatar`}
src={`${vite_backend_url}/${stateVariable._id}/avatar`}
/>
</MenuButton>
<MenuList>
Expand Down
5 changes: 4 additions & 1 deletion frontend/src/components/UserProfile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ import { CopyIcon } from "@chakra-ui/icons";
import { fetchUserWithString } from "../../lib/fetches";
import { editUser } from "../../lib/edits";

// const vite_backend_url = import.meta.env.VITE_BACKEND_URL as string;
const vite_backend_url = "https://gather-app-307.azurewebsites.net";

interface UserProfileProps {
userId: string;
}
Expand Down Expand Up @@ -94,7 +97,7 @@ const UserProfile: React.FC<UserProfileProps> = ({ userId }) => {
<Avatar
size="2xl"
name={profileData.username}
src={`http://localhost:3001/${userId}/avatar`}
src={`${vite_backend_url}/${userId}/avatar`}
/>
</Flex>
<Heading size="md" mb={4} alignSelf={"center"} textAlign={"center"}>
Expand Down
3 changes: 2 additions & 1 deletion frontend/src/pages/ItemsPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ const ItemsPage: React.FC<Props> = ({
}, [stateVariable.user]);

return (
<Box w="100vw" p="0px 20px" bg="var(--col-bright)" overflow="auto">
<Box w="100vw" p="0px 20px" bg="var(--col-bright)" overflow="auto" height="100%">
<Flex direction="column" minH="100%" width="full">
{/* Header flex */}
<HStack
Expand All @@ -61,6 +61,7 @@ const ItemsPage: React.FC<Props> = ({
alignItems="center"
flexDir="row"
minHeight="8vh"
//
>
<Heading
color="var(--col-secondary)"
Expand Down

0 comments on commit 1d008d2

Please sign in to comment.