Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
15 changes: 12 additions & 3 deletions frontend/components/dashboard/ActivityPanel.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { VStack, Box, HStack, Heading } from "@chakra-ui/react";
import { VStack, Box, HStack, Heading, useColorMode } from "@chakra-ui/react";
import { ActivityGraph } from "./ActivityGraph";
import moment from "moment";
import { parseMins } from "../../lib/utils";
Expand Down Expand Up @@ -123,16 +123,25 @@ export const ActivityPanel = ({ userId }: { userId: any }) => {
(x) => moment(x.date).unix(),
"desc"
);

const { colorMode } = useColorMode();

const borderColor = {
light: "white",
dark: "white",
};

return (
<VStack
p="6"
h="xl"
bg="white"
shadow="base"
rounded="lg"
height="100%"
my={10}
alignItems={"flex-start"}
alignItems="flex-start"
border="1px"
borderColor={borderColor[colorMode]}
>
{activitySorted && <ActivityCard latestActivity={activitySorted[0]} />}
<HStack width={"100%"} justifyContent={"flex-end"}>
Expand Down
13 changes: 10 additions & 3 deletions frontend/components/dashboard/SleepPanel.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { VStack, Box, HStack, Heading } from "@chakra-ui/react";
import { VStack, Box, HStack, Heading, useColorMode } from "@chakra-ui/react";
import { SleepGraph } from "./SleepGraph";
import moment from "moment";
import { parseSecs } from "../../lib/utils";
Expand Down Expand Up @@ -125,16 +125,23 @@ export const SleepPanel = ({ userId }:any) => {
}
};
const sleepsSorted = _.orderBy(sleeps, (x) => moment(x.date).unix(), "desc");
const { colorMode } = useColorMode();
const borderColor = {
light: "white",
dark: "white",
};

return (
<VStack
p="6"
h="xl"
bg="white"
shadow="base"
rounded="lg"
height="100%"
my={10}
alignItems={"flex-start"}
alignItems="flex-start"
border="1px"
borderColor={borderColor[colorMode]}
>
{sleeps && <SleepDayCard latestSleep={sleepsSorted[0]} />}
<HStack width={"100%"} justifyContent={"flex-end"}>
Expand Down
14 changes: 14 additions & 0 deletions frontend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions frontend/pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ const Home: NextPage = () => {
<VStack
my={10}
px={10}
backgroundColor={"#fcfdff"}
height={"100vh"}
spacing={10}
alignItems={"flex-start"}
Expand All @@ -41,7 +40,7 @@ const Home: NextPage = () => {
Request user data and plot activity, workout sleep and other
health information.
</Text>
<HStack width={"100%"} spacing={10} alignItems={"flex-start"}>
<HStack width={"100%"} spacing={4} alignItems={"flex-start"}>
<Box width={"50%"}>
<SleepPanel userId={userID} />
</Box>
Expand Down
Loading