@@ -180,7 +180,7 @@ const DatePicker = (): JSX.Element => {
|
|||||||
py={4}
|
py={4}
|
||||||
>
|
>
|
||||||
<Heading as="h4" size="sm" fontWeight="semibold">
|
<Heading as="h4" size="sm" fontWeight="semibold">
|
||||||
Required fields indicated with{" "}
|
{"Required fields indicated with"}
|
||||||
<FormValidateEmoji type="Required" />
|
<FormValidateEmoji type="Required" />
|
||||||
</Heading>
|
</Heading>
|
||||||
<Field name="date" validate={validateDate}>
|
<Field name="date" validate={validateDate}>
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ import {
|
|||||||
SimpleGrid,
|
SimpleGrid,
|
||||||
Box
|
Box
|
||||||
} from "@chakra-ui/react";
|
} from "@chakra-ui/react";
|
||||||
import React, { useState, useContext } from "react";
|
import React, { useState, useContext, useRef } from "react";
|
||||||
import { format, isSameDay } from "date-fns";
|
import { format, isSameDay } from "date-fns";
|
||||||
import { Icon } from "@iconify/react";
|
import { Icon } from "@iconify/react";
|
||||||
import { StickersContext } from "../../../contexts/StickerContext";
|
import { StickersContext } from "../../../contexts/StickerContext";
|
||||||
@@ -58,7 +58,7 @@ const AddUpdateSticker = ({
|
|||||||
|
|
||||||
const { addEditSticker } = useContext(StickersContext);
|
const { addEditSticker } = useContext(StickersContext);
|
||||||
|
|
||||||
// ! Update these states to sat "add" and "edit" for easier reading.
|
// ! Update these states to say "add" and "edit" for easier reading.
|
||||||
|
|
||||||
const [modalVariant] = useState<"currDate" | "notCurrDate">(
|
const [modalVariant] = useState<"currDate" | "notCurrDate">(
|
||||||
isSameDay(date, new Date()) ? "currDate" : "notCurrDate"
|
isSameDay(date, new Date()) ? "currDate" : "notCurrDate"
|
||||||
@@ -75,6 +75,9 @@ const AddUpdateSticker = ({
|
|||||||
handleClose();
|
handleClose();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// The first sticker to have focus when the modal opens.
|
||||||
|
const initialRef = useRef();
|
||||||
|
|
||||||
// * Double check that the submit button is disabled if the selected sticker is the same as the current sticker.
|
// * Double check that the submit button is disabled if the selected sticker is the same as the current sticker.
|
||||||
|
|
||||||
const variants = {
|
const variants = {
|
||||||
@@ -97,6 +100,7 @@ const AddUpdateSticker = ({
|
|||||||
currSticker={currSticker}
|
currSticker={currSticker}
|
||||||
selectedSticker={selectedSticker}
|
selectedSticker={selectedSticker}
|
||||||
updateSelectedSticker={updateSelectedSticker}
|
updateSelectedSticker={updateSelectedSticker}
|
||||||
|
initialSticker={initialRef}
|
||||||
/>
|
/>
|
||||||
</VStack>
|
</VStack>
|
||||||
),
|
),
|
||||||
@@ -140,6 +144,7 @@ const AddUpdateSticker = ({
|
|||||||
currSticker={currSticker}
|
currSticker={currSticker}
|
||||||
selectedSticker={selectedSticker}
|
selectedSticker={selectedSticker}
|
||||||
updateSelectedSticker={updateSelectedSticker}
|
updateSelectedSticker={updateSelectedSticker}
|
||||||
|
initialSticker={initialRef}
|
||||||
/>
|
/>
|
||||||
</VStack>
|
</VStack>
|
||||||
),
|
),
|
||||||
@@ -223,6 +228,7 @@ const AddUpdateSticker = ({
|
|||||||
return (
|
return (
|
||||||
<Modal
|
<Modal
|
||||||
isCentered
|
isCentered
|
||||||
|
initialFocusRef={initialRef}
|
||||||
isOpen={isOpen}
|
isOpen={isOpen}
|
||||||
onClose={() => handleClose()}
|
onClose={() => handleClose()}
|
||||||
motionPreset="slideInBottom"
|
motionPreset="slideInBottom"
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ interface StickerSelectorProps {
|
|||||||
currSticker: StickerVal;
|
currSticker: StickerVal;
|
||||||
selectedSticker: StickerVal;
|
selectedSticker: StickerVal;
|
||||||
updateSelectedSticker: React.Dispatch<React.SetStateAction<StickerVal>>;
|
updateSelectedSticker: React.Dispatch<React.SetStateAction<StickerVal>>;
|
||||||
|
initialSticker: React.MutableRefObject<undefined>;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -21,19 +22,21 @@ const StickerSelector = ({
|
|||||||
stickerSet,
|
stickerSet,
|
||||||
currSticker,
|
currSticker,
|
||||||
selectedSticker,
|
selectedSticker,
|
||||||
updateSelectedSticker
|
updateSelectedSticker,
|
||||||
|
initialSticker
|
||||||
}: StickerSelectorProps): JSX.Element => {
|
}: StickerSelectorProps): JSX.Element => {
|
||||||
const stickers = {
|
const stickers = {
|
||||||
Demo: (
|
Demo: (
|
||||||
<HStack
|
<HStack
|
||||||
w="100%"
|
w="100%"
|
||||||
h="auto"
|
h="auto"
|
||||||
justifyContent={"center"}
|
justifyContent="center"
|
||||||
alignContent={"center"}
|
alignContent="center"
|
||||||
spacing={14}
|
spacing={14}
|
||||||
>
|
>
|
||||||
<Button
|
<Button
|
||||||
isDisabled={currSticker >= 1}
|
isDisabled={currSticker >= 1}
|
||||||
|
ref={currSticker <= 1 ? initialSticker : null}
|
||||||
border={selectedSticker === 1 ? "1px solid #FFF" : "opx"}
|
border={selectedSticker === 1 ? "1px solid #FFF" : "opx"}
|
||||||
bg={selectedSticker === 1 && "gray.800"}
|
bg={selectedSticker === 1 && "gray.800"}
|
||||||
onClick={() => updateSelectedSticker(1)}
|
onClick={() => updateSelectedSticker(1)}
|
||||||
@@ -43,6 +46,7 @@ const StickerSelector = ({
|
|||||||
</Button>
|
</Button>
|
||||||
<Button
|
<Button
|
||||||
isDisabled={currSticker === 0}
|
isDisabled={currSticker === 0}
|
||||||
|
ref={currSticker >= 1 ? initialSticker : null}
|
||||||
border={selectedSticker === 0 ? "1px solid #FFF" : "opx"}
|
border={selectedSticker === 0 ? "1px solid #FFF" : "opx"}
|
||||||
bg={selectedSticker === 0 && "gray.800"}
|
bg={selectedSticker === 0 && "gray.800"}
|
||||||
onClick={() => updateSelectedSticker(0)}
|
onClick={() => updateSelectedSticker(0)}
|
||||||
|
|||||||
37
components/loading/LoadingOverlay.tsx
Normal file
37
components/loading/LoadingOverlay.tsx
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
import {
|
||||||
|
Box,
|
||||||
|
Modal,
|
||||||
|
ModalBody,
|
||||||
|
ModalContent,
|
||||||
|
ModalOverlay
|
||||||
|
} from "@chakra-ui/react";
|
||||||
|
import React from "react";
|
||||||
|
import LoadingSpinner from "./LoadingSpinner";
|
||||||
|
|
||||||
|
const LoadingOverlay = (): JSX.Element => {
|
||||||
|
return (
|
||||||
|
<Modal
|
||||||
|
isCentered
|
||||||
|
isOpen
|
||||||
|
onClose={() => null}
|
||||||
|
motionPreset="slideInBottom"
|
||||||
|
scrollBehavior="inside"
|
||||||
|
size="xs"
|
||||||
|
>
|
||||||
|
<ModalOverlay bg="loading.overlayBg" />
|
||||||
|
<ModalContent bg="transparent" boxShadow="none">
|
||||||
|
{/* <ModalHeader>
|
||||||
|
</ModalHeader> */}
|
||||||
|
<ModalBody border="0px">
|
||||||
|
<Box h="100%" w="100%" textAlign="center">
|
||||||
|
<LoadingSpinner />
|
||||||
|
</Box>
|
||||||
|
</ModalBody>
|
||||||
|
{/* <ModalFooter>
|
||||||
|
</ModalFooter> */}
|
||||||
|
</ModalContent>
|
||||||
|
</Modal>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default LoadingOverlay;
|
||||||
16
components/loading/LoadingSpinner.tsx
Normal file
16
components/loading/LoadingSpinner.tsx
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
import { Spinner } from "@chakra-ui/react";
|
||||||
|
import React from "react";
|
||||||
|
|
||||||
|
const LoadingSpinner = (): JSX.Element => {
|
||||||
|
return (
|
||||||
|
<Spinner
|
||||||
|
thickness="4px"
|
||||||
|
speed="0.50s"
|
||||||
|
emptyColor="loading.spinnerEmptySpace"
|
||||||
|
color="loading.spinnerColor"
|
||||||
|
size="xl"
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default LoadingSpinner;
|
||||||
@@ -2,7 +2,7 @@
|
|||||||
"private": true,
|
"private": true,
|
||||||
"name": "lucid-creations-media-potty-chart",
|
"name": "lucid-creations-media-potty-chart",
|
||||||
"homepage": "https://lucidcreations.media/introducing-code-name-potty-chart/",
|
"homepage": "https://lucidcreations.media/introducing-code-name-potty-chart/",
|
||||||
"version": "v0.0.9.4-alpha",
|
"version": "v0.0.9.5-alpha",
|
||||||
"author": {
|
"author": {
|
||||||
"name": "Lucid Creations Media",
|
"name": "Lucid Creations Media",
|
||||||
"url": "https://lucidcreations.media",
|
"url": "https://lucidcreations.media",
|
||||||
@@ -39,7 +39,7 @@
|
|||||||
"eslint-plugin-react": "^7.29.4",
|
"eslint-plugin-react": "^7.29.4",
|
||||||
"eslint-plugin-react-hooks": "<=4.3.0",
|
"eslint-plugin-react-hooks": "<=4.3.0",
|
||||||
"prettier": "^2.6.2",
|
"prettier": "^2.6.2",
|
||||||
"typescript": "^4.6.3"
|
"typescript": "<4.6.0"
|
||||||
},
|
},
|
||||||
"packageManager": "yarn@3.1.0"
|
"packageManager": "yarn@3.1.0"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -30,6 +30,11 @@ const AppTheme = extendTheme({
|
|||||||
footerText: "black",
|
footerText: "black",
|
||||||
content: "#2d3748",
|
content: "#2d3748",
|
||||||
patreon: "#FF424D"
|
patreon: "#FF424D"
|
||||||
|
},
|
||||||
|
loading: {
|
||||||
|
overlayBg: "#171923cb",
|
||||||
|
spinnerColor: "#0088ff",
|
||||||
|
spinnerEmptySpace: "#2D374860"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
styles: {
|
styles: {
|
||||||
|
|||||||
@@ -96,8 +96,7 @@ const Footer = (): JSX.Element => {
|
|||||||
</MotionBox>
|
</MotionBox>
|
||||||
<Text color="brand.footerText" fontSize="xs">
|
<Text color="brand.footerText" fontSize="xs">
|
||||||
©
|
©
|
||||||
{" 2021 - "}
|
{` 2021 - ${new Date().getFullYear()} `}
|
||||||
{new Date().getFullYear()}{" "}
|
|
||||||
<Link
|
<Link
|
||||||
href="https://lucidcreations.media"
|
href="https://lucidcreations.media"
|
||||||
rel="noopener"
|
rel="noopener"
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ import appLogo from "../../public/images/logo.svg";
|
|||||||
|
|
||||||
const Header = (): JSX.Element => {
|
const Header = (): JSX.Element => {
|
||||||
const appName = "LCM Potty Chart";
|
const appName = "LCM Potty Chart";
|
||||||
const appVersion = "v0.0.9.4-alpha";
|
const appVersion = "v0.0.9.5-alpha";
|
||||||
|
|
||||||
// Add transparency while not at the top of the page.
|
// Add transparency while not at the top of the page.
|
||||||
const [transparentNavbar, setTransparentNavbar] = useState<boolean>(false);
|
const [transparentNavbar, setTransparentNavbar] = useState<boolean>(false);
|
||||||
@@ -70,11 +70,11 @@ const Header = (): JSX.Element => {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<Box
|
<Box
|
||||||
zIndex={1000000}
|
zIndex={1}
|
||||||
w="100%"
|
w="100%"
|
||||||
pos="fixed"
|
pos="fixed"
|
||||||
top="0"
|
top={0}
|
||||||
alignItems={"center"}
|
alignItems="center"
|
||||||
boxShadow={
|
boxShadow={
|
||||||
open
|
open
|
||||||
? "none"
|
? "none"
|
||||||
|
|||||||
18
yarn.lock
18
yarn.lock
@@ -3652,7 +3652,7 @@ __metadata:
|
|||||||
react: <=17.0.2
|
react: <=17.0.2
|
||||||
react-dom: <=17.0.2
|
react-dom: <=17.0.2
|
||||||
sharp: ^0.30.3
|
sharp: ^0.30.3
|
||||||
typescript: ^4.6.3
|
typescript: <4.6.0
|
||||||
languageName: unknown
|
languageName: unknown
|
||||||
linkType: soft
|
linkType: soft
|
||||||
|
|
||||||
@@ -5160,23 +5160,23 @@ __metadata:
|
|||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
"typescript@npm:^4.6.3":
|
"typescript@npm:<4.6.0":
|
||||||
version: 4.6.3
|
version: 4.5.5
|
||||||
resolution: "typescript@npm:4.6.3"
|
resolution: "typescript@npm:4.5.5"
|
||||||
bin:
|
bin:
|
||||||
tsc: bin/tsc
|
tsc: bin/tsc
|
||||||
tsserver: bin/tsserver
|
tsserver: bin/tsserver
|
||||||
checksum: 255bb26c8cb846ca689dd1c3a56587af4f69055907aa2c154796ea28ee0dea871535b1c78f85a6212c77f2657843a269c3a742d09d81495b97b914bf7920415b
|
checksum: 506f4c919dc8aeaafa92068c997f1d213b9df4d9756d0fae1a1e7ab66b585ab3498050e236113a1c9e57ee08c21ec6814ca7a7f61378c058d79af50a4b1f5a5e
|
||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
"typescript@patch:typescript@^4.6.3#~builtin<compat/typescript>":
|
"typescript@patch:typescript@<4.6.0#~builtin<compat/typescript>":
|
||||||
version: 4.6.3
|
version: 4.5.5
|
||||||
resolution: "typescript@patch:typescript@npm%3A4.6.3#~builtin<compat/typescript>::version=4.6.3&hash=ddd1e8"
|
resolution: "typescript@patch:typescript@npm%3A4.5.5#~builtin<compat/typescript>::version=4.5.5&hash=ddd1e8"
|
||||||
bin:
|
bin:
|
||||||
tsc: bin/tsc
|
tsc: bin/tsc
|
||||||
tsserver: bin/tsserver
|
tsserver: bin/tsserver
|
||||||
checksum: fe6bdc1afb2f145ddb7b0a3a31f96352209f6a5704d97f038414ea22ff9d8dd42f32cfb6652e30458d7d958d2d4e85de2df11c574899c6f750a6b3c0e90a3a76
|
checksum: 9cdde4aae20b2904431f3f2ca8acaf3b0cc52faddf68aa88b288c9d0520221817da43783a756fce7ab9360033ada0371c3ff93dfc4bdb4b13f6e9bac64e1658d
|
||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user