Fix layout.

This commit is contained in:
Lucid Kobold
2022-06-24 09:39:49 -05:00
parent 9c18730126
commit 7b36b040e5
7 changed files with 151 additions and 119 deletions

View File

@@ -24,6 +24,7 @@ const generateSticker = (): -2 | -1 | 0 | 1 | 2 => {
} }
}; };
// TODO: Update so seeder takes in a month or date to then generate the stickers for it.
/** /**
* This seeder is to simulate the date and sticker info from the database. * This seeder is to simulate the date and sticker info from the database.
* Filling up an array for the current month with sticker from ths first to * Filling up an array for the current month with sticker from ths first to

View File

@@ -90,11 +90,12 @@ const Day = ({
return isOverflow ? ( return isOverflow ? (
<VStack <VStack
bg="transparent"
color="gray.600"
border="1px solid #181d8f"
w="100%" w="100%"
h="100%" h="100%"
bg="transparent"
pt={2}
color="gray.600"
border="1px solid #181d8f"
_hover={{ _hover={{
cursor: isBefore(currDateObj, endOfDay(currDate)) cursor: isBefore(currDateObj, endOfDay(currDate))
? "pointer" ? "pointer"
@@ -107,7 +108,6 @@ const Day = ({
spacing="0.5rem" spacing="0.5rem"
alignContent="center" alignContent="center"
justifyContent="flex-start" justifyContent="flex-start"
pt={2}
> >
<Text w="auto" h="auto"> <Text w="auto" h="auto">
{`${getDate(currDateObj)}`} {`${getDate(currDateObj)}`}
@@ -126,6 +126,8 @@ const Day = ({
</VStack> </VStack>
) : ( ) : (
<VStack <VStack
w="100%"
h="100%"
bg={ bg={
tutorial tutorial
? tutorial === "add" && isToday ? tutorial === "add" && isToday
@@ -148,8 +150,6 @@ const Day = ({
: "1px solid #0068ff" : "1px solid #0068ff"
: "1px solid #0068ff" : "1px solid #0068ff"
} }
w="100%"
h="100%"
onClick={() => { onClick={() => {
setStep(0); setStep(0);
setSelectedSticker(null); setSelectedSticker(null);
@@ -175,6 +175,8 @@ const Day = ({
}} }}
> >
<Text <Text
h="auto"
w="auto"
p={ p={
isToday isToday
? getDate(currDateObj) > 10 ? getDate(currDateObj) > 10
@@ -182,8 +184,6 @@ const Day = ({
: "0px 9px 3px 9px" : "0px 9px 3px 9px"
: "auto" : "auto"
} }
h="auto"
w="auto"
border={isToday ? "1px solid #0068ff" : "0px"} border={isToday ? "1px solid #0068ff" : "0px"}
borderRadius={isToday ? "100px" : "0px"} borderRadius={isToday ? "100px" : "0px"}
> >

View File

@@ -73,24 +73,24 @@ const Calender = ({
<CalenderNav title={title} isLoading={isLoading} /> <CalenderNav title={title} isLoading={isLoading} />
<VStack h="100%" w="100%" spacing={0}> <VStack h="100%" w="100%" spacing={0}>
<HStack <HStack
px={{ base: 1, sm: 2, md: 6 }}
spacing={0}
w="100%" w="100%"
h="auto" h="auto"
px={{ base: 1, sm: 2, md: 6 }}
spacing={0}
alignContent="center" alignContent="center"
alignItems="center" alignItems="center"
> >
{weekdays.map((weekDay) => { {weekdays.map((weekDay) => {
return ( return (
<Box <Box
key={weekDay}
display="flex" display="flex"
alignContent="center"
alignItems="center"
bg="transparent"
border="1px solid #0068ff"
w="100%" w="100%"
h={10} h={10}
key={weekDay} bg="transparent"
border="1px solid #0068ff"
alignContent="center"
alignItems="center"
> >
<Text display={{ base: "none", md: "block" }} w="100%" h="auto"> <Text display={{ base: "none", md: "block" }} w="100%" h="auto">
{weekDay} {weekDay}
@@ -110,9 +110,9 @@ const Calender = ({
})} })}
</HStack> </HStack>
<SimpleGrid <SimpleGrid
px={{ base: 1, sm: 2, md: 6 }}
w="100%" w="100%"
h="100%" h="100%"
px={{ base: 1, sm: 2, md: 6 }}
columns={7} columns={7}
alignItems="center" alignItems="center"
> >

View File

@@ -60,7 +60,8 @@ const CalenderExample = ({
useEffect(() => { useEffect(() => {
const getCurrentWeek = (): MonthDay[] => { const getCurrentWeek = (): MonthDay[] => {
let foundWeek: MonthDay[] | null; let foundWeek: MonthDay[];
for (const week in month) { for (const week in month) {
const currWeek = month[week]; const currWeek = month[week];
@@ -82,26 +83,39 @@ const CalenderExample = ({
}, [currWeek, dispatch, month]); }, [currWeek, dispatch, month]);
return ( return (
<VStack h="8.5rem" w="100%" spacing={0}> <VStack
<HStack h="auto"
px={{ base: 1, sm: 2, md: 6 }} w="100%"
alignContent="center"
alignItems="center"
spacing={2}
>
<VStack
h="8.5rem"
w="100%"
alignContent="center"
alignItems="center"
spacing={0} spacing={0}
>
<HStack
w="100%" w="100%"
h="auto" h="auto"
alignContent="center" alignContent="center"
alignItems="center" alignItems="center"
spacing={0}
px={{ base: 1, sm: 2, md: 6 }}
> >
{weekdays.map((weekDay) => { {weekdays.map((weekDay) => {
return ( return (
<Box <Box
key={weekDay}
display="flex" display="flex"
alignContent="center"
alignItems="center"
bg="transparent"
border="1px solid #0068ff"
w="100%" w="100%"
h={10} h={10}
key={weekDay} bg="transparent"
border="1px solid #0068ff"
alignContent="center"
alignItems="center"
> >
<Text display={{ base: "none", md: "block" }} w="100%" h="auto"> <Text display={{ base: "none", md: "block" }} w="100%" h="auto">
{weekDay} {weekDay}
@@ -121,10 +135,10 @@ const CalenderExample = ({
})} })}
</HStack> </HStack>
<SimpleGrid <SimpleGrid
px={{ base: 1, sm: 2, md: 6 }}
w="100%" w="100%"
h="100%" h="100%"
columns={7} columns={7}
px={{ base: 1, sm: 2, md: 6 }}
alignItems="center" alignItems="center"
> >
{currWeek && {currWeek &&
@@ -168,6 +182,23 @@ const CalenderExample = ({
})} })}
</SimpleGrid> </SimpleGrid>
</VStack> </VStack>
{type === "edit" && (
<VStack
w="100%"
h="auto"
alignContent="center"
alignItems="center"
spacing={2}
>
<Text>
{
"Not being able to edit within this tutorial when the current date is the start of the month is a known bug."
}
</Text>
<Text>{"This bug will be fixed in beta v2."}</Text>
</VStack>
)}
</VStack>
); );
}; };

View File

@@ -18,9 +18,9 @@ const TutorialLinks = (): JSX.Element => {
{"More Info"} {"More Info"}
</Heading> </Heading>
<HStack <HStack
display={{ base: "none", lg: "flex" }}
h="auto" h="auto"
w="100%" w="100%"
display={{ base: "none", lg: "flex" }}
justifyContent="center" justifyContent="center"
alignContent="center" alignContent="center"
spacing={4} spacing={4}
@@ -49,9 +49,9 @@ const TutorialLinks = (): JSX.Element => {
})} })}
</HStack> </HStack>
<VStack <VStack
display={{ base: "flex", lg: "none" }}
h="auto" h="auto"
w="100%" w="100%"
display={{ base: "flex", lg: "none" }}
justifyContent="center" justifyContent="center"
alignContent="center" alignContent="center"
spacing={4} spacing={4}

View File

@@ -99,18 +99,18 @@ const Header = (): JSX.Element => {
> >
{/* Logo | Site Name */} {/* Logo | Site Name */}
<HStack <HStack
display={{ base: "flex", lg: "none" }}
position="absolute"
width="100%" width="100%"
height={12}
top={0}
ml={4}
spacing="5px"
justifyContent={{ justifyContent={{
base: "flex-start", base: "flex-start",
sm: "center" sm: "center"
}} }}
alignItems="center" alignItems="center"
height={12}
top={0}
position="absolute"
ml={4}
display={{ base: "flex", lg: "none" }}
spacing="5px"
_hover={{ _hover={{
cursor: "default" cursor: "default"
}} }}
@@ -163,21 +163,21 @@ const Header = (): JSX.Element => {
</HStack> </HStack>
<Menu isLazy lazyBehavior="unmount" isOpen={open}> <Menu isLazy lazyBehavior="unmount" isOpen={open}>
<MenuButton <MenuButton
id="mobile-menu-button"
as={IconButton} as={IconButton}
aria-label="Mobile Menu" aria-label="Mobile Menu"
icon={menuIcon()} icon={menuIcon()}
onClick={() => setOpen(!open)}
onMouseEnter={() => setHover(true)}
onMouseLeave={() => setHover(false)}
display={{ display={{
base: "inline-flex", base: "inline-flex",
lg: "none" lg: "none"
}} }}
variant="mobileNav"
bg={transparentNavbar ? "transparent" : "rgba(255, 255, 255, .15)"} bg={transparentNavbar ? "transparent" : "rgba(255, 255, 255, .15)"}
type="button"
border={transparentNavbar ? "1px solid #0068ff" : "none"} border={transparentNavbar ? "1px solid #0068ff" : "none"}
id="mobile-menu-button" variant="mobileNav"
type="button"
onClick={() => setOpen(!open)}
onMouseEnter={() => setHover(true)}
onMouseLeave={() => setHover(false)}
/> />
<MobileNav updateOpen={setOpen} /> <MobileNav updateOpen={setOpen} />
</Menu> </Menu>

View File

@@ -17,12 +17,12 @@ const MobileNav: FC<MobileNavProps> = ({ updateOpen }: MobileNavProps) => {
<MenuList <MenuList
as="nav" as="nav"
display={{ base: "block", lg: "none" }} display={{ base: "block", lg: "none" }}
bg="brand.main"
h="auto" h="auto"
w="100%" w="100%"
p={0} p={0}
border="none" border="none"
boxShadow="none" boxShadow="none"
bg="brand.main"
> >
{navItems.map((navItem: NavItem, index: number) => { {navItems.map((navItem: NavItem, index: number) => {
return ( return (