diff --git a/components/Auth/Loading.tsx b/components/Auth/Loading.tsx index f2539f5d95..eb03bdeae7 100644 --- a/components/Auth/Loading.tsx +++ b/components/Auth/Loading.tsx @@ -38,7 +38,7 @@ export default function AuthLoading() { }} onClick={() => router.push( - "/auth?next=" + encodeURIComponent(window.location.href) + "/auth?next=" + encodeURIComponent(window.location.href), ) } /> diff --git a/components/CheckIns/Reflect/Emoji.tsx b/components/CheckIns/Reflect/Emoji.tsx index 2bfdcca405..4467e93ee6 100644 --- a/components/CheckIns/Reflect/Emoji.tsx +++ b/components/CheckIns/Reflect/Emoji.tsx @@ -196,15 +196,15 @@ export function Emoji({ mutationUrl, emoji, defaultData }) { 0: { name: defaultData?.reason }, 1: defaultData?.stress, 2: (questions as any)[2].choices.find( - ({ id }) => id == defaultData?.rest + ({ id }) => id == defaultData?.rest, ), 3: defaultData?.pain, 4: (questions as any)[4].choices.find( - ({ id }) => id == defaultData?.food + ({ id }) => id == defaultData?.food, ), } : {}, - [defaultData] + [defaultData], ); const [answers, setAnswers] = useState({ diff --git a/components/Coach/Goal/Activity.tsx b/components/Coach/Goal/Activity.tsx index cdfc293ef7..cee4bc81e6 100644 --- a/components/Coach/Goal/Activity.tsx +++ b/components/Coach/Goal/Activity.tsx @@ -29,8 +29,8 @@ export function GoalActivity({ goal, children, open, setOpen }) { .catch(() => toast.error( "Yikes! Something went wrong while trying to fetch your activity", - toastStyles - ) + toastStyles, + ), ); } }, [open, session, goal, data]); @@ -86,7 +86,7 @@ export function GoalActivity({ goal, children, open, setOpen }) { const daysInMonth = new Date( currentDate.year(), month + 1, - 0 + 0, ).getDate(); const isCurrentMonth = month === currentMonth; const monthDays = [...new Array(daysInMonth)]; @@ -131,7 +131,7 @@ export function GoalActivity({ goal, children, open, setOpen }) { .month(month) .date(day + 1) .format("MMMM D, YYYY"), - toastStyles + toastStyles, ) } sx={{ diff --git a/components/Coach/Goal/Create/Custom.tsx b/components/Coach/Goal/Create/Custom.tsx index 89a27204d2..832eb74365 100644 --- a/components/Coach/Goal/Create/Custom.tsx +++ b/components/Coach/Goal/Create/Custom.tsx @@ -64,7 +64,7 @@ export function CreateGoal() { setLoading(false); toast.error( "An error occurred while trying to set your goal. Please try again.", - toastStyles + toastStyles, ); } }; diff --git a/components/Coach/Goal/Create/card.tsx b/components/Coach/Goal/Create/card.tsx index 24e02074b7..193dc57e90 100644 --- a/components/Coach/Goal/Create/card.tsx +++ b/components/Coach/Goal/Create/card.tsx @@ -33,7 +33,7 @@ export function ExploreGoalCard({ goal }) { setLoading(false); toast.error( "An error occurred while trying to set your goal. Please try again.", - toastStyles + toastStyles, ); } }; diff --git a/components/Coach/Goal/Create/goalTemplates.tsx b/components/Coach/Goal/Create/goalTemplates.tsx index 17a42555c8..ced500ac8f 100644 --- a/components/Coach/Goal/Create/goalTemplates.tsx +++ b/components/Coach/Goal/Create/goalTemplates.tsx @@ -43,7 +43,6 @@ export const goals = [ category: "Fitness", description: "Drink 2 liters of water every day, for 30 days", durationDays: 30, - }, { name: "Go for a walk", @@ -51,7 +50,6 @@ export const goals = [ category: "Fitness", description: "Go for a walk every day, for 30 days", durationDays: 30, - }, { name: "Go to the gym", @@ -59,7 +57,6 @@ export const goals = [ category: "Fitness", description: "Go to the gym every day, for 30 days", durationDays: 30, - }, { name: "Write a blog post", @@ -67,7 +64,6 @@ export const goals = [ category: "Career", description: "Write a blog post every day, for 30 days", durationDays: 30, - }, { name: "Take a class", @@ -75,7 +71,6 @@ export const goals = [ category: "Education", description: "Take a class every day, for 30 days", durationDays: 30, - }, { name: "Write an email to a friend", @@ -83,7 +78,6 @@ export const goals = [ category: "Relationships", description: "Write an email to a friend every day, for 30 days", durationDays: 30, - }, { name: "Call a friend", @@ -91,7 +85,6 @@ export const goals = [ category: "Relationships", description: "Call a friend every day, for 30 days", durationDays: 30, - }, { name: "Cook a new recipe", @@ -99,7 +92,6 @@ export const goals = [ category: "Fitness", description: "Cook a new recipe every day, for 7 days", durationDays: 7, - }, { name: "Learn a new language", @@ -107,7 +99,6 @@ export const goals = [ category: "Education", description: "Learn a new language every day, for 100 days", durationDays: 100, - }, { name: "Learn a new skill", @@ -115,7 +106,6 @@ export const goals = [ category: "Education", description: "Learn a new skill every day, for 7 days", durationDays: 7, - }, { name: "Write a book", @@ -123,7 +113,6 @@ export const goals = [ category: "Education", description: "Work on a book every day, for a year", durationDays: 365, - }, { name: "Write a poem", @@ -131,7 +120,6 @@ export const goals = [ category: "Education", description: "Write a poem every day, for 100 days", durationDays: 100, - }, { name: "Learn to play an instrument", @@ -139,7 +127,6 @@ export const goals = [ category: "Hobbies", description: "Learn to play an instrument every day, for 100 days", durationDays: 100, - }, { name: "Learn to dance", @@ -147,7 +134,6 @@ export const goals = [ category: "Hobbies", description: "Learn to dance every day, for 10 days", durationDays: 10, - }, { name: "Visit a place", @@ -155,7 +141,6 @@ export const goals = [ category: "Hobbies", description: "Visit a place every day, for 7 days", durationDays: 7, - }, { name: "Limit your screen time to 1.5 hours", @@ -163,7 +148,6 @@ export const goals = [ category: "Mental health", description: "Limit your screen time to 1.5 hours every day, for 30 days", durationDays: 30, - }, { @@ -172,7 +156,6 @@ export const goals = [ category: "Finance", description: "Research and create a retirement plan within the next month", durationDays: 30, - }, { @@ -181,7 +164,6 @@ export const goals = [ category: "Finance", description: "Pay off all credit card debt within 3 months", durationDays: 90, - }, { name: "Save $1000", @@ -189,7 +171,6 @@ export const goals = [ category: "Finance", description: "Save $1000 in your savings account within 3 months", durationDays: 90, - }, ]; diff --git a/components/Coach/Goal/Share.tsx b/components/Coach/Goal/Share.tsx index 064986f64a..6a750c3d15 100644 --- a/components/Coach/Goal/Share.tsx +++ b/components/Coach/Goal/Share.tsx @@ -87,7 +87,7 @@ export function ShareGoal({ children, goal }) { containScroll: "trimSnaps", loop: false, }, - [WheelGesturesPlugin() as any] + [WheelGesturesPlugin() as any], ); const [emblaCardRef, emblaCardApi] = useEmblaCarousel({ loop: false }, [ diff --git a/components/Coach/Goal/ShareGoal.tsx b/components/Coach/Goal/ShareGoal.tsx index 0539061868..03003af80c 100644 --- a/components/Coach/Goal/ShareGoal.tsx +++ b/components/Coach/Goal/ShareGoal.tsx @@ -85,7 +85,7 @@ export function ShareGoal({ children, goal }) { containScroll: "trimSnaps", loop: false, }, - [WheelGesturesPlugin() as any] + [WheelGesturesPlugin() as any], ); const [emblaCardRef, emblaCardApi] = useEmblaCarousel({ loop: false }, [ diff --git a/components/Coach/Goal/Task.tsx b/components/Coach/Goal/Task.tsx index e3bfe4953a..aceeb846a2 100644 --- a/components/Coach/Goal/Task.tsx +++ b/components/Coach/Goal/Task.tsx @@ -36,7 +36,7 @@ export function GoalTask({ goal, setSlide, mutationUrl, open, setOpen }) { const [showProgress, setShowProgress] = useState( dayjs(goal.lastCompleted).format("YYYY-MM-DD") == - dayjs().format("YYYY-MM-DD") || false + dayjs().format("YYYY-MM-DD") || false, ); const [showProgressLoader, setShowProgressLoader] = useState(false); const [progressData, setProgressData] = useState(null); @@ -83,7 +83,7 @@ export function GoalTask({ goal, setSlide, mutationUrl, open, setOpen }) { .catch(() => { toast.error( "Yikes! Something went wrong while trying to mark your routine as done", - toastStyles + toastStyles, ); setDisabled(false); }); @@ -322,7 +322,7 @@ export function GoalTask({ goal, setSlide, mutationUrl, open, setOpen }) { const hasCompleted = progressData.find( - (day) => dayjs(day.date).format("YYYY-MM-DD") === curr + (day) => dayjs(day.date).format("YYYY-MM-DD") === curr, ) || curr == dayjs(goal.lastCompleted).format("YYYY-MM-DD"); diff --git a/components/Coach/MyGoals.tsx b/components/Coach/MyGoals.tsx index d90da9bcd9..c72dceff21 100644 --- a/components/Coach/MyGoals.tsx +++ b/components/Coach/MyGoals.tsx @@ -26,10 +26,10 @@ export function MyGoals(): JSX.Element { () => data ? data.filter( - (goal) => goal.progress >= goal.durationDays && !goal.completed + (goal) => goal.progress >= goal.durationDays && !goal.completed, ).length : 0, - [data] + [data], ); const deferredQuery = useDeferredValue(query); @@ -43,7 +43,7 @@ export function MyGoals(): JSX.Element { ? 1 : s.progress === s.durationDays ? -1 - : s.progress / s.durationDays - r.progress / r.durationDays + : s.progress / s.durationDays - r.progress / r.durationDays, ) : [] ).filter( @@ -52,9 +52,9 @@ export function MyGoals(): JSX.Element { `${e.timeOfDay}:00` .toLowerCase() .includes(deferredQuery.toLowerCase()) || - e.stepName.toLowerCase().includes(deferredQuery.toLowerCase()) + e.stepName.toLowerCase().includes(deferredQuery.toLowerCase()), ), - [data, deferredQuery] + [data, deferredQuery], ); const palette = useColor(session.themeColor, useDarkMode(session.darkMode)); @@ -107,7 +107,7 @@ export function MyGoals(): JSX.Element { { // if goals are completed data.filter( - (goal) => goal.progress >= goal.durationDays && !goal.completed + (goal) => goal.progress >= goal.durationDays && !goal.completed, ).length > 0 && ( debouncedHandleSearch(inputValue), - [inputValue, debouncedHandleSearch] + [inputValue, debouncedHandleSearch], ); async function handleSearch(value) { diff --git a/components/Group/Changelog.tsx b/components/Group/Changelog.tsx index a5c36a9802..a0fc7cd543 100644 --- a/components/Group/Changelog.tsx +++ b/components/Group/Changelog.tsx @@ -34,7 +34,7 @@ export function Changelog({ disabled }) { e.preventDefault(); setOpen(true); }, - [open] + [open], ); const palette = useColor(session.themeColor, useDarkMode(session.darkMode)); diff --git a/components/Group/Color.tsx b/components/Group/Color.tsx index b0142b4cb8..3b1a833d3d 100644 --- a/components/Group/Color.tsx +++ b/components/Group/Color.tsx @@ -21,12 +21,12 @@ export function Color({ }) { const session = useSession(); const invertColors = ["lime", "cyan", "green", "teal", "blue"].includes( - color + color, ); const handleClick = () => { updateSettings(session, "color", color, false, null, true).then(() => - setTimeout(mutatePropertyData, 1000) + setTimeout(mutatePropertyData, 1000), ); }; diff --git a/components/Group/Edit.tsx b/components/Group/Edit.tsx index db04038fae..3216dfd591 100644 --- a/components/Group/Edit.tsx +++ b/components/Group/Edit.tsx @@ -44,11 +44,11 @@ export function EditProperty({ const [open, setOpen] = useState(false); const [name, setName] = useState( - propertyData.profile.name || "Untitled property" + propertyData.profile.name || "Untitled property", ); const [vanishingTasks, setVanishingTasks] = useState( - propertyData.profile.vanishingTasks + propertyData.profile.vanishingTasks, ); useEffect(() => { @@ -67,7 +67,7 @@ export function EditProperty({ (event: React.MouseEvent) => { setAnchorEl(event.currentTarget); }, - [] + [], ); /** * Set property type @@ -75,11 +75,11 @@ export function EditProperty({ const handleCloseMenu = useCallback( (type) => { updateSettings(session, "type", type, false, null, true).then(() => - setTimeout(mutatePropertyData, 1000) + setTimeout(mutatePropertyData, 1000), ); setAnchorEl(null); }, - [session, mutatePropertyData] + [session, mutatePropertyData], ); const isDark = useDarkMode(session.darkMode); @@ -90,7 +90,7 @@ export function EditProperty({ const handleUpdateName = useCallback(() => { if (deferredName !== propertyData.profile.name) { updateSettings(session, "name", deferredName, false, null, true).then( - () => setTimeout(mutatePropertyData, 1000) + () => setTimeout(mutatePropertyData, 1000), ); } }, [session, propertyData.profile.name, mutatePropertyData, deferredName]); @@ -248,7 +248,7 @@ export function EditProperty({ newValue ? "true" : "false", false, null, - true + true, ).then(() => setTimeout(mutatePropertyData, 1000)); }} /> diff --git a/components/Group/GroupModal.tsx b/components/Group/GroupModal.tsx index eb576a6be1..550635f5ff 100644 --- a/components/Group/GroupModal.tsx +++ b/components/Group/GroupModal.tsx @@ -27,7 +27,7 @@ export function GroupModal({ const palette = useColor( session?.property?.profile?.color, - useDarkMode(session.darkMode) + useDarkMode(session.darkMode), ); const properties = [...session.properties, ...(data || [])] diff --git a/components/Group/Integrations/Integration.tsx b/components/Group/Integrations/Integration.tsx index dbd3ee6186..76709e367f 100644 --- a/components/Group/Integrations/Integration.tsx +++ b/components/Group/Integrations/Integration.tsx @@ -28,7 +28,7 @@ export function Integration({ closeParent, integration }) { const [open, setOpen] = useState(false); const [loading, setLoading] = useState(false); const [params, setParams] = useState( - integration.params.reduce((acc, curr) => ((acc[curr.name] = ""), acc), {}) + integration.params.reduce((acc, curr) => ((acc[curr.name] = ""), acc), {}), ); const handleParamUpdate = useCallback( @@ -38,7 +38,7 @@ export function Integration({ closeParent, integration }) { [key]: value, }); }, - [params] + [params], ); const handleSubmit = async (e) => { @@ -130,8 +130,8 @@ export function Integration({ closeParent, integration }) { key={board.id} disabled={Boolean( board.integrations.find( - (integration) => integration.name === "Canvas LMS" - ) + (integration) => integration.name === "Canvas LMS", + ), )} > {board.name} diff --git a/components/Group/Integrations/index.tsx b/components/Group/Integrations/index.tsx index 67b6ddb449..ed029a87e8 100644 --- a/components/Group/Integrations/index.tsx +++ b/components/Group/Integrations/index.tsx @@ -111,8 +111,8 @@ export default function Integrations({ handleClose }) { window.open( `https://www.google.com/calendar/render?cid=webcal://${icalUrl.replace( "https://", - "" - )}` + "", + )}`, ); }} > diff --git a/components/Group/Members/Add.tsx b/components/Group/Members/Add.tsx index e1dbf4d5e1..ef96ebf990 100644 --- a/components/Group/Members/Add.tsx +++ b/components/Group/Members/Add.tsx @@ -137,7 +137,7 @@ export function AddPersonModal({ const handleChange = useCallback( (event: SelectChangeEvent) => setPermission(event.target.value as string), - [] + [], ); useBackButton(() => setOpen(false)); diff --git a/components/Group/Members/index.tsx b/components/Group/Members/index.tsx index 6bd75064d0..b0f9001cad 100644 --- a/components/Group/Members/index.tsx +++ b/components/Group/Members/index.tsx @@ -325,7 +325,7 @@ export function MemberList({ setLeaveLoading(true); await fetchRawApi(session, "property/leave", { otherPropertyAccessToken: session.properties.find( - (m) => m.permission == "owner" + (m) => m.permission == "owner", )?.accessToken, currentAccessToken: accessToken, }); diff --git a/components/Group/Storage.tsx b/components/Group/Storage.tsx index 9e9b26e8e5..3a8f102096 100644 --- a/components/Group/Storage.tsx +++ b/components/Group/Storage.tsx @@ -11,7 +11,7 @@ export const multipliers = { items: 1.5, tasks: 0.5 }; export const getTotal = (data, tasks, items) => Math.round( ((data && tasks) || 0) * multipliers.tasks + - ((data && items) || { count: 0 }).count * multipliers.items + ((data && items) || { count: 0 }).count * multipliers.items, ); /** diff --git a/components/Group/index.tsx b/components/Group/index.tsx index 08d9096a2e..1dfe2778d2 100644 --- a/components/Group/index.tsx +++ b/components/Group/index.tsx @@ -66,13 +66,13 @@ export function PropertyInfo({ Switched to  {res.profile.name} , - toastStyles + toastStyles, ); setLoading(false); } catch (e) { toast.error( "An error occured while trying to switch groups", - toastStyles + toastStyles, ); } }} @@ -86,7 +86,7 @@ export function PropertyInfo({ )} {session.properties && !session.properties.find( - (property: any) => property.propertyId == propertyData.propertyId + (property: any) => property.propertyId == propertyData.propertyId, )?.accepted && ( Joined  {res.profile.name} , - toastStyles + toastStyles, ); setLoading(false); } catch (e) { toast.error( "An error occured while trying to switch groups", - toastStyles + toastStyles, ); } }} diff --git a/components/ItemPopup/AddToList.tsx b/components/ItemPopup/AddToList.tsx index 74b156293f..8257f3575a 100644 --- a/components/ItemPopup/AddToList.tsx +++ b/components/ItemPopup/AddToList.tsx @@ -35,7 +35,7 @@ function BoardModal({ itemId, title, list }) { } catch (e) { toast.error( "An error occured while trying to create a task", - toastStyles + toastStyles, ); } }; diff --git a/components/ItemPopup/CategoryModal.tsx b/components/ItemPopup/CategoryModal.tsx index 28136f7db5..7980568792 100644 --- a/components/ItemPopup/CategoryModal.tsx +++ b/components/ItemPopup/CategoryModal.tsx @@ -118,7 +118,7 @@ export default function CategoryModal({ if (JSON.parse(item.category).includes(category)) { setItemData(() => { const c = JSON.stringify( - JSON.parse(item.category).filter((c: string) => c !== category) + JSON.parse(item.category).filter((c: string) => c !== category), ); handleItemChange("category", c); return { diff --git a/components/ItemPopup/MoveToRoom.tsx b/components/ItemPopup/MoveToRoom.tsx index 397abf3226..91c21b8b10 100644 --- a/components/ItemPopup/MoveToRoom.tsx +++ b/components/ItemPopup/MoveToRoom.tsx @@ -137,7 +137,7 @@ export default function MoveToRoom({ item, styles }) { "Garden", ] .filter( - (index) => index.toLowerCase() !== item.room.toLowerCase() + (index) => index.toLowerCase() !== item.room.toLowerCase(), ) .map((index) => ( ), - toastStyles + toastStyles, ); }; @@ -189,7 +189,7 @@ function DrawerData({ handleOpen, mutationUrl, itemData, setItemData }) { {[capitalizeFirstLetter(itemData.room), ...categories].map( (category) => ( - ) + ), )} { diff --git a/components/Layout/Loading.tsx b/components/Layout/Loading.tsx index c0597f39ff..2621b2fc74 100644 --- a/components/Layout/Loading.tsx +++ b/components/Layout/Loading.tsx @@ -20,7 +20,7 @@ export function Loading(): JSX.Element { (!session && typeof window !== "undefined" && window.matchMedia("(prefers-color-scheme: dark)").matches) || - isDark + isDark, ); }, [isDark, session]); diff --git a/components/Layout/Navigation/BottomNavigation.tsx b/components/Layout/Navigation/BottomNavigation.tsx index d8aa85a17c..bd997706fc 100644 --- a/components/Layout/Navigation/BottomNavigation.tsx +++ b/components/Layout/Navigation/BottomNavigation.tsx @@ -128,7 +128,7 @@ export function BottomNav() { }, background: `linear-gradient(${addHslAlpha( palette[3], - 0.8 + 0.8, )}, ${addHslAlpha(palette[2], 0.8)})`, borderRadius: "20px 20px 0 0", backdropFilter: "blur(10px)", @@ -140,7 +140,7 @@ export function BottomNav() { sx={styles( router.asPath === "/" || router.asPath === "" || - router.asPath.includes("/mood-history") + router.asPath.includes("/mood-history"), )} > router.push("/items")} > diff --git a/components/Layout/Navigation/KeyboardShortcutsModal.tsx b/components/Layout/Navigation/KeyboardShortcutsModal.tsx index 761e863184..6f329bbaaf 100644 --- a/components/Layout/Navigation/KeyboardShortcutsModal.tsx +++ b/components/Layout/Navigation/KeyboardShortcutsModal.tsx @@ -8,7 +8,7 @@ export default function KeyboardShortcutsModal() { const session = useSession(); const palette = useColor( session.themeColor, - useDarkMode(session.user.darkMode) + useDarkMode(session.user.darkMode), ); const [open, setOpen] = React.useState(false); @@ -18,7 +18,7 @@ export default function KeyboardShortcutsModal() { e.preventDefault(); setOpen(!open); }, - [open] + [open], ); return ( diff --git a/components/Layout/Navigation/PropertyButton.tsx b/components/Layout/Navigation/PropertyButton.tsx index 6383b7efff..7f18c6e779 100644 --- a/components/Layout/Navigation/PropertyButton.tsx +++ b/components/Layout/Navigation/PropertyButton.tsx @@ -42,12 +42,12 @@ export function PropertyButton({ handleClose, group, list }: any) { Switched to  {res.profile.name} , - toastStyles + toastStyles, ); } catch { toast.error( "Yikes! Something went wrong when trying to switch groups", - toastStyles + toastStyles, ); } setLoading(false); diff --git a/components/Layout/Navigation/Search.tsx b/components/Layout/Navigation/Search.tsx index 1eccae5e02..7f507c67e1 100644 --- a/components/Layout/Navigation/Search.tsx +++ b/components/Layout/Navigation/Search.tsx @@ -177,7 +177,7 @@ export let getSpotlightActions = async (roomData, boardData, session) => { Switched to  {res.profile.name} , - toastStyles + toastStyles, ); mutate("/api/session"); }); @@ -222,14 +222,14 @@ export let getSpotlightActions = async (roomData, boardData, session) => { onTrigger: () => { toast.promise( fetchRawApi(session, "auth/logout").then(() => - mutate("/api/session") + mutate("/api/session"), ), { loading: "Signing you out", error: "Oh no! An error occured while trying to sign you out.", success: "Redirecting you...", }, - toastStyles + toastStyles, ); }, icon: "logout", @@ -285,12 +285,12 @@ export default function Spotlight() { let results = await getSpotlightActions(roomData, boardData, session); results = results.filter((result) => - result.title.toLowerCase().includes(value.toLowerCase()) + result.title.toLowerCase().includes(value.toLowerCase()), ); if (badge) { results = results.filter( - (result) => result?.badge?.toLowerCase() === badge + (result) => result?.badge?.toLowerCase() === badge, ); } @@ -301,7 +301,7 @@ export default function Spotlight() { useEffect( () => debouncedHandleSearch(inputValue), - [inputValue, debouncedHandleSearch] + [inputValue, debouncedHandleSearch], ); useHotkeys( @@ -318,22 +318,22 @@ export default function Spotlight() { }, { enableOnFormTags: true, - } + }, ); useHotkeys( "ArrowDown", (e) => setSelectedIndex((prev) => (prev + 1) % results.length), - { enableOnFormTags: true } + { enableOnFormTags: true }, ); useHotkeys( "ArrowUp", (e) => setSelectedIndex((prev) => - prev === 0 ? 0 : (prev - 1) % results.length + prev === 0 ? 0 : (prev - 1) % results.length, ), - { enableOnFormTags: true } + { enableOnFormTags: true }, ); useHotkeys( @@ -345,7 +345,7 @@ export default function Spotlight() { }, { enableOnFormTags: true, - } + }, ); return ( diff --git a/components/Layout/Navigation/Sidebar.tsx b/components/Layout/Navigation/Sidebar.tsx index 8ee442ae52..aeb1d00d28 100644 --- a/components/Layout/Navigation/Sidebar.tsx +++ b/components/Layout/Navigation/Sidebar.tsx @@ -20,7 +20,7 @@ export function Sidebar() { const palette = useColor(session.themeColor, useDarkMode(session.darkMode)); const groupPalette = useColor( session.property.profile.color, - useDarkMode(session.darkMode) + useDarkMode(session.darkMode), ); const [clickCount, setClickCount] = useState(0); const isMobile = useMediaQuery("(max-width: 600px)"); @@ -48,7 +48,7 @@ export function Sidebar() { { ...toastStyles, icon: "🥚", - } + }, ); updateSettings(session, "color", "blueGrey"); setClickCount(0); @@ -61,7 +61,7 @@ export function Sidebar() { e.preventDefault(); router.push(`/groups/${session.property.propertyId}`); }, - [open] + [open], ); useHotkeys( @@ -70,7 +70,7 @@ export function Sidebar() { e.preventDefault(); router.push(`/users`); }, - [open] + [open], ); useHotkeys( @@ -79,7 +79,7 @@ export function Sidebar() { e.preventDefault(); router.push(`/settings/account`); }, - [open] + [open], ); useHotkeys( @@ -88,7 +88,7 @@ export function Sidebar() { e.preventDefault(); router.push(`/users/${session.user.email}`); }, - [open] + [open], ); useHotkeys( @@ -97,7 +97,7 @@ export function Sidebar() { e.preventDefault(); router.push("/"); }, - [open] + [open], ); useHotkeys( @@ -106,7 +106,7 @@ export function Sidebar() { e.preventDefault(); router.push("/items"); }, - [open] + [open], ); useHotkeys( "ctrl+shift+3", @@ -114,7 +114,7 @@ export function Sidebar() { e.preventDefault(); router.push("/coach"); }, - [open] + [open], ); useHotkeys( "ctrl+shift+2", @@ -122,7 +122,7 @@ export function Sidebar() { e.preventDefault(); router.push("/tasks/agenda/week"); }, - [open] + [open], ); const isDark = useDarkMode(session.darkMode); @@ -253,7 +253,7 @@ export function Sidebar() { router.asPath === "/items" || router.asPath === "/trash" || router.asPath === "/starred" || - router.asPath.includes("rooms") + router.asPath.includes("rooms"), )} onClick={() => router.push("/items")} onMouseDown={() => router.push("/items")} diff --git a/components/Layout/index.tsx b/components/Layout/index.tsx index e7ee0aacdd..0636891db9 100644 --- a/components/Layout/index.tsx +++ b/components/Layout/index.tsx @@ -14,7 +14,7 @@ import { BottomNav } from "./Navigation/BottomNavigation"; import { Sidebar } from "./Navigation/Sidebar"; import { UpdateButton } from "./Navigation/UpdateButton"; const KeyboardShortcutsModal = dynamic( - () => import("./Navigation/KeyboardShortcutsModal") + () => import("./Navigation/KeyboardShortcutsModal"), ); const ReleaseModal = dynamic(() => import("./ReleaseModal")); @@ -67,7 +67,7 @@ export default function AppLayout({ const router = useRouter(); const shouldUseXAxis = ["/users", "/groups"].find((path) => - router.asPath.includes(path) + router.asPath.includes(path), ); if (session.properties.length === 0) { diff --git a/components/Onboarding/AppearanceStep.tsx b/components/Onboarding/AppearanceStep.tsx index 1ecad841ee..3e421f20ad 100644 --- a/components/Onboarding/AppearanceStep.tsx +++ b/components/Onboarding/AppearanceStep.tsx @@ -56,7 +56,7 @@ export function AppearanceStep({ styles, navigation }) { "slate", "mauve", "gray", - ].includes(color) + ].includes(color), ) .map((color) => ( @@ -228,7 +228,7 @@ export function GroupStep({ styles, navigation }) { updateSettings( session, "property.profile.name", - e.target.value + e.target.value, ) } InputProps={{ diff --git a/components/Onboarding/ProfileStep.tsx b/components/Onboarding/ProfileStep.tsx index e9560f5a63..199783136f 100644 --- a/components/Onboarding/ProfileStep.tsx +++ b/components/Onboarding/ProfileStep.tsx @@ -31,7 +31,7 @@ export function ProfileStep({ styles, navigation }) { if (birthdayRef?.current && data?.Profile?.birthday) setTimeout(() => { birthdayRef.current.value = dayjs(data.Profile.birthday).format( - "YYYY-MM-DD" + "YYYY-MM-DD", ); }, 100); }, [data]); @@ -87,7 +87,7 @@ export function ProfileStep({ styles, navigation }) { onBlur={(e) => handleChange( "birthday", - dayjs(e.target.value).set("hour", 1).toISOString() + dayjs(e.target.value).set("hour", 1).toISOString(), ) } /> diff --git a/components/Profile/UserProfile.tsx b/components/Profile/UserProfile.tsx index 93be87083c..f5926f5077 100644 --- a/components/Profile/UserProfile.tsx +++ b/components/Profile/UserProfile.tsx @@ -72,7 +72,7 @@ export function UserProfile({ if (birthdayRef?.current && editMode) setTimeout(() => { birthdayRef.current.value = dayjs(profile.birthday).format( - "YYYY-MM-DD" + "YYYY-MM-DD", ); }, 100); }, [profile.birthday, editMode]); @@ -187,7 +187,9 @@ export function UserProfile({ setHobbies( newValue .slice(0, 5) - .map((c) => capitalizeFirstLetter(c.substring(0, 20))) + .map((c) => + capitalizeFirstLetter(c.substring(0, 20)), + ), ); handleChange("hobbies", JSON.stringify(newValue)); }} @@ -228,7 +230,7 @@ export function UserProfile({ onBlur={(e) => handleChange( "birthday", - dayjs(e.target.value).set("hour", 1).toISOString() + dayjs(e.target.value).set("hour", 1).toISOString(), ) } /> diff --git a/components/Profile/WorkingHours.tsx b/components/Profile/WorkingHours.tsx index 004a93b8b8..79fbe16a58 100644 --- a/components/Profile/WorkingHours.tsx +++ b/components/Profile/WorkingHours.tsx @@ -24,7 +24,7 @@ export function WorkingHours({ }) { const session = useSession(); const [workingHours, setWorkingHours] = useState( - JSON.parse(profile.workingHours || "[]") + JSON.parse(profile.workingHours || "[]"), ); const handleChange = (index, field, value) => { diff --git a/components/Puller.tsx b/components/Puller.tsx index e973f4c405..5423571ac2 100644 --- a/components/Puller.tsx +++ b/components/Puller.tsx @@ -18,7 +18,7 @@ export function Puller({ const session = useSession(); const palette = useColor( session?.themeColor ?? "gray", - useDarkMode(session?.user?.darkMode ?? "light") + useDarkMode(session?.user?.darkMode ?? "light"), ); return ( diff --git a/components/Rooms/CreateItem/modal.tsx b/components/Rooms/CreateItem/modal.tsx index 6704dc6c7e..fa2bfb6c90 100644 --- a/components/Rooms/CreateItem/modal.tsx +++ b/components/Rooms/CreateItem/modal.tsx @@ -66,7 +66,7 @@ export function CreateItemModal({ containScroll: "trimSnaps", loop: false, }, - [WheelGesturesPlugin() as any] + [WheelGesturesPlugin() as any], ); const handleSubmit = useCallback(() => { diff --git a/components/Rooms/CreateItem/scan.tsx b/components/Rooms/CreateItem/scan.tsx index e7b6cc3e88..875aa653f3 100644 --- a/components/Rooms/CreateItem/scan.tsx +++ b/components/Rooms/CreateItem/scan.tsx @@ -74,7 +74,7 @@ const WebcamComponent = ({ {title} • {qty} , - toastStyles + toastStyles, ); } else { setTitle(title); diff --git a/components/Rooms/ItemCard.tsx b/components/Rooms/ItemCard.tsx index 1c9ac851f9..e7a7cf3480 100644 --- a/components/Rooms/ItemCard.tsx +++ b/components/Rooms/ItemCard.tsx @@ -112,7 +112,7 @@ export function ItemCard({ }} /> ); - } + }, )} diff --git a/components/Rooms/Toolbar.tsx b/components/Rooms/Toolbar.tsx index 7e5bf556c7..4dfe2ae3c0 100644 --- a/components/Rooms/Toolbar.tsx +++ b/components/Rooms/Toolbar.tsx @@ -59,8 +59,8 @@ function SearchBar({ JSON.parse(item.category) .join(",") .toLowerCase() - .includes(value.toLowerCase()) - ) + .includes(value.toLowerCase()), + ), ); }, 50); }} @@ -135,7 +135,7 @@ export function Toolbar({ e.preventDefault(); ref.current?.click(); }, - [ref] + [ref], ); const session = useSession(); @@ -191,7 +191,9 @@ export function Toolbar({ handleSort((items) => - items.sort((itemA, itemB) => itemA.name.localeCompare(itemB.name)) + items.sort((itemA, itemB) => + itemA.name.localeCompare(itemB.name), + ), ) } > @@ -202,7 +204,7 @@ export function Toolbar({ handleSort((items) => items .sort((itemA, itemB) => itemA.name.localeCompare(itemB.name)) - .reverse() + .reverse(), ) } > @@ -212,8 +214,8 @@ export function Toolbar({ onClick={() => handleSort((items) => items.sort((itemA, itemB) => - itemA.quantity.localeCompare(itemB.quantity) - ) + itemA.quantity.localeCompare(itemB.quantity), + ), ) } > @@ -223,8 +225,8 @@ export function Toolbar({ onClick={() => handleSort((items) => items.sort( - (itemA, itemB) => itemB.lastModified - itemA.lastModified - ) + (itemA, itemB) => itemB.lastModified - itemA.lastModified, + ), ) } > @@ -234,8 +236,8 @@ export function Toolbar({ onClick={() => handleSort((items) => items.sort( - (itemA, itemB) => itemA.lastModified - itemB.lastModified - ) + (itemA, itemB) => itemA.lastModified - itemB.lastModified, + ), ) } > diff --git a/components/Rooms/items/CategoryModal.tsx b/components/Rooms/items/CategoryModal.tsx index f1d17cc7d4..92a63cd304 100644 --- a/components/Rooms/items/CategoryModal.tsx +++ b/components/Rooms/items/CategoryModal.tsx @@ -50,7 +50,7 @@ const CategoryModal = memo(function CategoryModal({ }) .catch(() => { toast.error( - "An error occured while trying to get items with this category" + "An error occured while trying to get items with this category", ); setLoading(false); }); diff --git a/components/Rooms/items/CreateRoom.tsx b/components/Rooms/items/CreateRoom.tsx index f07920a637..db8f743f51 100644 --- a/components/Rooms/items/CreateRoom.tsx +++ b/components/Rooms/items/CreateRoom.tsx @@ -47,7 +47,7 @@ export function CreateRoom(): JSX.Element { .catch(() => { toast.error( "An error occurred while trying to create your room. Please try again later.", - toastStyles + toastStyles, ); setLoading(false); }); diff --git a/components/Tasks/Agenda/Column.tsx b/components/Tasks/Agenda/Column.tsx index 3c3b1d8494..2d59aed08d 100644 --- a/components/Tasks/Agenda/Column.tsx +++ b/components/Tasks/Agenda/Column.tsx @@ -170,7 +170,12 @@ const ColumnMenu = React.memo(function ColumnMenu({ > more_horiz - e.stopPropagation()}> + e.stopPropagation()} + > { e.stopPropagation(); @@ -231,7 +236,7 @@ export const Column: any = memo(function Column({ const dueDate = new Date(task.due); return dueDate >= startTime && dueDate <= endTime; }), - [data, startTime, endTime] + [data, startTime, endTime], ); const isPast = @@ -277,9 +282,9 @@ export const Column: any = memo(function Column({ ? -1 : !e.pinned && d.pinned ? 1 - : 0 + : 0, ), - [data] + [data], ); const ref: any = useRef(); @@ -312,7 +317,7 @@ export const Column: any = memo(function Column({ } catch (e) { toast.error( "Yikes! We couldn't get your tasks. Please try again later", - toastStyles + toastStyles, ); } setLoading(false); @@ -328,7 +333,7 @@ export const Column: any = memo(function Column({ ref={ref} {...(isToday && { id: "activeHighlight" })} onClick={() => { - if(window.innerWidth < 600) return; + if (window.innerWidth < 600) return; scrollIntoView(false); }} sx={{ diff --git a/components/Tasks/Agenda/index.tsx b/components/Tasks/Agenda/index.tsx index a11ac86755..1e13039f11 100644 --- a/components/Tasks/Agenda/index.tsx +++ b/components/Tasks/Agenda/index.tsx @@ -20,7 +20,7 @@ export function Agenda({ view: "day" | "week" | "month" | "year"; }) { const [navigation, setNavigation] = useState( - window.location.hash ? parseInt(window.location.hash.replace("#", "")) : 0 + window.location.hash ? parseInt(window.location.hash.replace("#", "")) : 0, ); useEffect(() => { diff --git a/components/Tasks/Board/Column/Create.tsx b/components/Tasks/Board/Column/Create.tsx index 3eaa250882..6bc3015387 100644 --- a/components/Tasks/Board/Column/Create.tsx +++ b/components/Tasks/Board/Column/Create.tsx @@ -65,7 +65,7 @@ export default function CreateColumn({ setLoading(false); toast.error( "An error occurred while creating the column. Try again later.", - toastStyles + toastStyles, ); }); }, [emoji, id, mutationUrls, setCurrentColumn, session, name]); diff --git a/components/Tasks/Board/Column/FilterMenu.tsx b/components/Tasks/Board/Column/FilterMenu.tsx index 1af7ad574d..5fb7d80b85 100644 --- a/components/Tasks/Board/Column/FilterMenu.tsx +++ b/components/Tasks/Board/Column/FilterMenu.tsx @@ -77,7 +77,7 @@ export function FilterMenu({ handleMenuClick( - (a, b) => (new Date(a.due) as any) - (new Date(b.due) as any) + (a, b) => (new Date(a.due) as any) - (new Date(b.due) as any), ) } > @@ -86,7 +86,7 @@ export function FilterMenu({ handleMenuClick( - (a, b) => (new Date(b.due) as any) - (new Date(a.due) as any) + (a, b) => (new Date(b.due) as any) - (new Date(a.due) as any), ) } > diff --git a/components/Tasks/Board/Column/Settings.tsx b/components/Tasks/Board/Column/Settings.tsx index 52adae20b0..458f97f99d 100644 --- a/components/Tasks/Board/Column/Settings.tsx +++ b/components/Tasks/Board/Column/Settings.tsx @@ -56,7 +56,7 @@ export function ColumnSettings({ children, setColumnTasks }: any) { vibrate(50); setAnchorEl(event.currentTarget); }, - [setAnchorEl] + [setAnchorEl], ); const handleClose = useCallback(() => { setAnchorEl(null); @@ -81,7 +81,7 @@ export function ColumnSettings({ children, setColumnTasks }: any) { task.parentTasks.length === 0 + (task) => task.parentTasks.length === 0, )} setColumnTasks={setColumnTasks} > @@ -143,7 +143,7 @@ export function ColumnSettings({ children, setColumnTasks }: any) { task.parentTasks.length === 0 + (task) => task.parentTasks.length === 0, )} setColumnTasks={setColumnTasks} > @@ -241,7 +241,7 @@ export function ColumnSettings({ children, setColumnTasks }: any) { success: "Edited column!", error: "Yikes! An error occured - Please try again later!", }, - toastStyles + toastStyles, ); setOpen(false); }} diff --git a/components/Tasks/Board/Column/index.tsx b/components/Tasks/Board/Column/index.tsx index b5766d982c..317cd43436 100644 --- a/components/Tasks/Board/Column/index.tsx +++ b/components/Tasks/Board/Column/index.tsx @@ -49,7 +49,7 @@ export function Column({ const toggleShowCompleted = useCallback( () => setShowCompleted((e) => !e), - [setShowCompleted] + [setShowCompleted], ); const [title, setTitle] = useState(column.name); @@ -63,7 +63,7 @@ export function Column({ const incompleteLength = useMemo( () => columnTasks.filter((t) => !t.completed).length, - [columnTasks] + [columnTasks], ); const scrollIntoView = async () => { @@ -88,7 +88,7 @@ export function Column({ } catch (e) { toast.error( "Yikes! We couldn't get your tasks. Please try again later", - toastStyles + toastStyles, ); } setLoading(false); @@ -204,7 +204,7 @@ export function Column({ success: "Edited column!", error: "Yikes! An error occured - Please try again later!", }, - toastStyles + toastStyles, ); setOpen(false); }} diff --git a/components/Tasks/Board/Info.tsx b/components/Tasks/Board/Info.tsx index efb94d2564..79a579a2cb 100644 --- a/components/Tasks/Board/Info.tsx +++ b/components/Tasks/Board/Info.tsx @@ -59,7 +59,7 @@ export function BoardInfo({ setMobileOpen, showInfo, setShowInfo }) { success: "Updated board!", error: "An error occurred while updating the board", }, - toastStyles + toastStyles, ); } }, [ @@ -80,7 +80,7 @@ export function BoardInfo({ setMobileOpen, showInfo, setShowInfo }) { ? [...board.property.members, ...board.shareTokens] : [ ...board.property.members.filter( - (m) => m.user.email == session.user.email + (m) => m.user.email == session.user.email, ), ...board.shareTokens, ] @@ -88,7 +88,7 @@ export function BoardInfo({ setMobileOpen, showInfo, setShowInfo }) { .filter((member) => member.user.email) .filter( (member, index, self) => - self.findIndex((m) => m.user.email === member.user.email) === index + self.findIndex((m) => m.user.email === member.user.email) === index, ); const isMobile = useMediaQuery("(max-width: 600px)"); @@ -105,7 +105,7 @@ export function BoardInfo({ setMobileOpen, showInfo, setShowInfo }) { background: { xs: `linear-gradient(${addHslAlpha(palette[4], 0.3)}, ${addHslAlpha( palette[6], - 0.3 + 0.3, )})`, md: addHslAlpha(palette[3], 0.3), }, diff --git a/components/Tasks/Board/IntegrationChip.tsx b/components/Tasks/Board/IntegrationChip.tsx index 88da6d6626..83e045cb31 100644 --- a/components/Tasks/Board/IntegrationChip.tsx +++ b/components/Tasks/Board/IntegrationChip.tsx @@ -31,7 +31,7 @@ const IntegrationChip = ({ vanishingTasks: session.property.profile.vanishingTasks ? "true" : "false", - } + }, ); await mutate(mutationUrls.tasks); resolve(response); @@ -46,7 +46,7 @@ const IntegrationChip = ({ success: "Synced!", error: "An error occurred while syncing", }, - toastStyles + toastStyles, ); setLoading(true); }; diff --git a/components/Tasks/Board/Settings.tsx b/components/Tasks/Board/Settings.tsx index cc333a6188..d655023128 100644 --- a/components/Tasks/Board/Settings.tsx +++ b/components/Tasks/Board/Settings.tsx @@ -36,7 +36,7 @@ export default function BoardSettings({ isShared, mutationUrls, board }) { }).then(() => { toast.success( !board.pinned ? "Pinned board!" : "Unpinned board!", - toastStyles + toastStyles, ); }); }, 100); diff --git a/components/Tasks/Board/Share.tsx b/components/Tasks/Board/Share.tsx index c41f216b3c..03bcaa16fe 100644 --- a/components/Tasks/Board/Share.tsx +++ b/components/Tasks/Board/Share.tsx @@ -65,12 +65,12 @@ export function ShareBoard({ isShared, board, children, mutationUrls }) { data?.find((share) => share.user.email === deferredEmail) || (board.public && board.property.members.find( - (member) => member.user.email === deferredEmail + (member) => member.user.email === deferredEmail, )) ) { toast.error( "This person already has access to this board", - toastStyles + toastStyles, ); setLoading(false); return; @@ -87,13 +87,13 @@ export function ShareBoard({ isShared, board, children, mutationUrls }) { } toast.success( "The share link has been generated successfully!", - toastStyles + toastStyles, ); await mutate(url); } catch (e) { toast.error( "Could not generate the share link! Is the email correct?", - toastStyles + toastStyles, ); setLoading(false); } @@ -102,7 +102,7 @@ export function ShareBoard({ isShared, board, children, mutationUrls }) { } catch (e) { toast.error( "Yikes! Something happened while trying to generate the share link! Please try again later.", - toastStyles + toastStyles, ); setLoading(false); } @@ -135,7 +135,7 @@ export function ShareBoard({ isShared, board, children, mutationUrls }) { } catch (e) { toast.error( "Yikes! Something happened while trying to change the group visibility! Please try again later.", - toastStyles + toastStyles, ); setLoadingGroupVisibility(false); } @@ -245,10 +245,10 @@ export function ShareBoard({ isShared, board, children, mutationUrls }) { .filter( (member, index, self) => self.findIndex((m) => m.user.email === member.user.email) === - index + index, ) .filter( - (m) => board.public || m.user.email === session.user.email + (m) => board.public || m.user.email === session.user.email, ) .map((member) => ( e !== "-1") + taskSelection.filter((e) => e !== "-1"), ), - } + }, ); if (res.errors !== 0) { toast.error( `Couldn't delete ${res.errors} item${ res.errors == 1 ? "" : "s" }`, - toastStyles + toastStyles, ); return; } @@ -726,7 +726,7 @@ export function TasksLayout({ open, setOpen, children }) { } catch { toast.error( "Couldn't delete tasks. Try again later.", - toastStyles + toastStyles, ); } }} diff --git a/components/Tasks/Task/Create/ImageModal.tsx b/components/Tasks/Task/Create/ImageModal.tsx index eabba1e052..d5a7e41fc0 100644 --- a/components/Tasks/Task/Create/ImageModal.tsx +++ b/components/Tasks/Task/Create/ImageModal.tsx @@ -37,7 +37,7 @@ export const ImageModal = React.memo(function ImageModal({ try { const res = await fetch( `https://api.imgbb.com/1/upload?name=image&key=${key}`, - { method: "POST", body: form } + { method: "POST", body: form }, ).then((res) => res.json()); setImage(JSON.stringify(res.data)); @@ -45,12 +45,12 @@ export const ImageModal = React.memo(function ImageModal({ setImageUploading(false); } catch (e) { toast.error( - "Yikes! An error occured while trying to upload your image. Please try again later" + "Yikes! An error occured while trying to upload your image. Please try again later", ); setImageUploading(false); } }, - [setImage] + [setImage], ); return ( @@ -79,7 +79,7 @@ export const ImageModal = React.memo(function ImageModal({ Drop to upload an image , - document.body + document.body, )} {color === colorChoice && check} @@ -159,7 +159,7 @@ export const CreateTask = React.memo(function CreateTask({ const [showLocation, setShowLocation] = useState(false); const [date, setDate] = useState( - new Date(defaultDate || new Date().toISOString()) || new Date() + new Date(defaultDate || new Date().toISOString()) || new Date(), ); const deferredDate = useDeferredValue(date); @@ -245,7 +245,7 @@ export const CreateTask = React.memo(function CreateTask({ deferredTitle, session, color, - ] + ], ); const toggleDescription = () => { @@ -301,7 +301,7 @@ export const CreateTask = React.memo(function CreateTask({ }), }; }, - [palette] + [palette], ); useEffect(() => { @@ -321,7 +321,7 @@ export const CreateTask = React.memo(function CreateTask({ containScroll: "trimSnaps", loop: false, }, - [WheelGesturesPlugin() as any] + [WheelGesturesPlugin() as any], ); const generateChipLabel = useCallback( @@ -347,13 +347,13 @@ export const CreateTask = React.memo(function CreateTask({ onClick={() => setDate( dayjs(deferredDate).hour( - Number(time) + (amPm === "pm" && time !== "12" ? 12 : 0) - ) + Number(time) + (amPm === "pm" && time !== "12" ? 12 : 0), + ), ) } sx={chipStyles( dayjs(deferredDate).hour() === - Number(time) + (amPm === "pm" && time !== "12" ? 12 : 0) + Number(time) + (amPm === "pm" && time !== "12" ? 12 : 0), )} /> @@ -362,7 +362,7 @@ export const CreateTask = React.memo(function CreateTask({ return null; }, - [chipStyles, deferredDate] + [chipStyles, deferredDate], ); const [chipComponent, setChipComponent] = useState(null); @@ -385,7 +385,7 @@ export const CreateTask = React.memo(function CreateTask({ } }, { enableOnFormTags: ["INPUT", "TEXTAREA"] }, - [open, pinned] + [open, pinned], ); useHotkeys( @@ -397,7 +397,7 @@ export const CreateTask = React.memo(function CreateTask({ } }, { enableOnFormTags: ["INPUT", "TEXTAREA"] }, - [open] + [open], ); useHotkeys( @@ -409,7 +409,7 @@ export const CreateTask = React.memo(function CreateTask({ } }, { enableOnFormTags: ["INPUT", "TEXTAREA"] }, - [open, emojiRef] + [open, emojiRef], ); useHotkeys( @@ -421,7 +421,7 @@ export const CreateTask = React.memo(function CreateTask({ } }, { enableOnFormTags: ["INPUT", "TEXTAREA"] }, - [open, toggleLocation] + [open, toggleLocation], ); useHotkeys( "alt+g", @@ -432,7 +432,7 @@ export const CreateTask = React.memo(function CreateTask({ } }, { enableOnFormTags: ["INPUT", "TEXTAREA"] }, - [open, toggleDescription] + [open, toggleDescription], ); useHotkeys( @@ -444,7 +444,7 @@ export const CreateTask = React.memo(function CreateTask({ } }, { enableOnFormTags: ["INPUT", "TEXTAREA"] }, - [open] + [open], ); return ( @@ -609,7 +609,7 @@ export const CreateTask = React.memo(function CreateTask({ onChange={(e) => { if (e.target.value.length === 1) { setTitle( - capitalizeFirstLetter(e.target.value.replace(/\n/g, "")) + capitalizeFirstLetter(e.target.value.replace(/\n/g, "")), ); } else { setTitle(e.target.value.replace(/\n/g, "")); @@ -795,7 +795,9 @@ export const CreateTask = React.memo(function CreateTask({ 200 || imageUploading + deferredTitle.trim() === "" || + deferredTitle.length > 200 || + imageUploading } type="submit" disableRipple diff --git a/components/Tasks/Task/DatePicker.tsx b/components/Tasks/Task/DatePicker.tsx index a9eb82a4a8..041d49b46b 100644 --- a/components/Tasks/Task/DatePicker.tsx +++ b/components/Tasks/Task/DatePicker.tsx @@ -136,7 +136,7 @@ export const SelectDateModal: any = React.memo(function SelectDateModal({ setDate( dayjs(date) .hour(i + (dayjs(date).hour() % 12)) - .toDate() + .toDate(), ); }} key={i} @@ -153,7 +153,7 @@ export const SelectDateModal: any = React.memo(function SelectDateModal({ setDate( dayjs(date) .minute(i * 5) - .toDate() + .toDate(), ); }} key={i} @@ -172,7 +172,7 @@ export const SelectDateModal: any = React.memo(function SelectDateModal({ setDate( dayjs(date) .hour(dayjs(date).hour() + (i === 0 ? -12 : 12)) - .toDate() + .toDate(), ); }} key={i} diff --git a/components/Tasks/Task/Drawer/ColorPopover.tsx b/components/Tasks/Task/Drawer/ColorPopover.tsx index 957ca025ed..00eaab197d 100644 --- a/components/Tasks/Task/Drawer/ColorPopover.tsx +++ b/components/Tasks/Task/Drawer/ColorPopover.tsx @@ -89,7 +89,7 @@ export function ColorPopover({ data, setTaskData, mutationUrl }) { color={color} mutationUrl={mutationUrl} setTaskData={setTaskData} - task={{color:data.color, id:data.id}} + task={{ color: data.color, id: data.id }} /> ))} diff --git a/components/Tasks/Task/Drawer/Content.tsx b/components/Tasks/Task/Drawer/Content.tsx index 3987685b71..0362a40822 100644 --- a/components/Tasks/Task/Drawer/Content.tsx +++ b/components/Tasks/Task/Drawer/Content.tsx @@ -79,7 +79,7 @@ const DrawerContent = React.memo(function DrawerContent({ success: data.pinned ? "Task unpinned!" : "Task pinned!", error: "Failed to change priority", }, - toastStyles + toastStyles, ); }, [data.pinned, data.id, mutationUrl, setTaskData, session]); @@ -94,7 +94,7 @@ const DrawerContent = React.memo(function DrawerContent({ mutate(mutationUrl); }); }, - [mutationUrl, setTaskData, session] + [mutationUrl, setTaskData, session], ); const handleComplete = useCallback(async () => { @@ -128,7 +128,7 @@ const DrawerContent = React.memo(function DrawerContent({ handleEdit( data.id, "due", - dayjs(data.due).add(count, type).toISOString() + dayjs(data.due).add(count, type).toISOString(), ); }, [ @@ -138,7 +138,7 @@ const DrawerContent = React.memo(function DrawerContent({ handleEdit, isDateDependent, handleParentClose, - ] + ], ); const styles = { @@ -182,7 +182,14 @@ const DrawerContent = React.memo(function DrawerContent({ return ( <> - + - + {videoChatPlatforms.find((platform) => - data.where.includes(platform) + data.where.includes(platform), ) ? "call" : isAddress(data.where) @@ -79,7 +79,7 @@ export const TaskDetailsSection = React.memo(function TaskDetailsSection({ : "link"} {videoChatPlatforms.find((platform) => - data.where.includes(platform) + data.where.includes(platform), ) ? "Call" : isAddress(data.where) diff --git a/components/Tasks/Task/Drawer/index.tsx b/components/Tasks/Task/Drawer/index.tsx index c1a9a82527..7c3e27d786 100644 --- a/components/Tasks/Task/Drawer/index.tsx +++ b/components/Tasks/Task/Drawer/index.tsx @@ -90,7 +90,7 @@ export const TaskDrawer = React.memo(function TaskDrawer({ handleMutate(); mutate(mutationUrl); }, - [mutationUrl, setData, handleMutate, session] + [mutationUrl, setData, handleMutate, session], ); useHotkeys( @@ -99,7 +99,7 @@ export const TaskDrawer = React.memo(function TaskDrawer({ handleDelete(id); setOpen(false); }, - [id] + [id], ); // Callback function when drawer is closed diff --git a/components/Tasks/Task/Drawer/locationHelpers.ts b/components/Tasks/Task/Drawer/locationHelpers.ts index d21c74bee6..732370f9b6 100644 --- a/components/Tasks/Task/Drawer/locationHelpers.ts +++ b/components/Tasks/Task/Drawer/locationHelpers.ts @@ -1,63 +1,60 @@ +export function isValidHttpUrl(string) { + let url; + try { + url = new URL(string); + } catch (_) { + return false; + } -export function isValidHttpUrl(string) { - let url; - - try { - url = new URL(string); - } catch (_) { - return false; - } - - return url.protocol === "http:" || url.protocol === "https:"; - } - - export const videoChatPlatforms = [ - "zoom.us", - "meet.google.com", - "teams.microsoft.com", - "skype.com", - "appear.in", - "gotomeeting.com", - "webex.com", - "hangouts.google.com", - "jitsi.org", - "whereby.com", - "discord.com", - "vsee.com", - "bluejeans.com", - "join.me", - "appear.in", - "tokbox.com", - "wire.com", - "talky.io", - "ooVoo.com", - "fuze.com", - "amazonchime.com", - "viber.com", - "slack.com", - ]; - - export function isAddress(str) { - if (!str) return false; - - const mapUrls = ["maps.google.com"]; - if (mapUrls.find((url) => str.includes(url))) return true; - - if ( - /^[\w\s.,#-]+$/.test(str) || - str.includes(" - ") || - str.includes(" high school") || - str.includes(" elementary school") || - str.includes(" middle school") || - str.includes(" university") || - str.includes(", ") || - /\d+\s+[^,]+,\s+[^,]+,\s+\w{2}\s+\d{5}/.test(str) || - /^(\d+\s[A-Za-z]+\s[A-Za-z]+(?:,\s[A-Za-z]+)?)$/.test(str) - ) { - return true; - } - - return false; - } - \ No newline at end of file + return url.protocol === "http:" || url.protocol === "https:"; +} + +export const videoChatPlatforms = [ + "zoom.us", + "meet.google.com", + "teams.microsoft.com", + "skype.com", + "appear.in", + "gotomeeting.com", + "webex.com", + "hangouts.google.com", + "jitsi.org", + "whereby.com", + "discord.com", + "vsee.com", + "bluejeans.com", + "join.me", + "appear.in", + "tokbox.com", + "wire.com", + "talky.io", + "ooVoo.com", + "fuze.com", + "amazonchime.com", + "viber.com", + "slack.com", +]; + +export function isAddress(str) { + if (!str) return false; + + const mapUrls = ["maps.google.com"]; + if (mapUrls.find((url) => str.includes(url))) return true; + + if ( + /^[\w\s.,#-]+$/.test(str) || + str.includes(" - ") || + str.includes(" high school") || + str.includes(" elementary school") || + str.includes(" middle school") || + str.includes(" university") || + str.includes(", ") || + /\d+\s+[^,]+,\s+[^,]+,\s+\w{2}\s+\d{5}/.test(str) || + /^(\d+\s[A-Za-z]+\s[A-Za-z]+(?:,\s[A-Za-z]+)?)$/.test(str) + ) { + return true; + } + + return false; +} diff --git a/components/Tasks/Task/index.tsx b/components/Tasks/Task/index.tsx index 005da77932..517ac2afc4 100644 --- a/components/Tasks/Task/index.tsx +++ b/components/Tasks/Task/index.tsx @@ -39,7 +39,7 @@ import { } from "./Drawer/locationHelpers"; const ImageViewer = dynamic(() => - import("./ImageViewer").then((mod) => mod.ImageViewer) + import("./ImageViewer").then((mod) => mod.ImageViewer), ); export const Task: any = React.memo(function Task({ @@ -80,7 +80,7 @@ export const Task: any = React.memo(function Task({ opacity: 0.5, }, })), - [taskData.color, isDark] + [taskData.color, isDark], ); const BpCheckedIcon: any = useMemo( @@ -106,7 +106,7 @@ export const Task: any = React.memo(function Task({ content: '""', }, }), - [taskData.color, isDark, BpIcon] + [taskData.color, isDark, BpIcon], ); const handleCompletion = useCallback( @@ -122,7 +122,7 @@ export const Task: any = React.memo(function Task({ toast.error("An error occured while updating the task", toastStyles); } }, - [taskData.id, session] + [taskData.id, session], ); const handlePriorityChange = useCallback(async () => { @@ -150,7 +150,7 @@ export const Task: any = React.memo(function Task({ success: taskData.pinned ? "Task unpinned!" : "Task pinned!", error: "Failed to change priority", }, - toastStyles + toastStyles, ); }, [ taskData.pinned, @@ -166,7 +166,7 @@ export const Task: any = React.memo(function Task({ (board && board.archived) || session?.permission === "read-only" || storage?.isReached === true, - [board, session, storage] + [board, session, storage], ); const selection = useContext(SelectionContext); @@ -401,7 +401,7 @@ export const Task: any = React.memo(function Task({ - taskData.where.includes(platform) + taskData.where.includes(platform), ) ? "Call" : isAddress(taskData.where) @@ -415,8 +415,8 @@ export const Task: any = React.memo(function Task({ if (isAddress(taskData.where)) { window.open( `https://maps.google.com/?q=${encodeURIComponent( - taskData.where - )}` + taskData.where, + )}`, ); return; } @@ -425,7 +425,7 @@ export const Task: any = React.memo(function Task({ icon={ {videoChatPlatforms.find((platform) => - taskData.where.includes(platform) + taskData.where.includes(platform), ) ? "call" : isAddress(taskData.where) diff --git a/components/TwoFactorModal.tsx b/components/TwoFactorModal.tsx index a4a5c9491d..3147d4643e 100644 --- a/components/TwoFactorModal.tsx +++ b/components/TwoFactorModal.tsx @@ -45,7 +45,7 @@ export function Prompt({ `/api/user/settings/2fa/verify?${new URLSearchParams({ code: code, token: session.current.token, - }).toString()}` + }).toString()}`, ); const data = await res.json(); if (data.success) { @@ -59,7 +59,7 @@ export function Prompt({ } catch (error) { toast.error( "An error occured while verifying your code. Please try again later.", - toastStyles + toastStyles, ); setButtonLoading(false); } diff --git a/lib/client/installer.tsx b/lib/client/installer.tsx index 11c8fc201f..b64876f2de 100644 --- a/lib/client/installer.tsx +++ b/lib/client/installer.tsx @@ -6,13 +6,13 @@ const PWAInstallerPrompt = ({ render: InstallButton, callback }): any => { return { isInstallAllowed: Object.prototype.hasOwnProperty.call( object, - "isInstallAllowed" + "isInstallAllowed", ) ? object.isInstallAllowed : false, isInstallWatingConfirm: Object.prototype.hasOwnProperty.call( object, - "isInstallWatingConfirm" + "isInstallWatingConfirm", ) ? object.isInstallWatingConfirm : false, @@ -21,19 +21,19 @@ const PWAInstallerPrompt = ({ render: InstallButton, callback }): any => { : false, isInstallCancelled: Object.prototype.hasOwnProperty.call( object, - "isInstallCancelled" + "isInstallCancelled", ) ? object.isInstallCancelled : false, isInstallSuccess: Object.prototype.hasOwnProperty.call( object, - "isInstallSuccess" + "isInstallSuccess", ) ? object.isInstallSuccess : false, isInstallFailed: Object.prototype.hasOwnProperty.call( object, - "isInstallFailed" + "isInstallFailed", ) ? object.isInstallFailed : false, @@ -60,13 +60,13 @@ const PWAInstallerPrompt = ({ render: InstallButton, callback }): any => { createStatus({ isInstallAllowed: true, isInstallCancelled: installStatus.isInstallCancelled, - }) + }), ); } } } }, - [installStatus] + [installStatus], ); const appInstalledHandler = useCallback( @@ -74,25 +74,25 @@ const PWAInstallerPrompt = ({ render: InstallButton, callback }): any => { if (!installStatus.isInstallSuccess) { window.removeEventListener( "beforeinstallprompt", - beforeAppInstallpromptHandler + beforeAppInstallpromptHandler, ); e.preventDefault(); setInstallStatus(createStatus({ isInstallSuccess: true })); } }, - [installStatus.isInstallSuccess, beforeAppInstallpromptHandler] + [installStatus.isInstallSuccess, beforeAppInstallpromptHandler], ); useEffect(() => { window.addEventListener( "beforeinstallprompt", - beforeAppInstallpromptHandler + beforeAppInstallpromptHandler, ); window.addEventListener("appinstalled", appInstalledHandler); return () => { window.removeEventListener( "beforeinstallprompt", - beforeAppInstallpromptHandler + beforeAppInstallpromptHandler, ); window.removeEventListener("appinstalled", appInstalledHandler); }; @@ -105,17 +105,17 @@ const PWAInstallerPrompt = ({ render: InstallButton, callback }): any => { .then((choiceResult) => { if (choiceResult.outcome === "accepted") { setInstallStatus( - createStatus({ isInstalling: true, isInstallAllowed: false }) + createStatus({ isInstalling: true, isInstallAllowed: false }), ); } else { setInstallStatus( - createStatus({ isInstallCancelled: true, isInstallAllowed: true }) + createStatus({ isInstallCancelled: true, isInstallAllowed: true }), ); } }) .catch(() => { setInstallStatus( - createStatus({ isInstallFailed: true, isInstallAllowed: true }) + createStatus({ isInstallFailed: true, isInstallAllowed: true }), ); }); setInstallEvent(null); diff --git a/lib/client/session.tsx b/lib/client/session.tsx index b455d69ae7..8eba37bf73 100644 --- a/lib/client/session.tsx +++ b/lib/client/session.tsx @@ -23,7 +23,7 @@ export function useUser(): { } { const url = "/api/session"; const { data, error } = useSWR(url, () => - fetch(url).then((res) => res.json()) + fetch(url).then((res) => res.json()), ); return { diff --git a/lib/client/updateSettings.ts b/lib/client/updateSettings.ts index cf48614ae6..dfdef5a6d6 100644 --- a/lib/client/updateSettings.ts +++ b/lib/client/updateSettings.ts @@ -19,7 +19,7 @@ export async function updateSettings( debug = false, callback: null | (() => void) = null, property = false, - hideToast = false + hideToast = false, ) { const promise = new Promise(async (resolve, reject) => { try { @@ -64,6 +64,6 @@ export async function updateSettings( success: (message: any) => message, error: (err: any) => err, }, - toastStyles + toastStyles, ); } diff --git a/lib/client/useApi.ts b/lib/client/useApi.ts index 7d8ae3a444..e3f08ef1e6 100644 --- a/lib/client/useApi.ts +++ b/lib/client/useApi.ts @@ -9,7 +9,7 @@ const getInfo = ( property: any, user: any, removeDefaultParams: boolean = false, - current: any + current: any, ) => { const params = removeDefaultParams ? { @@ -64,7 +64,7 @@ export interface ApiResponse { export function useApi( path: string, initialParams = {}, - removeDefaultParams = false + removeDefaultParams = false, ): ApiResponse { let session = useSession() || { property: "", user: "" }; const { property, current, user } = session; @@ -77,9 +77,9 @@ export function useApi( property, user, removeDefaultParams, - current + current, ), - [path, initialParams, property, user, removeDefaultParams, current] + [path, initialParams, property, user, removeDefaultParams, current], ); const fetcher = (url: string) => fetch(url).then((res) => res.json()); @@ -117,7 +117,7 @@ export async function fetchRawApi( session, path, initialParams = {}, - removeDefaultParams = false + removeDefaultParams = false, ) { const { url } = getInfo( path, @@ -125,7 +125,7 @@ export async function fetchRawApi( session.property, session?.user, removeDefaultParams, - session?.current + session?.current, ); const res = await fetch(url); return await res.json(); diff --git a/lib/client/useDelayedMount.ts b/lib/client/useDelayedMount.ts index ea980d0d0f..c4265cb929 100644 --- a/lib/client/useDelayedMount.ts +++ b/lib/client/useDelayedMount.ts @@ -16,7 +16,7 @@ export const useDelayedMount = (condition: boolean, timeout: number) => { () => { setMounted(condition); }, - condition ? 0 : timeout + condition ? 0 : timeout, ); return () => clearTimeout(timeoutId); diff --git a/lib/client/useTheme.tsx b/lib/client/useTheme.tsx index 01c62bf56d..e347f8e307 100644 --- a/lib/client/useTheme.tsx +++ b/lib/client/useTheme.tsx @@ -6,14 +6,14 @@ import { useColor } from "./useColor"; const Transition = React.forwardRef(function Transition( props: any, - ref: React.Ref + ref: React.Ref, ) { return ; }); const DrawerTransition = React.forwardRef(function Transition( props: any, - ref: React.Ref + ref: React.Ref, ) { return ( { diff --git a/lib/server/captcha.ts b/lib/server/captcha.ts index eaa54942fd..581af2ecd2 100644 --- a/lib/server/captcha.ts +++ b/lib/server/captcha.ts @@ -3,7 +3,7 @@ export async function validateCaptcha(token: string) { const secret: any = process.env.CAPTCHA_KEY; const body = `secret=${encodeURIComponent( - secret + secret, )}&response=${encodeURIComponent(token)}`; const captchaRequest = await fetch(endpoint, { diff --git a/lib/server/notification.ts b/lib/server/notification.ts index 8daec1fd40..aa698784c9 100644 --- a/lib/server/notification.ts +++ b/lib/server/notification.ts @@ -18,7 +18,7 @@ export const DispatchNotification = async ({ webPush.setVapidDetails( `mailto:${process.env.WEB_PUSH_EMAIL}`, process.env.NEXT_PUBLIC_WEB_PUSH_PUBLIC_KEY, - process.env.WEB_PUSH_PRIVATE_KEY + process.env.WEB_PUSH_PRIVATE_KEY, ); await webPush.sendNotification( @@ -28,7 +28,7 @@ export const DispatchNotification = async ({ body, actions: actions ?? [{ title: "âš¡ View", action: "view" }], icon, - }) + }), ); return { success: true }; } catch (error: any) { @@ -39,7 +39,7 @@ export const DispatchNotification = async ({ export const DispatchGroupNotification = async ( propertyId, accessToken, - options + options, ) => { try { const members = await prisma.notificationSettings.findMany({ diff --git a/lib/server/validateParams.ts b/lib/server/validateParams.ts index a7b554c3d4..bb5f83ef2e 100644 --- a/lib/server/validateParams.ts +++ b/lib/server/validateParams.ts @@ -6,11 +6,11 @@ */ export const validateParams = (provided: any, required: string[]) => { const missingParams = required.filter( - (key) => !provided.hasOwnProperty(key) || !provided[key] + (key) => !provided.hasOwnProperty(key) || !provided[key], ); if (missingParams.length > 0) { throw new Error( - `Couldn't validate parameters: Missing ${missingParams.join(", ")}` + `Couldn't validate parameters: Missing ${missingParams.join(", ")}`, ); } return true; diff --git a/lib/server/validatePermissions.ts b/lib/server/validatePermissions.ts index 317e3effe4..1a2bdd6994 100644 --- a/lib/server/validatePermissions.ts +++ b/lib/server/validatePermissions.ts @@ -29,7 +29,7 @@ export const validatePermissions = async (config: { if (foundPermissionsInteger < minimumPermissionsInteger) throw new Error( - "Couldn't validate permissions: Insufficient permissions" + "Couldn't validate permissions: Insufficient permissions", ); console.timeEnd("🔑 User permission validation took"); @@ -52,7 +52,7 @@ export const validatePermissions = async (config: { if (foundPermissionsInteger < minimumPermissionsInteger) throw new Error( - "Couldn't validate permissions: Insufficient permissions" + "Couldn't validate permissions: Insufficient permissions", ); cacheData.put( @@ -61,7 +61,7 @@ export const validatePermissions = async (config: { // Value (if there's no permission defined, make the minimum permission "owner" for maximum security) permissions ? permissions.permission : "owner", // Hours to store it - hours * 1000 * 60 * 60 + hours * 1000 * 60 * 60, ); // 🎉 User meets the minimum required permissions! return { authorized: true }; diff --git a/pages/_app.tsx b/pages/_app.tsx index 7b6b8d9675..df6151dfdb 100644 --- a/pages/_app.tsx +++ b/pages/_app.tsx @@ -92,7 +92,7 @@ export default function App({ useCustomTheme({ darkMode: isDark, themeColor: themeColor, - }) + }), ); if ( diff --git a/pages/_error.js b/pages/_error.js index 49f0ea6e15..55c34869e2 100644 --- a/pages/_error.js +++ b/pages/_error.js @@ -16,10 +16,10 @@ * - https://reactjs.org/docs/error-boundaries.html */ -import * as Sentry from '@sentry/nextjs'; -import NextErrorComponent from 'next/error'; +import * as Sentry from "@sentry/nextjs"; +import NextErrorComponent from "next/error"; -const CustomErrorComponent = props => { +const CustomErrorComponent = (props) => { // If you're using a Nextjs version prior to 12.2.1, uncomment this to // compensate for https://github.com/vercel/next.js/issues/8592 // Sentry.captureUnderscoreErrorException(props); @@ -27,7 +27,7 @@ const CustomErrorComponent = props => { return ; }; -CustomErrorComponent.getInitialProps = async contextData => { +CustomErrorComponent.getInitialProps = async (contextData) => { // In case this is running in a serverless function, await this in order to give Sentry // time to send the error before the lambda exits await Sentry.captureUnderscoreErrorException(contextData); diff --git a/pages/api/auth/login.ts b/pages/api/auth/login.ts index 726302fb61..439030b2b7 100644 --- a/pages/api/auth/login.ts +++ b/pages/api/auth/login.ts @@ -31,7 +31,7 @@ export async function createSession(id: any, res, ip: any) { exp: Math.floor(Date.now() / 1000) + 60 * 60 * 24 * 7 * 4 * 12, // 1 year accessToken: token, }, - process.env.SECRET_COOKIE_PASSWORD + process.env.SECRET_COOKIE_PASSWORD, ); const now = new Date(); now.setDate(now.getDate() * 7 * 4); @@ -41,7 +41,7 @@ export async function createSession(id: any, res, ip: any) { path: "/", maxAge: 60 * 60 * 24 * 7 * 4, // 1 month expires: now, - }) + }), ); return encoded; } @@ -58,7 +58,7 @@ export default async function handler(req, res) { const endpoint = "https://challenges.cloudflare.com/turnstile/v0/siteverify"; const secret: any = process.env.CAPTCHA_KEY; const body = `secret=${encodeURIComponent( - secret + secret, )}&response=${encodeURIComponent(req.body.token)}`; const captchaRequest = await fetch(endpoint, { @@ -127,7 +127,7 @@ export default async function handler(req, res) { if (req.body.twoFactorCode) { const login = twofactor.verifyToken( user.twoFactorSecret, - req.body.twoFactorCode + req.body.twoFactorCode, ); if (!login || login.delta !== 0) { diff --git a/pages/api/auth/logout.ts b/pages/api/auth/logout.ts index e82c044d16..87d673cf19 100644 --- a/pages/api/auth/logout.ts +++ b/pages/api/auth/logout.ts @@ -16,7 +16,7 @@ export default function handler(req, res) { path: "/", maxAge: 0, expires: new Date(0), - }) + }), ); cacheData.clear(); diff --git a/pages/api/auth/reset-id.ts b/pages/api/auth/reset-id.ts index 23cf119594..de0532bcfe 100644 --- a/pages/api/auth/reset-id.ts +++ b/pages/api/auth/reset-id.ts @@ -63,7 +63,7 @@ export default async function handler(req, res) { const emailRes = await fetch( "https://api.emailjs.com/api/v1.0/email/send", - requestOptions + requestOptions, ).then((res) => res.text()); console.log(emailRes); res.json({ success: true }); diff --git a/pages/api/auth/signup.ts b/pages/api/auth/signup.ts index 27348093cb..eb2dfef523 100644 --- a/pages/api/auth/signup.ts +++ b/pages/api/auth/signup.ts @@ -29,7 +29,7 @@ const validateEmail = (email) => { return String(email) .toLowerCase() .match( - /^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/ + /^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/, ); }; diff --git a/pages/api/cron/dailyCheckInNudge.ts b/pages/api/cron/dailyCheckInNudge.ts index 3bdcefbfc3..d025f9ed7c 100644 --- a/pages/api/cron/dailyCheckInNudge.ts +++ b/pages/api/cron/dailyCheckInNudge.ts @@ -39,7 +39,7 @@ const Notification = async (req, res) => { webPush.setVapidDetails( `mailto:${process.env.WEB_PUSH_EMAIL}`, process.env.NEXT_PUBLIC_WEB_PUSH_PUBLIC_KEY, - process.env.WEB_PUSH_PRIVATE_KEY + process.env.WEB_PUSH_PRIVATE_KEY, ); // For each user diff --git a/pages/api/cron/dailyNudge.ts b/pages/api/cron/dailyNudge.ts index 172aeb3eb3..989159fa00 100644 --- a/pages/api/cron/dailyNudge.ts +++ b/pages/api/cron/dailyNudge.ts @@ -45,13 +45,13 @@ const Notification = async (req, res) => { // Make sure that user actually has routines subscriptions = subscriptions.filter( - (subscription) => subscription.user.RoutineItem.length > 0 + (subscription) => subscription.user.RoutineItem.length > 0, ); webPush.setVapidDetails( `mailto:${process.env.WEB_PUSH_EMAIL}`, process.env.NEXT_PUBLIC_WEB_PUSH_PUBLIC_KEY, - process.env.WEB_PUSH_PRIVATE_KEY + process.env.WEB_PUSH_PRIVATE_KEY, ); // For each user @@ -65,7 +65,7 @@ const Notification = async (req, res) => { const currentRoutine = RoutineItem.find( (routine: RoutineItem) => - routine.timeOfDay + 1 === currentTimeInUserTimeZone + routine.timeOfDay + 1 === currentTimeInUserTimeZone, ); if (currentRoutine) { diff --git a/pages/api/property/boards/column/task/index.ts b/pages/api/property/boards/column/task/index.ts index 3b082ac1a1..90184c01e0 100644 --- a/pages/api/property/boards/column/task/index.ts +++ b/pages/api/property/boards/column/task/index.ts @@ -15,7 +15,9 @@ const handler = async (req, res) => { subTasks: true, property: { select: { name: true, id: true } }, column: { - include: { board: { select: { id: true, name: true, public: true } } }, + include: { + board: { select: { id: true, name: true, public: true } }, + }, }, }, }); diff --git a/pages/api/property/edit.ts b/pages/api/property/edit.ts index 44528a17fd..dd0292f06b 100644 --- a/pages/api/property/edit.ts +++ b/pages/api/property/edit.ts @@ -16,7 +16,7 @@ const handler = async (req, res) => { req.query.property, req.query.accessToken, req, - res + res, ); // Update name, type, and bannerColor diff --git a/pages/api/property/inbox/create.ts b/pages/api/property/inbox/create.ts index ecdc45fc3c..f162998cb4 100644 --- a/pages/api/property/inbox/create.ts +++ b/pages/api/property/inbox/create.ts @@ -9,7 +9,7 @@ export const createInboxNotification = async ( propertyId: string, accessToken: string, req, - res + res, ) => { try { await validatePermissions({ @@ -41,7 +41,7 @@ export const createInboxNotification = async ( members.reduce((acc, item) => { acc[item.user.identifier] = item; return acc; - }, {}) + }, {}), ); // Send a notification to each member @@ -51,7 +51,7 @@ export const createInboxNotification = async ( webPush.setVapidDetails( `mailto:${process.env.WEB_PUSH_EMAIL}`, process.env.NEXT_PUBLIC_WEB_PUSH_PUBLIC_KEY, - process.env.WEB_PUSH_PRIVATE_KEY + process.env.WEB_PUSH_PRIVATE_KEY, ); webPush.sendNotification( @@ -60,7 +60,7 @@ export const createInboxNotification = async ( title: `${who} has edited your group`, body: `${who} ${what}`, actions: [{ title: "âš¡ View", action: "viewGroupModification" }], - }) + }), ); } } diff --git a/pages/api/property/integrations/run/canvas-lms.ts b/pages/api/property/integrations/run/canvas-lms.ts index 8337c109f4..32c4ddac9d 100644 --- a/pages/api/property/integrations/run/canvas-lms.ts +++ b/pages/api/property/integrations/run/canvas-lms.ts @@ -33,7 +33,7 @@ const handler = async (req, res) => { const inputParams = JSON.parse(data1.inputParams); const calendar = await fetch(inputParams["Canvas feed URL"]).then((res) => - res.text() + res.text(), ); const parsed = ical.parseICS(calendar); @@ -58,7 +58,7 @@ const handler = async (req, res) => { const taskId = `${data1.boardId}-${item.uid}`; const columnId = `${data1.boardId}-${extractTextInBrackets( - item.summary + item.summary, )}`; let due = new Date(); diff --git a/pages/api/property/integrations/run/google-calendar.ts b/pages/api/property/integrations/run/google-calendar.ts index 19443fbed6..a1466e07c7 100644 --- a/pages/api/property/integrations/run/google-calendar.ts +++ b/pages/api/property/integrations/run/google-calendar.ts @@ -29,7 +29,7 @@ const handler = async (req, res) => { const inputParams = JSON.parse(data1.inputParams); console.log(inputParams); const calendar = await fetch( - decodeURIComponent(inputParams["Secret address in iCal format"]) + decodeURIComponent(inputParams["Secret address in iCal format"]), ).then((res) => res.text()); const parsed = ical.parseICS(calendar); diff --git a/pages/api/property/inventory/categories/index.ts b/pages/api/property/inventory/categories/index.ts index 272a4fe0ee..7d80db64ab 100644 --- a/pages/api/property/inventory/categories/index.ts +++ b/pages/api/property/inventory/categories/index.ts @@ -25,8 +25,8 @@ const handler = async (req, res) => { return JSON.parse( CryptoJS.AES.decrypt( item.category, - process.env.INVENTORY_ENCRYPTION_KEY - ).toString(CryptoJS.enc.Utf8) + process.env.INVENTORY_ENCRYPTION_KEY, + ).toString(CryptoJS.enc.Utf8), ); }); raw.forEach((item) => { diff --git a/pages/api/property/inventory/categories/items.ts b/pages/api/property/inventory/categories/items.ts index 238fb475e6..98db81f294 100644 --- a/pages/api/property/inventory/categories/items.ts +++ b/pages/api/property/inventory/categories/items.ts @@ -23,7 +23,7 @@ const handler = async (req, res) => { data.map((item: Item) => { const original = CryptoJS.AES.decrypt( item.category, - process.env.INVENTORY_ENCRYPTION_KEY + process.env.INVENTORY_ENCRYPTION_KEY, ).toString(CryptoJS.enc.Utf8); const parsed = JSON.parse(original); @@ -32,19 +32,19 @@ const handler = async (req, res) => { ...item, name: CryptoJS.AES.decrypt( item.name, - process.env.INVENTORY_ENCRYPTION_KEY + process.env.INVENTORY_ENCRYPTION_KEY, ).toString(CryptoJS.enc.Utf8), quantity: CryptoJS.AES.decrypt( item.quantity, - process.env.INVENTORY_ENCRYPTION_KEY + process.env.INVENTORY_ENCRYPTION_KEY, ).toString(CryptoJS.enc.Utf8), note: CryptoJS.AES.decrypt( item.note, - process.env.INVENTORY_ENCRYPTION_KEY + process.env.INVENTORY_ENCRYPTION_KEY, ).toString(CryptoJS.enc.Utf8), category: original, }; - }) + }), ); } catch (e: any) { res.json({ error: e.message }); diff --git a/pages/api/property/inventory/count.ts b/pages/api/property/inventory/count.ts index e38743f3ac..4b3b509ce3 100644 --- a/pages/api/property/inventory/count.ts +++ b/pages/api/property/inventory/count.ts @@ -33,7 +33,7 @@ export default async function handler(req, res) { const data = await getItemCount( res, req.query.property, - req.query.accessToken + req.query.accessToken, ); res.json(data); diff --git a/pages/api/property/inventory/items/create.ts b/pages/api/property/inventory/items/create.ts index e656e4181c..a18c673d72 100644 --- a/pages/api/property/inventory/items/create.ts +++ b/pages/api/property/inventory/items/create.ts @@ -14,12 +14,12 @@ const handler = async (req, res) => { name: CryptoJS.AES.encrypt( req.query.name, - process.env.INVENTORY_ENCRYPTION_KEY + process.env.INVENTORY_ENCRYPTION_KEY, ).toString() || "", quantity: CryptoJS.AES.encrypt( req.query.quantity, - process.env.INVENTORY_ENCRYPTION_KEY + process.env.INVENTORY_ENCRYPTION_KEY, ).toString() ?? "", lastModified: new Date(req.query.lastModified) || new Date(), starred: false, @@ -28,12 +28,12 @@ const handler = async (req, res) => { note: CryptoJS.AES.encrypt( "", - process.env.INVENTORY_ENCRYPTION_KEY + process.env.INVENTORY_ENCRYPTION_KEY, ).toString() ?? "", category: CryptoJS.AES.encrypt( req.query.category, - process.env.INVENTORY_ENCRYPTION_KEY + process.env.INVENTORY_ENCRYPTION_KEY, ).toString() ?? "[]", property: { connect: { id: req.query.property }, diff --git a/pages/api/property/inventory/items/edit.ts b/pages/api/property/inventory/items/edit.ts index d03ab6e3b9..6d1b2ff3e3 100644 --- a/pages/api/property/inventory/items/edit.ts +++ b/pages/api/property/inventory/items/edit.ts @@ -18,21 +18,21 @@ const handler = async (req, res) => { name: CryptoJS.AES.encrypt( req.query.name, - process.env.INVENTORY_ENCRYPTION_KEY + process.env.INVENTORY_ENCRYPTION_KEY, ).toString() ?? "", }), ...(req.query.quantity && { quantity: CryptoJS.AES.encrypt( req.query.quantity, - process.env.INVENTORY_ENCRYPTION_KEY + process.env.INVENTORY_ENCRYPTION_KEY, ).toString() ?? "", }), ...(req.query.note && { note: CryptoJS.AES.encrypt( req.query.note, - process.env.INVENTORY_ENCRYPTION_KEY + process.env.INVENTORY_ENCRYPTION_KEY, ).toString() ?? "", }), ...(req.query.starred && { @@ -43,7 +43,7 @@ const handler = async (req, res) => { category: CryptoJS.AES.encrypt( req.query.category, - process.env.INVENTORY_ENCRYPTION_KEY + process.env.INVENTORY_ENCRYPTION_KEY, ).toString() ?? "", }), }, diff --git a/pages/api/property/inventory/items/index.ts b/pages/api/property/inventory/items/index.ts index 3f9f7b8e3b..5aadd2cc7e 100644 --- a/pages/api/property/inventory/items/index.ts +++ b/pages/api/property/inventory/items/index.ts @@ -23,19 +23,19 @@ const handler = async (req, res) => { ...item, name: CryptoJS.AES.decrypt( item.name, - process.env.INVENTORY_ENCRYPTION_KEY + process.env.INVENTORY_ENCRYPTION_KEY, ).toString(CryptoJS.enc.Utf8), quantity: CryptoJS.AES.decrypt( item.quantity, - process.env.INVENTORY_ENCRYPTION_KEY + process.env.INVENTORY_ENCRYPTION_KEY, ).toString(CryptoJS.enc.Utf8), note: CryptoJS.AES.decrypt( item.note, - process.env.INVENTORY_ENCRYPTION_KEY + process.env.INVENTORY_ENCRYPTION_KEY, ).toString(CryptoJS.enc.Utf8), category: CryptoJS.AES.decrypt( item.category, - process.env.INVENTORY_ENCRYPTION_KEY + process.env.INVENTORY_ENCRYPTION_KEY, ).toString(CryptoJS.enc.Utf8), }); } catch (e: any) { diff --git a/pages/api/property/inventory/items/scan.ts b/pages/api/property/inventory/items/scan.ts index cdd4f67968..f37f1b4a49 100644 --- a/pages/api/property/inventory/items/scan.ts +++ b/pages/api/property/inventory/items/scan.ts @@ -19,7 +19,7 @@ async function query(url) { }, method: "POST", body: data, - } + }, ); const result = await response.json(); return result; diff --git a/pages/api/property/inventory/room/index.ts b/pages/api/property/inventory/room/index.ts index 9bdaf9efb3..92a00afa68 100644 --- a/pages/api/property/inventory/room/index.ts +++ b/pages/api/property/inventory/room/index.ts @@ -57,19 +57,19 @@ const handler = async (req, res) => { ...item, name: CryptoJS.AES.decrypt( item.name, - process.env.INVENTORY_ENCRYPTION_KEY + process.env.INVENTORY_ENCRYPTION_KEY, ).toString(CryptoJS.enc.Utf8), quantity: CryptoJS.AES.decrypt( item.quantity, - process.env.INVENTORY_ENCRYPTION_KEY + process.env.INVENTORY_ENCRYPTION_KEY, ).toString(CryptoJS.enc.Utf8), note: CryptoJS.AES.decrypt( item.note, - process.env.INVENTORY_ENCRYPTION_KEY + process.env.INVENTORY_ENCRYPTION_KEY, ).toString(CryptoJS.enc.Utf8), category: CryptoJS.AES.decrypt( item.category, - process.env.INVENTORY_ENCRYPTION_KEY + process.env.INVENTORY_ENCRYPTION_KEY, ).toString(CryptoJS.enc.Utf8), }; }), diff --git a/pages/api/property/inventory/starred.ts b/pages/api/property/inventory/starred.ts index 0d9c071f53..dc1a6e09d0 100644 --- a/pages/api/property/inventory/starred.ts +++ b/pages/api/property/inventory/starred.ts @@ -22,22 +22,22 @@ const handler = async (req, res) => { ...item, name: CryptoJS.AES.decrypt( item.name, - process.env.INVENTORY_ENCRYPTION_KEY + process.env.INVENTORY_ENCRYPTION_KEY, ).toString(CryptoJS.enc.Utf8), quantity: CryptoJS.AES.decrypt( item.quantity, - process.env.INVENTORY_ENCRYPTION_KEY + process.env.INVENTORY_ENCRYPTION_KEY, ).toString(CryptoJS.enc.Utf8), note: CryptoJS.AES.decrypt( item.note, - process.env.INVENTORY_ENCRYPTION_KEY + process.env.INVENTORY_ENCRYPTION_KEY, ).toString(CryptoJS.enc.Utf8), category: CryptoJS.AES.decrypt( item.category, - process.env.INVENTORY_ENCRYPTION_KEY + process.env.INVENTORY_ENCRYPTION_KEY, ).toString(CryptoJS.enc.Utf8), }; - }) + }), ); } catch (e: any) { res.json({ error: e.message }); diff --git a/pages/api/property/inventory/trash/index.ts b/pages/api/property/inventory/trash/index.ts index 933fb2f8f1..dd49dfe9c9 100644 --- a/pages/api/property/inventory/trash/index.ts +++ b/pages/api/property/inventory/trash/index.ts @@ -24,22 +24,22 @@ const handler = async (req, res) => { ...item, name: CryptoJS.AES.decrypt( item.name, - process.env.INVENTORY_ENCRYPTION_KEY + process.env.INVENTORY_ENCRYPTION_KEY, ).toString(CryptoJS.enc.Utf8), quantity: CryptoJS.AES.decrypt( item.quantity, - process.env.INVENTORY_ENCRYPTION_KEY + process.env.INVENTORY_ENCRYPTION_KEY, ).toString(CryptoJS.enc.Utf8), note: CryptoJS.AES.decrypt( item.note, - process.env.INVENTORY_ENCRYPTION_KEY + process.env.INVENTORY_ENCRYPTION_KEY, ).toString(CryptoJS.enc.Utf8), category: CryptoJS.AES.decrypt( item.category, - process.env.INVENTORY_ENCRYPTION_KEY + process.env.INVENTORY_ENCRYPTION_KEY, ).toString(CryptoJS.enc.Utf8), }; - }) + }), ); } catch (e: any) { res.json({ error: e.message }); diff --git a/pages/api/property/members/add.ts b/pages/api/property/members/add.ts index b4edaccd74..a97572eff9 100644 --- a/pages/api/property/members/add.ts +++ b/pages/api/property/members/add.ts @@ -30,7 +30,7 @@ const handler = async (req, res) => { req.query.property, req.query.accessToken, req, - res + res, ); const data = await prisma.propertyInvite.create({ diff --git a/pages/api/property/members/edit.ts b/pages/api/property/members/edit.ts index 5c8f43f4cd..5b363015e2 100644 --- a/pages/api/property/members/edit.ts +++ b/pages/api/property/members/edit.ts @@ -18,7 +18,7 @@ const handler = async (req, res) => { req.query.property, req.query.accessToken, req, - res + res, ); // Delete user from `propertyInvite` table const data = await prisma.propertyInvite.update({ diff --git a/pages/api/property/members/inviteLink/create.ts b/pages/api/property/members/inviteLink/create.ts index 67f59d055b..844f0aad7a 100644 --- a/pages/api/property/members/inviteLink/create.ts +++ b/pages/api/property/members/inviteLink/create.ts @@ -16,7 +16,7 @@ const handler = async (req, res) => { req.query.property, req.query.accessToken, req, - res + res, ); // Get user id diff --git a/pages/api/property/members/remove.ts b/pages/api/property/members/remove.ts index 2e6b1a112b..612ef98d1e 100644 --- a/pages/api/property/members/remove.ts +++ b/pages/api/property/members/remove.ts @@ -16,7 +16,7 @@ const handler = async (req, res) => { req.query.property, req.query.accessToken, req, - res + res, ); // Delete user from `propertyInvite` table const data = await prisma.propertyInvite.delete({ diff --git a/pages/api/property/storage.ts b/pages/api/property/storage.ts index cc455c9d36..a4163a61ae 100644 --- a/pages/api/property/storage.ts +++ b/pages/api/property/storage.ts @@ -6,7 +6,7 @@ const handler = async (req, res) => { try { res.setHeader( "Cache-Control", - "public, s-maxage=10, stale-while-revalidate=59" + "public, s-maxage=10, stale-while-revalidate=59", ); await validatePermissions({ minimum: "read-only", @@ -23,7 +23,7 @@ const handler = async (req, res) => { const itemCount = await getItemCount( res, req.query.property, - req.query.accessToken + req.query.accessToken, ); res.json({ diff --git a/pages/api/session.ts b/pages/api/session.ts index d7c5506ec0..25e4a03a7f 100644 --- a/pages/api/session.ts +++ b/pages/api/session.ts @@ -10,11 +10,11 @@ import { getUserData } from "../../lib/server/getUserData"; export const sessionData = async (providedToken) => { const { accessToken } = jwt.verify( providedToken, - process.env.SECRET_COOKIE_PASSWORD + process.env.SECRET_COOKIE_PASSWORD, ); - - const token: string = accessToken; - const info = await getUserData(token); + + const token: string = accessToken; + const info = await getUserData(token); return JSON.parse(JSON.stringify(info)); }; diff --git a/pages/api/user/coach/goals/markAsDone.ts b/pages/api/user/coach/goals/markAsDone.ts index cab9ddca7e..b1017484b1 100644 --- a/pages/api/user/coach/goals/markAsDone.ts +++ b/pages/api/user/coach/goals/markAsDone.ts @@ -58,7 +58,7 @@ export default async function handler(req: any, res: any) { if (lastStreakDateInUserTz.getTime() !== currentTimeInUserTz.getTime()) { const differenceInDays = dayjs(currentTimeInUserTz).diff( dayjs(lastStreakDateInUserTz), - "day" + "day", ); await prisma.coachData.update({ diff --git a/pages/api/user/properties.ts b/pages/api/user/properties.ts index fe4ad8c936..eb1edf3a97 100644 --- a/pages/api/user/properties.ts +++ b/pages/api/user/properties.ts @@ -3,7 +3,7 @@ import { prisma } from "@/lib/server/prisma"; export default async function handler(req, res) { res.setHeader( "Cache-Control", - "public, s-maxage=10, stale-while-revalidate=59" + "public, s-maxage=10, stale-while-revalidate=59", ); const data = await prisma.propertyInvite.findMany({ diff --git a/pages/api/user/settings/2fa/verify.ts b/pages/api/user/settings/2fa/verify.ts index 5a84598c55..2943270b5b 100644 --- a/pages/api/user/settings/2fa/verify.ts +++ b/pages/api/user/settings/2fa/verify.ts @@ -25,7 +25,7 @@ const handler = async (req, res) => { twofactor.generateToken(twoFactorSecret); const login: null | { delta: number } = twofactor.verifyToken( twoFactorSecret, - req.query.code + req.query.code, ); cacheData.clear(); diff --git a/pages/auth/index.tsx b/pages/auth/index.tsx index 0c14796353..93294db236 100644 --- a/pages/auth/index.tsx +++ b/pages/auth/index.tsx @@ -69,7 +69,7 @@ function QrLogin({ handleRedirect }) { success: "Success!", error: "An error occured. Please try again later", }, - toastStyles + toastStyles, ); handleRedirect(res); } @@ -94,7 +94,7 @@ function QrLogin({ handleRedirect }) { navigator.clipboard.writeText(url); toast.success( "Copied to clipboard and rechecking if you scanned it...", - toastStyles + toastStyles, ); }; @@ -233,7 +233,7 @@ export default function Prompt() { toast.dismiss(); } }, - [router] + [router], ); const proTips = [ @@ -262,7 +262,7 @@ export default function Prompt() { ]; const [proTip, setProTip] = useState( - proTips[Math.floor(Math.random() * proTips.length)] + proTips[Math.floor(Math.random() * proTips.length)], ); // Login form @@ -300,7 +300,7 @@ export default function Prompt() { ) { toast.error( "Oh no! Our servers are down. Please try again later!", - toastStyles + toastStyles, ); setButtonLoading(false); setStep(1); @@ -328,7 +328,7 @@ export default function Prompt() { success: "Success!", error: "An error occured. Please try again later", }, - toastStyles + toastStyles, ); handleRedirect(res); @@ -338,7 +338,7 @@ export default function Prompt() { setButtonLoading(false); } }, - [captchaToken, email, password, router, twoFactorCode, handleRedirect] + [captchaToken, email, password, router, twoFactorCode, handleRedirect], ); useEffect(() => { @@ -501,14 +501,14 @@ export default function Prompt() { ref.current?.reset(); toast.error( "An error occured. Retrying...", - toastStyles + toastStyles, ); }} onExpire={() => { ref.current?.reset(); toast.error( "Captcha expired. Retrying...", - toastStyles + toastStyles, ); }} scriptOptions={{ defer: true }} diff --git a/pages/auth/reset-password/[id].tsx b/pages/auth/reset-password/[id].tsx index 82019e1b63..b83f23c125 100644 --- a/pages/auth/reset-password/[id].tsx +++ b/pages/auth/reset-password/[id].tsx @@ -43,7 +43,7 @@ export default function Prompt() { } else { toast.error( "An error occurred while trying to change your password.", - toastStyles + toastStyles, ); setButtonLoading(false); } @@ -51,17 +51,17 @@ export default function Prompt() { .catch(() => { toast.error( "An error occurred while trying to change your password", - toastStyles + toastStyles, ); setButtonLoading(false); }); }, - [router, password] + [router, password], ); useStatusBar( typeof window !== "undefined" && window.innerWidth < 600 ? "#c4b5b5" - : "#6b4b4b" + : "#6b4b4b", ); const isDark = useMediaQuery("(prefers-color-scheme: dark)"); diff --git a/pages/claim-esb.tsx b/pages/claim-esb.tsx index e22581ebd0..f2d13fcaae 100644 --- a/pages/claim-esb.tsx +++ b/pages/claim-esb.tsx @@ -31,7 +31,7 @@ export default function Page() { setLoading(false); toast.error( "Yikes! Something went wrong while trying to claim your badge. Please try again later.", - toastStyles + toastStyles, ); } }; diff --git a/pages/coach/routine.tsx b/pages/coach/routine.tsx index b62b5d1599..123a14074f 100644 --- a/pages/coach/routine.tsx +++ b/pages/coach/routine.tsx @@ -35,7 +35,7 @@ export default function Routine() { // return (x === y)? 0 : x? 1 : -1; }) .filter((goal) => !goal.completed), - [data] + [data], ); const [alreadySwitched, setAlreadySwitched] = useState(false); @@ -185,7 +185,7 @@ export default function Routine() { goal={goal} key={goal.id} /> - ) + ), )} {slide >= filteredGoals?.length && ( property.propertyId == id + (property) => property.propertyId == id, )?.accessToken; const { data, url, error } = useApi("property", { diff --git a/pages/index.tsx b/pages/index.tsx index dcd45e9b67..8589ab5a02 100644 --- a/pages/index.tsx +++ b/pages/index.tsx @@ -26,7 +26,7 @@ export function Logo({ intensity = 4, size = 45 }: any) { const palette = useColor( session?.themeColor || "violet", - useDarkMode(session?.darkMode || "system") + useDarkMode(session?.darkMode || "system"), ); return ( @@ -133,9 +133,12 @@ export default function Home() { const [greeting, setGreeting] = useState(getGreeting); useEffect(() => { - const interval = setInterval(() => { - setGreeting(getGreeting); - }, 1000 * 60 * 60); + const interval = setInterval( + () => { + setGreeting(getGreeting); + }, + 1000 * 60 * 60, + ); return () => clearInterval(interval); }); @@ -163,7 +166,7 @@ export default function Home() { .filter( (goal) => dayjs(goal.lastCompleted).format("YYYY-MM-DD") == - dayjs().format("YYYY-MM-DD") + dayjs().format("YYYY-MM-DD"), ); const completedTodaysTasks = diff --git a/pages/invite/[id].tsx b/pages/invite/[id].tsx index fb16bddbc4..d4c3e2e1af 100644 --- a/pages/invite/[id].tsx +++ b/pages/invite/[id].tsx @@ -34,12 +34,12 @@ export default function Onboarding() { const { data } = useApi( "property/members/inviteLink/info", { token: id as string }, - true + true, ); const palette = useColor( data?.property?.color || "gray", - session?.user?.darkMode || false + session?.user?.darkMode || false, ); const handleAccept = () => { @@ -52,7 +52,7 @@ export default function Onboarding() { email: session.user.email, property: data.property.id, sessionId: session.token, - }) + }), ) .then(() => { mutate("/api/session"); @@ -63,7 +63,7 @@ export default function Onboarding() { console.error(e); toast.error( "Something went wrong while accepting the invite. Please try again later.", - toastStyles + toastStyles, ); setLoading(false); }); @@ -72,7 +72,7 @@ export default function Onboarding() { 500, 1000, "/signup?close=true", - "Please sign in to your Dysperse account" + "Please sign in to your Dysperse account", ); setLoading(false); } diff --git a/pages/items.tsx b/pages/items.tsx index 1996f7f764..2b84118e46 100644 --- a/pages/items.tsx +++ b/pages/items.tsx @@ -29,7 +29,7 @@ import { Navbar } from "."; const Action = dynamic(() => import("@/components/Rooms/Action")); const CategoryModal = dynamic( - () => import("@/components/Rooms/items/CategoryModal") + () => import("@/components/Rooms/items/CategoryModal"), ); export const SidebarContext = createContext(""); diff --git a/pages/mood-history.tsx b/pages/mood-history.tsx index 94daaea3dd..49d5495d33 100644 --- a/pages/mood-history.tsx +++ b/pages/mood-history.tsx @@ -72,7 +72,7 @@ export default function History() { const dataByDate = data ? data.sort( (a: any, b: any) => - (new Date(b.date) as any) - (new Date(a.date) as any) + (new Date(b.date) as any) - (new Date(a.date) as any), ) : []; @@ -254,7 +254,7 @@ export default function History() { {[...new Set(data.map((item) => item.reason))].map( (reason: any) => ( - ) + ), )} diff --git a/pages/settings/index.tsx b/pages/settings/index.tsx index bd9993ad36..2ad1336888 100644 --- a/pages/settings/index.tsx +++ b/pages/settings/index.tsx @@ -115,13 +115,13 @@ export default function Layout({ children }: any) { setOpen(false); setTimeout(() => { router.push( - `/settings/${button.text.toLowerCase().replaceAll(" ", "-")}` + `/settings/${button.text.toLowerCase().replaceAll(" ", "-")}`, ); }, 200); }} sx={styles( router.pathname === - `/settings/${button.text.toLowerCase().replaceAll(" ", "-")}` + `/settings/${button.text.toLowerCase().replaceAll(" ", "-")}`, )} > expand_all @@ -280,7 +280,7 @@ export default function Layout({ children }: any) { {capitalizeFirstLetter( router.asPath .replace("/settings/", "") - .replaceAll("-", " ") || "Settings" + .replaceAll("-", " ") || "Settings", )} ))} diff --git a/pages/settings/login-activity.tsx b/pages/settings/login-activity.tsx index f430681cf3..f15b09d62f 100644 --- a/pages/settings/login-activity.tsx +++ b/pages/settings/login-activity.tsx @@ -43,7 +43,7 @@ const Session: any = React.memo(function Session({ whiteSpace: "nowrap", }} primary={dayjs(data[index].timestamp).format( - "dddd, MMMM D, YYYY h:mm A" + "dddd, MMMM D, YYYY h:mm A", )} secondary={ { @@ -124,7 +124,7 @@ export default function Notifications() { success: "Saved!", error: "Failed to save", }, - toastStyles + toastStyles, ); }; @@ -219,7 +219,7 @@ export default function Notifications() { onClick={(e: any) => handleNotificationChange( "dailyRoutineNudge", - e.target.checked + e.target.checked, ) } /> @@ -234,7 +234,7 @@ export default function Notifications() { onClick={(e: any) => handleNotificationChange( "dailyCheckInNudge", - e.target.checked + e.target.checked, ) } /> diff --git a/pages/settings/two-factor-authentication.tsx b/pages/settings/two-factor-authentication.tsx index 673d104732..81cdf6c2df 100644 --- a/pages/settings/two-factor-authentication.tsx +++ b/pages/settings/two-factor-authentication.tsx @@ -36,7 +36,7 @@ export default function App() { }).toString()}`, { method: "POST", - } + }, ) .then((res) => res.json()) .then((res) => { diff --git a/pages/trash.tsx b/pages/trash.tsx index 9e03f261ca..f0b84d1f58 100644 --- a/pages/trash.tsx +++ b/pages/trash.tsx @@ -26,7 +26,7 @@ function DeleteCard({ item }) { }).catch(() => { toast.error( "An error occured while trying to delete this item. Please try again later", - toastStyles + toastStyles, ); setHidden(false); }); @@ -141,7 +141,7 @@ export default function Trash() { .catch(() => { toast.error( "An error occured while trying to empty your trash. Please try again later", - toastStyles + toastStyles, ); }) .then(() => { diff --git a/pages/users/[id].tsx b/pages/users/[id].tsx index ac33ea8ace..59b9f41de8 100644 --- a/pages/users/[id].tsx +++ b/pages/users/[id].tsx @@ -336,7 +336,7 @@ function Page() { isCurrentUser || (members && members.find( - (member) => member.user.email === data.email + (member) => member.user.email === data.email, )) } members={ diff --git a/pages/users/index.tsx b/pages/users/index.tsx index c7935fd764..aca3693a00 100644 --- a/pages/users/index.tsx +++ b/pages/users/index.tsx @@ -70,7 +70,7 @@ function Friend({ friend }) { // Parse the working hours string into an array of objects const workingHours = JSON.parse( - friend?.following?.Profile?.workingHours || "[]" + friend?.following?.Profile?.workingHours || "[]", ); // Get the current day of the week (1 = Monday, 2 = Tuesday, etc.) @@ -78,7 +78,7 @@ function Friend({ friend }) { // Find the working hours for the current day of the week const currentWorkingHours = workingHours.find( - (hours) => hours.dayOfWeek === currentDayOfWeek + (hours) => hours.dayOfWeek === currentDayOfWeek, ); // Check if the current time falls within the working hours @@ -341,7 +341,7 @@ export default function Page() { onClick={() => window.open( "https://blog.dysperse.com/series/support?utm_source=" + - window.location.hostname + window.location.hostname, ) } > diff --git a/push-server/src/dailyNudge.ts b/push-server/src/dailyNudge.ts index ddc752eff3..8559b85246 100644 --- a/push-server/src/dailyNudge.ts +++ b/push-server/src/dailyNudge.ts @@ -20,7 +20,7 @@ const handler = { // Delete vanishing tasks await fetch( "https://my.dysperse.com/api/cron/deleteVanishingTasks", - params + params, ); // Daily check in nudge @@ -29,7 +29,7 @@ const handler = { // Daily check in nudge await fetch( "https://my.dysperse.com/api/cron/deleteExpiredQrCodes", - params + params, ); await SentryFinish(id); diff --git a/styles/globals.scss b/styles/globals.scss index 5a1e46e9f6..ffa444cb14 100644 --- a/styles/globals.scss +++ b/styles/globals.scss @@ -115,12 +115,20 @@ body { -webkit-font-feature-settings: "liga"; -webkit-font-smoothing: antialiased; min-width: fit-content; - font-variation-settings: "FILL" 0, "wght" 350, "GRAD" 0, "opsz" 40; + font-variation-settings: + "FILL" 0, + "wght" 350, + "GRAD" 0, + "opsz" 40; } .material-symbols-rounded { font-display: block !important; - font-variation-settings: "FILL" 1, "wght" 300, "GRAD" 0, "opsz" 40; + font-variation-settings: + "FILL" 1, + "wght" 300, + "GRAD" 0, + "opsz" 40; min-width: fit-content; } @@ -310,8 +318,8 @@ a { } } - -html, body { +html, +body { /* Vendor-specific prefixes */ -webkit-overflow-scrolling: touch; /* For older Android versions */ -webkit-backface-visibility: hidden; /* For smooth scrolling on some devices */ @@ -319,6 +327,7 @@ html, body { overscroll-behavior: contain; /* This makes the scrolling elastic and stretchy */ } -.MuiPaper-root, .MuiBackdrop-root { +.MuiPaper-root, +.MuiBackdrop-root { overscroll-behavior: contain; } diff --git a/worker/index.js b/worker/index.js index f9bc132be8..c52701ff3a 100644 --- a/worker/index.js +++ b/worker/index.js @@ -24,7 +24,7 @@ self.addEventListener("push", (event) => { vibrate: [200, 100, 200], badge: "https://assets.dysperse.com/v6/20230123_114910_0000.png", actions: JSON.parse(event?.data?.text() ?? "{}").actions ?? [], - }) + }), ); }); @@ -62,7 +62,7 @@ self.addEventListener("notificationclick", function (event) { return client.focus(); } return clients.openWindow(path); - }) + }), ); }); @@ -70,15 +70,17 @@ self.addEventListener("pushsubscriptionchange", function (event) { event.waitUntil( Promise.all([ Promise.resolve( - event.oldSubscription ? deleteSubscription(event.oldSubscription) : true + event.oldSubscription + ? deleteSubscription(event.oldSubscription) + : true, ), Promise.resolve( event.newSubscription ? event.newSubscription - : subscribePush(registration) + : subscribePush(registration), ).then(function (sub) { return saveSubscription(sub); }), - ]) + ]), ); });