Fix layout.
This commit is contained in:
@@ -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
|
||||||
|
|||||||
@@ -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
|
||||||
@@ -133,8 +135,8 @@ const Day = ({
|
|||||||
: tutorial === "edit" &&
|
: tutorial === "edit" &&
|
||||||
!isToday &&
|
!isToday &&
|
||||||
isBefore(currDateObj, endOfDay(currDate))
|
isBefore(currDateObj, endOfDay(currDate))
|
||||||
? "gray.600"
|
? "gray.600"
|
||||||
: "transparent"
|
: "transparent"
|
||||||
: "transparent"
|
: "transparent"
|
||||||
}
|
}
|
||||||
border={
|
border={
|
||||||
@@ -144,12 +146,10 @@ const Day = ({
|
|||||||
: tutorial === "edit" &&
|
: tutorial === "edit" &&
|
||||||
!isToday &&
|
!isToday &&
|
||||||
isBefore(currDateObj, endOfDay(currDate))
|
isBefore(currDateObj, endOfDay(currDate))
|
||||||
? "1px solid #00ff3c"
|
? "1px solid #00ff3c"
|
||||||
: "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);
|
||||||
@@ -168,13 +168,15 @@ const Day = ({
|
|||||||
: tutorial === "edit" &&
|
: tutorial === "edit" &&
|
||||||
!isToday &&
|
!isToday &&
|
||||||
isBefore(currDateObj, endOfDay(currDate))
|
isBefore(currDateObj, endOfDay(currDate))
|
||||||
? "gray.600"
|
? "gray.600"
|
||||||
: "transparent"
|
: "transparent"
|
||||||
: "transparent",
|
: "transparent",
|
||||||
border: "1px solid #FFF"
|
border: "1px solid #FFF"
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<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"}
|
||||||
>
|
>
|
||||||
|
|||||||
@@ -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"
|
||||||
>
|
>
|
||||||
@@ -151,7 +151,7 @@ const Calender = ({
|
|||||||
id.length
|
id.length
|
||||||
? id
|
? id
|
||||||
: format(toDateObj, "yyyyddLL") +
|
: format(toDateObj, "yyyyddLL") +
|
||||||
`/${sticker === null ? 0 : sticker}`
|
`/${sticker === null ? 0 : sticker}`
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -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,91 +83,121 @@ 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%"
|
||||||
spacing={0}
|
alignContent="center"
|
||||||
|
alignItems="center"
|
||||||
|
spacing={2}
|
||||||
|
>
|
||||||
|
<VStack
|
||||||
|
h="8.5rem"
|
||||||
w="100%"
|
w="100%"
|
||||||
h="auto"
|
|
||||||
alignContent="center"
|
alignContent="center"
|
||||||
alignItems="center"
|
alignItems="center"
|
||||||
|
spacing={0}
|
||||||
>
|
>
|
||||||
{weekdays.map((weekDay) => {
|
<HStack
|
||||||
return (
|
w="100%"
|
||||||
<Box
|
h="auto"
|
||||||
display="flex"
|
alignContent="center"
|
||||||
alignContent="center"
|
alignItems="center"
|
||||||
alignItems="center"
|
spacing={0}
|
||||||
bg="transparent"
|
px={{ base: 1, sm: 2, md: 6 }}
|
||||||
border="1px solid #0068ff"
|
>
|
||||||
w="100%"
|
{weekdays.map((weekDay) => {
|
||||||
h={10}
|
|
||||||
key={weekDay}
|
|
||||||
>
|
|
||||||
<Text display={{ base: "none", md: "block" }} w="100%" h="auto">
|
|
||||||
{weekDay}
|
|
||||||
</Text>
|
|
||||||
<Text
|
|
||||||
display={{ base: "none", sm: "block", md: "none" }}
|
|
||||||
w="100%"
|
|
||||||
h="auto"
|
|
||||||
>
|
|
||||||
{weekDay.substring(0, 3)}
|
|
||||||
</Text>
|
|
||||||
<Text display={{ base: "block", sm: "none" }} w="100%" h="auto">
|
|
||||||
{weekDay.substring(0, 2)}
|
|
||||||
</Text>
|
|
||||||
</Box>
|
|
||||||
);
|
|
||||||
})}
|
|
||||||
</HStack>
|
|
||||||
<SimpleGrid
|
|
||||||
px={{ base: 1, sm: 2, md: 6 }}
|
|
||||||
w="100%"
|
|
||||||
h="100%"
|
|
||||||
columns={7}
|
|
||||||
alignItems="center"
|
|
||||||
>
|
|
||||||
{currWeek &&
|
|
||||||
currWeek.map((day: MonthDay) => {
|
|
||||||
const { date, isOverflow, overflowDirection } = day;
|
|
||||||
|
|
||||||
const toDateObj: Date = new Date(date);
|
|
||||||
|
|
||||||
let sticker = null;
|
|
||||||
|
|
||||||
let id = "";
|
|
||||||
|
|
||||||
stickersMonth.map((stickerDay) => {
|
|
||||||
const { date: stickerDate } = stickerDay;
|
|
||||||
|
|
||||||
if (isSameDay(new Date(stickerDate), toDateObj)) {
|
|
||||||
sticker = stickerDay.sticker;
|
|
||||||
|
|
||||||
id = stickerDay.id;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Day
|
<Box
|
||||||
isLoading={isLoading}
|
key={weekDay}
|
||||||
isOverflow={isOverflow}
|
display="flex"
|
||||||
overflowDirection={overflowDirection}
|
w="100%"
|
||||||
currSticker={sticker}
|
h={10}
|
||||||
date={date}
|
bg="transparent"
|
||||||
selectedDate={selectedDate.date}
|
border="1px solid #0068ff"
|
||||||
currDate={currDateObj}
|
alignContent="center"
|
||||||
tutorial={type}
|
alignItems="center"
|
||||||
key={
|
>
|
||||||
id.length
|
<Text display={{ base: "none", md: "block" }} w="100%" h="auto">
|
||||||
? id
|
{weekDay}
|
||||||
: format(toDateObj, "yyyyddLL") +
|
</Text>
|
||||||
`/${sticker === null ? 0 : sticker}`
|
<Text
|
||||||
}
|
display={{ base: "none", sm: "block", md: "none" }}
|
||||||
/>
|
w="100%"
|
||||||
|
h="auto"
|
||||||
|
>
|
||||||
|
{weekDay.substring(0, 3)}
|
||||||
|
</Text>
|
||||||
|
<Text display={{ base: "block", sm: "none" }} w="100%" h="auto">
|
||||||
|
{weekDay.substring(0, 2)}
|
||||||
|
</Text>
|
||||||
|
</Box>
|
||||||
);
|
);
|
||||||
})}
|
})}
|
||||||
</SimpleGrid>
|
</HStack>
|
||||||
|
<SimpleGrid
|
||||||
|
w="100%"
|
||||||
|
h="100%"
|
||||||
|
columns={7}
|
||||||
|
px={{ base: 1, sm: 2, md: 6 }}
|
||||||
|
alignItems="center"
|
||||||
|
>
|
||||||
|
{currWeek &&
|
||||||
|
currWeek.map((day: MonthDay) => {
|
||||||
|
const { date, isOverflow, overflowDirection } = day;
|
||||||
|
|
||||||
|
const toDateObj: Date = new Date(date);
|
||||||
|
|
||||||
|
let sticker = null;
|
||||||
|
|
||||||
|
let id = "";
|
||||||
|
|
||||||
|
stickersMonth.map((stickerDay) => {
|
||||||
|
const { date: stickerDate } = stickerDay;
|
||||||
|
|
||||||
|
if (isSameDay(new Date(stickerDate), toDateObj)) {
|
||||||
|
sticker = stickerDay.sticker;
|
||||||
|
|
||||||
|
id = stickerDay.id;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Day
|
||||||
|
isLoading={isLoading}
|
||||||
|
isOverflow={isOverflow}
|
||||||
|
overflowDirection={overflowDirection}
|
||||||
|
currSticker={sticker}
|
||||||
|
date={date}
|
||||||
|
selectedDate={selectedDate.date}
|
||||||
|
currDate={currDateObj}
|
||||||
|
tutorial={type}
|
||||||
|
key={
|
||||||
|
id.length
|
||||||
|
? id
|
||||||
|
: format(toDateObj, "yyyyddLL") +
|
||||||
|
`/${sticker === null ? 0 : sticker}`
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
})}
|
||||||
|
</SimpleGrid>
|
||||||
|
</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>
|
</VStack>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -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}
|
||||||
|
|||||||
@@ -84,8 +84,8 @@ const Header = (): JSX.Element => {
|
|||||||
open
|
open
|
||||||
? "brand.main"
|
? "brand.main"
|
||||||
: transparentNavbar
|
: transparentNavbar
|
||||||
? "rgba(49, 56, 220, 0.9)"
|
? "rgba(49, 56, 220, 0.9)"
|
||||||
: "brand.main"
|
: "brand.main"
|
||||||
}
|
}
|
||||||
transition=".5s ease"
|
transition=".5s ease"
|
||||||
borderRadius="0px 0px 10px 10px"
|
borderRadius="0px 0px 10px 10px"
|
||||||
@@ -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>
|
||||||
|
|||||||
@@ -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 (
|
||||||
|
|||||||
Reference in New Issue
Block a user