diff --git a/components/auth-state.tsx b/components/auth-state.tsx index c43275d..f9bc219 100644 --- a/components/auth-state.tsx +++ b/components/auth-state.tsx @@ -8,7 +8,8 @@ export default function AuthState({ classes, nextOverride = ``, hideOnUsersLoadi hideOnUsersLoading == true && usersLoading ? <> : ( {user != null ? ( - `Welcome, ${user?.name} - Credits: ${(20_000 - user?.properties)?.toLocaleString()}` + ` ${user?.name}` + // `Welcome, ${user?.name} - Credits: ${(20_000 - user?.properties)?.toLocaleString()}` ) : (nextOverride != `` && authState == AuthStates.Next) ? nextOverride : authState} ) diff --git a/components/boards/boards.tsx b/components/boards/boards.tsx index cc1f949..18dc565 100644 --- a/components/boards/boards.tsx +++ b/components/boards/boards.tsx @@ -1,14 +1,15 @@ import Board from './board'; import { toast } from 'react-toastify'; -import { Types } from '../../shared/types/types'; +import { User } from '../../shared/models/User'; import MultiSelector from '../selector/multi-selector'; import { collection, getDocs } from 'firebase/firestore'; import IVFSkeleton from '../loaders/skeleton/ivf_skeleton'; +import { AuthGrids, GridTypes, Types } from '../../shared/types/types'; import { useState, useEffect, useContext, useRef } from 'react'; -import { generateArray, logToast } from '../../shared/constants'; import { capWords, replaceAll, StateContext } from '../../pages/_app'; import { Droppable, Draggable, DragDropContext } from 'react-beautiful-dnd'; import { Board as BoardModel, createBoard } from '../../shared/models/Board'; +import { generateArray, logToast, withinXTime } from '../../shared/constants'; import { addBoardToDatabase, boardsTable, db, updateDocFieldsWTimeStamp } from '../../firebase'; export enum ItemTypes { @@ -34,6 +35,14 @@ export const getLoadingLabel = (lbl: string, authState, user) => { return user != null ? `${lbl} Loading` : `${!nonFormAuthStates.includes(authState) ? authState : `Register`} to View ${lbl}`; } +export const recentlyAuthenticated = (usr: User, interval = 5, timePass = `minutes`) => { + let isRecentlyAuthenticated = false; + let userRecentAuth = usr?.auth?.lastAuthenticated; + let userRecentlyAuthenticated = withinXTime(userRecentAuth, interval, timePass); + isRecentlyAuthenticated = userRecentlyAuthenticated; + return isRecentlyAuthenticated; +} + export default function Boards(props: any) { let { user, @@ -42,8 +51,11 @@ export default function Boards(props: any) { setLoading, globalUserData, setSystemStatus, + setActiveOptions, switchSelectedGrid, rte, router, setRte, + openAuthenticationForm, + userRecentlyAuthenticated, boards, setBoards, boardsLoading, grids, gridsLoading, selectedGrids, selectedGrid, } = useContext(StateContext); @@ -64,18 +76,14 @@ export default function Boards(props: any) { const updateSelectedGrids = async (updatedSelectedGrids) => { let thisGrid = updatedSelectedGrids[0]; - - // const openAuthenticationForm = () => { - // setOnAuthenticateLabel(`View Private Grid`); - // setOnAuthenticateFunction(`Switch Grid`); - // setAuthenticateOpen(true); - // setUpNextGrid(thisGrid); - // } - - switchSelectedGrid(user, thisGrid); - // if (thisGrid?.options?.private == true && thisGrid?.gridType == GridTypes.Private) { - // openAuthenticationForm(); - // } else switchSelectedGrid(user, thisGrid); + if (AuthGrids?.includes(thisGrid?.gridType)) { + if (userRecentlyAuthenticated) { + switchSelectedGrid(user, thisGrid); + } else { + setActiveOptions([selectedGrid]); + openAuthenticationForm(thisGrid); + } + } else switchSelectedGrid(user, thisGrid); } const onDragEnd = (dragEndEvent) => { @@ -126,7 +134,7 @@ export default function Boards(props: any) { } const createBoardComponent = () => ( -
+
@@ -213,7 +221,7 @@ export default function Boards(props: any) { {selectedGrid?.options?.newestBoardsOnTop ? ((boardsLoading || user?.uid != selectedGrid?.ownerUID) ? <> : createBoardComponent()) : <>} -
+
0 ? `hasBoards` : `noBoards`} ${boards && boards?.length == 1 ? `oneBoard` : ``}`}> {(boardsLoading || selectedGrid == null) ? <>
diff --git a/components/modals/authenticate/authenticate-dialog.tsx b/components/modals/authenticate/authenticate-dialog.tsx index 7fea160..5b41d89 100644 --- a/components/modals/authenticate/authenticate-dialog.tsx +++ b/components/modals/authenticate/authenticate-dialog.tsx @@ -5,9 +5,29 @@ import { StateContext } from '../../../pages/_app'; import { logToast } from '../../../shared/constants'; import Authenticate, { onAuthenticate } from './authenticate'; import { deleteDatabaseData, deleteUserAuth } from '../../../firebase'; +import { AuthGrids } from '../../../shared/types/types'; export default function AuthenticationDialog({ }: any) { - const { user, signOutReset, onSignOut, onAuthenticateFunction, authenticateOpen, setAuthenticateOpen } = useContext(StateContext); + const { + user, + onSignOut, + upNextGrid, + signOutReset, + globalUserData, + authenticateOpen, + setAuthenticateOpen, + hardSetSelectedGrid, + onAuthenticateFunction, + } = useContext(StateContext); + + const deleteAndCloseDialog = () => { + setAuthenticateOpen(false); + deleteUserFromDatabases(); + } + const setAuthGrid = () => { + setAuthenticateOpen(false); + hardSetSelectedGrid(upNextGrid, globalUserData?.grids); + } const deleteUserFromDatabases = async () => { toast.info(`Deleting User ${user?.id}`); @@ -22,10 +42,18 @@ export default function AuthenticationDialog({ }: any) { }); } + const onCloseLogic = (e?: any) => { + setAuthenticateOpen(!authenticateOpen); + if (onAuthenticateFunction == `Set Grid`) { + const unAuthGrids = globalUserData?.grids?.filter(gr => !AuthGrids?.includes(gr?.gridType)); + hardSetSelectedGrid(unAuthGrids[0], globalUserData?.grids); + } + } + return ( setAuthenticateOpen(!authenticateOpen)} + onClose={(e) => onCloseLogic(e)} slotProps={{ paper: { component: `form`, @@ -35,28 +63,10 @@ export default function AuthenticationDialog({ }: any) { const formData = new FormData(event.currentTarget); const formJson = Object.fromEntries((formData as any).entries()); const { password } = formJson; - // const switchGrid = () => { - // setAuthenticateOpen(false); - // switchSelectedGrid(user, upNextGrid); - // // let usrGridURL = `/user/${user?.rank}/grids/${upNextGrid?.rank}`; - // // router.replace(usrGridURL, undefined, { - // // shallow: true, - // // }); - // } - // const setGrid = () => { - // setAuthenticateOpen(false); - // setSelectedGrd(upNextGrid); - // // let usrGridURL = `/user/${user?.rank}/grids/${upNextGrid?.rank}`; - // // router.replace(usrGridURL, undefined, { - // // shallow: true, - // // }); - // } - const deleteAndCloseDialog = () => { - setAuthenticateOpen(false); - deleteUserFromDatabases(); - } if (onAuthenticateFunction == `Default`) { onAuthenticate(user, password, deleteAndCloseDialog, event); + } else if (onAuthenticateFunction == `Set Grid`) { + onAuthenticate(user, password, setAuthGrid, event); } }, }, diff --git a/components/modals/authenticate/authenticate.tsx b/components/modals/authenticate/authenticate.tsx index e4dd9e5..251c06e 100644 --- a/components/modals/authenticate/authenticate.tsx +++ b/components/modals/authenticate/authenticate.tsx @@ -29,17 +29,20 @@ export const onAuthenticate = (usr: User, password: string, onAuthenticatedFunct let lastAttemptWithin24Hours = withinXTime(lastAttempt, defaultTimePass, defaultInterval); signInWithEmailAndPassword(auth, email, password).then(async (userCredential) => { - if (userCredential != null) { + const successfulAuthentication = userCredential != null; + if (successfulAuthentication) { let closeButton: any = document.querySelector(`.alertButton`); if (closeButton) closeButton.click(); - updateDocFieldsWTimeStamp(usr, { 'auth.lastAuthenticated': date }); + updateDocFieldsWTimeStamp(usr, { [`auth.attempts`]: 0, [`auth.lastAuthenticated`]: date }); onAuthenticatedFunction(usr); } }).catch((error) => { if (lastAttemptWithin24Hours == true) { if (nextAttemptNumber <= maxAuthAttempts) { attemptsToUse = nextAttemptNumber; - updateDocFieldsWTimeStamp(usr, { 'auth.attempts': attemptsToUse, 'auth.lastAttempt': date }); + let attemptsRemaining = maxAuthAttempts - attemptsToUse; + toast.warn(`${attemptsRemaining} Attempts Left`); + updateDocFieldsWTimeStamp(usr, { [`auth.attempts`]: attemptsToUse, [`auth.lastAttempt`]: date }); } else { const errorMessage = error.message; const nextTryDate = moment(new Date(lastAttempt))?.add(defaultTimePass, defaultInterval)?.format(momentFormats?.default); @@ -56,7 +59,7 @@ export const onAuthenticate = (usr: User, password: string, onAuthenticatedFunct } } } - } else updateDocFieldsWTimeStamp(usr, { 'auth.attempts': 1, 'auth.lastAttempt': date }); + } else updateDocFieldsWTimeStamp(usr, { [`auth.attempts`]: 1, [`auth.lastAttempt`]: date }); return; }); diff --git a/components/selector/multi-selector.tsx b/components/selector/multi-selector.tsx index ca5a3c6..781566c 100644 --- a/components/selector/multi-selector.tsx +++ b/components/selector/multi-selector.tsx @@ -131,15 +131,20 @@ const MultiSelector = forwardRef((props: any, ref) => { placeholder = `Start Typing or Click Here`, } = props; - let { user, selectedGrid, activeOptions, setActiveOptions } = useContext(StateContext); + let { user, selectedGrid, activeOptions, setActiveOptions, openAuthenticationForm, userRecentlyAuthenticated } = useContext(StateContext); let [hoveringOver, setHoveringOver] = useState(false); const onChangeValue = (val) => { if (single) val = isValid(val) && val?.length > 0 ? [val[val.length - 1]] : []; if (single && val?.length == 0) return; - setActiveOptions(val); - onChange(val); + + const updateSelection = () => { + setActiveOptions(val); + onChange(val); + } + + updateSelection(); } useImperativeHandle(ref, () => ({ diff --git a/components/time.tsx b/components/time.tsx new file mode 100644 index 0000000..0160237 --- /dev/null +++ b/components/time.tsx @@ -0,0 +1,30 @@ +import moment from 'moment-timezone'; +import { StateContext } from '../pages/_app'; +import { useContext, useEffect } from 'react'; +import { momentFormats } from '../shared/constants'; + +export default function Time({ dynamic = true, wSeconds = true }) { + const { currentTime, setCurrentTime } = useContext(StateContext); + + useEffect(() => { + const updateTime = () => { + const format = wSeconds ? momentFormats.wSeconds : momentFormats.default; + setCurrentTime(moment().format(format)); + } + + updateTime(); + + if (dynamic == true) { + const interval = setInterval(updateTime, 1000); + return () => clearInterval(interval); + } + }, [dynamic, wSeconds]) + + return <> +
+
+ {currentTime} +
+
+ +} \ No newline at end of file diff --git a/main.scss b/main.scss index cf6b666..4f02518 100644 --- a/main.scss +++ b/main.scss @@ -4,6 +4,7 @@ @use './styles/grids'; @use './styles/utility'; @use './styles/columns'; +@use './styles/migration'; @use './styles/contextmenu'; @use './shared/admin/features'; @use './styles/itemsoverwrite'; diff --git a/package.json b/package.json index a2664bd..60b1ab1 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "product-ivf", - "version": "5.5.0", + "version": "5.6.0", "description": "Nextra docs template", "scripts": { "dev": "next dev", diff --git a/pages/_app.js b/pages/_app.js index e74df23..34f62c2 100644 --- a/pages/_app.js +++ b/pages/_app.js @@ -16,9 +16,9 @@ import { addBoardScrollBars } from '../components/boards/board'; import { createContext, useRef, useState, useEffect } from 'react'; import ContextMenu from '../components/context-menus/context-menu'; import { renderFirebaseAuthErrorMessage } from '../components/form'; -import { AuthStates, GridTypes, Types } from '../shared/types/types'; import { seedUserData as generateSeedUserData } from '../shared/database'; import { collection, onSnapshot, query, where } from 'firebase/firestore'; +import { AuthGrids, AuthStates, GridTypes, Types } from '../shared/types/types'; import { defaultAuthenticateLabel, isValid, logToast } from '../shared/constants'; import { onAuthStateChanged, signInWithEmailAndPassword, signOut } from 'firebase/auth'; import AuthenticationDialog from '../components/modals/authenticate/authenticate-dialog'; @@ -35,6 +35,8 @@ import { gridDataCollectionNames, updateDocFieldsWTimeStamp, } from '../firebase'; +import { recentlyAuthenticated } from '../components/boards/boards'; +import moment from 'moment-timezone'; export const StateContext = createContext({}); @@ -438,8 +440,11 @@ export default function ProductIVF({ Component, pageProps, router }) { let [featuresLoading, setFeaturesLoading] = useState(true); let [authenticateOpen, setAuthenticateOpen] = useState(false); let [onAuthenticateFunction, setOnAuthenticateFunction] = useState(`Default`); + let [userRecentlyAuthenticated, setUserRecentlyAuthenticated] = useState(false); let [onAuthenticateLabel, setOnAuthenticateLabel] = useState(defaultAuthenticateLabel); + let [currentTime, setCurrentTime] = useState(getIDParts()?.date); + let [user, setUser] = useState(null); let [users, setUsers] = useState([]); let [grids, setGrids] = useState([]); @@ -538,28 +543,6 @@ export default function ProductIVF({ Component, pageProps, router }) { await resetGridsBoards(); } - const setSelectedGrd = (selectedGrd) => { - setSelectedGrid(selectedGrd); - setSelectedGrids([selectedGrd]); - setActiveOptions([selectedGrd]); - } - - const switchSelectedGrid = (usr, selectedGrd, navigate = useNavigation) => { - // console.log(`Selected Grid`, usr?.lastSelectedGridID, `New Grid`, selectedGrd?.id); - if (usr?.lastSelectedGridID != selectedGrd?.id) { - updateDocFieldsWTimeStamp(usr, { - lastSelectedGridID: selectedGrd?.id, - [`data.selectedGridIDs`]: [selectedGrd?.id], - }); - } - if (navigate) { - let usrGridURL = `/user/${usr?.rank}/grids/${selectedGrd?.rank}`; - router.replace(usrGridURL, undefined, { - shallow: true, - }); - } - } - const onSignOut = async (navigateToHome = true) => { try { await setUpdates(updates + 1); @@ -571,48 +554,6 @@ export default function ProductIVF({ Component, pageProps, router }) { } } - const getGridsBoards = (activeGrds, brds) => { - let gridsBoards = []; - let gridsBoardsIDs = activeGrds?.length > 0 ? activeGrds.map(grd => grd?.data?.boardIDs).flat() : []; - if (gridsBoardsIDs.length > 0) { - gridsBoardsIDs.forEach(gbID => { - let gBoard = brds.find(br => br?.id == gbID); - if (gBoard) gridsBoards.push(gBoard); - }) - } - return gridsBoards; - } - - const setUsersGridsState = (lastSelectedGridID, usersGridsByID, updateGrids = true) => { - if (updateGrids == true) { - setGrids(usersGridsByID); - setUserGrids(usersGridsByID); - setUsersGrids(usersGridsByID); - } - let lastSelectedGrid = usersGridsByID?.find(gr => gr?.id == lastSelectedGridID); - if (lastSelectedGrid) { - // const openAuthenticationForm = () => { - // setOnAuthenticateLabel(`View Private Grid`); - // setOnAuthenticateFunction(`Set Grid`); - // setUpNextGrid(lastSelectedGrid); - // setAuthenticateOpen(true); - // } - setSelectedGrd(lastSelectedGrid); - // let recentlyAuthenticated = withinXTime(user?.auth?.lastAuthenticated, 15, `minutes`); - // if (!recentlyAuthenticated && (lastSelectedGrid?.options?.private == true && lastSelectedGrid?.gridType == GridTypes.Private)) { - // openAuthenticationForm(); - // } else setSelectedGrd(lastSelectedGrid); - } - setGlobalUserData(prevGlobalUserData => ({ - ...prevGlobalUserData, - user, - grids: usersGridsByID, - lastUpdateFrom: `Grids`, - lastUpdate: getIDParts()?.date, - })) - if (usersGridsByID?.length > 0) setGridsLoading(false); - } - const seedUserDataNoDB = (usr) => { let { grids: grds, boards: brds, user: updatedUser } = generateSeedUserData(usr); @@ -725,6 +666,109 @@ export default function ProductIVF({ Component, pageProps, router }) { }); } + const getGridsBoards = (activeGrds, brds) => { + let gridsBoards = []; + let gridsBoardsIDs = activeGrds?.length > 0 ? activeGrds.map(grd => grd?.data?.boardIDs).flat() : []; + if (gridsBoardsIDs.length > 0) { + gridsBoardsIDs.forEach(gbID => { + let gBoard = brds.find(br => br?.id == gbID); + if (gBoard) gridsBoards.push(gBoard); + }) + } + return gridsBoards; + } + + const setSelectedGrd = (selectedGrd) => { + setSelectedGrid(selectedGrd); + setSelectedGrids([selectedGrd]); + setActiveOptions([selectedGrd]); + } + + const openAuthenticationForm = (grd, actionType = `View Private Grid`, onAuthFuncType = `Set Grid`) => { + setOnAuthenticateLabel(actionType); + setOnAuthenticateFunction(onAuthFuncType); + setUpNextGrid(grd); + setAuthenticateOpen(true); + } + + const switchSelectedGrid = (usr, selectedGrd, navigate = useNavigation) => { + if (usr?.lastSelectedGridID != selectedGrd?.id) { + updateDocFieldsWTimeStamp(usr, { + lastSelectedGridID: selectedGrd?.id, + [`data.selectedGridIDs`]: [selectedGrd?.id], + }); + } + if (navigate) { + let usrGridURL = `/user/${usr?.rank}/grids/${selectedGrd?.rank}`; + router.replace(usrGridURL, undefined, { + shallow: true, + }); + } + } + + const hardSetSelectedGrid = (gridToSet, grids) => { + if (user?.lastSelectedGridID != gridToSet?.id) { + updateDocFieldsWTimeStamp(user, { + lastSelectedGridID: gridToSet?.id, + [`data.selectedGridIDs`]: [gridToSet?.id], + }); + } + setUsersGridsState(gridToSet?.id, grids, globalUserDataLoading); + } + + const setGlobalUserGrids = (gridsToSet, gridID = user?.lastSelectedGridID) => { + setGlobalUserData(prevGlobalUserData => ({ + ...prevGlobalUserData, + user, + grids: gridsToSet, + lastUpdateFrom: `Grids`, + lastUpdate: getIDParts()?.date, + })); + + // let lastSelectedGrid = gridsToSet?.find(gr => gr?.id == gridID); + // if (lastSelectedGrid) { + // setSelectedGrd(lastSelectedGrid); + // } + // if (gridsToSet?.length > 0) setGridsLoading(false); + } + + const setUsersGridsState = (lastSelectedGridID, usersGridsByID, updateGrids = true) => { + if (updateGrids == true) { + setGrids(usersGridsByID); + setUserGrids(usersGridsByID); + setUsersGrids(usersGridsByID); + } + setGlobalUserGrids(usersGridsByID, lastSelectedGridID); + + let lastSelectedGrid = usersGridsByID?.find(gr => gr?.id == lastSelectedGridID); + if (lastSelectedGrid) { + setSelectedGrd(lastSelectedGrid); + } + if (usersGridsByID?.length > 0) setGridsLoading(false); + } + + const [showedTimeWarning, setShowedTimeWarning] = useState(false); + useEffect(() => { + const isRecentlyAuthenticated = recentlyAuthenticated(user); + setUserRecentlyAuthenticated(isRecentlyAuthenticated); + let time = moment(new Date(currentTime)); + let kickTime = moment(new Date(user?.auth?.lastAuthenticated)).add(5, `minutes`); + let warningTime = moment(new Date(user?.auth?.lastAuthenticated)).add(4, `minutes`); + if (AuthGrids?.includes(selectedGrid?.gridType)) { + if (time?.isSameOrAfter(warningTime) && time.isBefore(kickTime)) { + if (!showedTimeWarning) { + toast?.warn(`Will be transferred to non private grid soon`, { autoClose: 60_000, position: `bottom-right` }); + setShowedTimeWarning(true); + } + } + // Enhance By Checking If User Is Active by Querying All User Data Meta.Updated Values + if (!isRecentlyAuthenticated) { + const unAuthGrids = globalUserData?.grids?.filter(gr => !AuthGrids?.includes(gr?.gridType)); + hardSetSelectedGrid(unAuthGrids[0], globalUserData?.grids); + } + } + }, [currentTime]) + useEffect(() => { let usersLoaded = globalUserData?.users; let userLoaded = usersLoaded && globalUserData?.user; @@ -808,30 +852,28 @@ export default function ProductIVF({ Component, pageProps, router }) { let userGridByID = userGridsFromDB?.find(gr => gr?.id == gridID); if (userGridByID) return userGridByID; }) - dev() && console.log(`Updated User`, { - user, - useNavigation, - lastSelectedGridID: user?.lastSelectedGridID, - }); + setGlobalUserGrids(usersGridsByID); if (useNavigation == true) { if (id) { if (gridid) { if (usersGridsByID && usersGridsByID?.length > 0) { let thisGrid = usersGridsByID?.find(gr => String(gr?.rank) == String(gridid)); if (thisGrid) { - if (user?.lastSelectedGridID != thisGrid?.id) { - dev() && console.log(`Using Navigation`, thisGrid?.id); - updateDocFieldsWTimeStamp(user, { - lastSelectedGridID: thisGrid?.id, - 'data.selectedGridIDs': [thisGrid?.id], - }); - } - setUsersGridsState(thisGrid?.id, usersGridsByID, globalUserDataLoading); + hardSetSelectedGrid(thisGrid, usersGridsByID); } } } else setUsersGridsState(user?.lastSelectedGridID, usersGridsByID, globalUserDataLoading); } else setUsersGridsState(user?.lastSelectedGridID, usersGridsByID, globalUserDataLoading); - } else setUsersGridsState(user?.lastSelectedGridID, usersGridsByID, globalUserDataLoading); + } else { + if (usersGridsByID && usersGridsByID?.length > 0) { + let gridToSet = usersGridsByID?.find(gr => gr?.id == user?.lastSelectedGridID); + if (AuthGrids?.includes(gridToSet?.gridType)) { + if (!recentlyAuthenticated(user)) { + openAuthenticationForm(gridToSet); + } else setUsersGridsState(user?.lastSelectedGridID, usersGridsByID, globalUserDataLoading); + } else setUsersGridsState(user?.lastSelectedGridID, usersGridsByID, globalUserDataLoading); + } + } }) } else { if (listenforUserGridsChanges != null) listenforUserGridsChanges(); @@ -1044,10 +1086,12 @@ export default function ProductIVF({ Component, pageProps, router }) { highScore, setHighScore, rearranging, setRearranging, showLeaders, setShowLeaders, + currentTime, setCurrentTime, systemStatus, setSystemStatus, useNavigation, setUseNavigation, featuresLoading, setFeaturesLoading, authenticateOpen, setAuthenticateOpen, + userRecentlyAuthenticated, setUserRecentlyAuthenticated, // Functions onSignIn, @@ -1060,6 +1104,8 @@ export default function ProductIVF({ Component, pageProps, router }) { isFeatureEnabled, switchSelectedGrid, setUsersGridsState, + hardSetSelectedGrid, + openAuthenticationForm, onAuthenticateLabel, setOnAuthenticateLabel, onAuthenticateFunction, setOnAuthenticateFunction, diff --git a/shared/constants.ts b/shared/constants.ts index c180d63..d8f2677 100644 --- a/shared/constants.ts +++ b/shared/constants.ts @@ -36,6 +36,7 @@ export const extractRankFromDoc = (doc: Partial | Partial | Partial< export const momentFormats = { default: `h:mm A M/D/YYYY`, + wSeconds: `h:mm:ss A M/D/YYYY`, } export const nameFields = { diff --git a/shared/types/types.ts b/shared/types/types.ts index ee10cab..8221b58 100644 --- a/shared/types/types.ts +++ b/shared/types/types.ts @@ -25,6 +25,8 @@ export enum GridTypes { Archived = `Archived`, } +export const AuthGrids = [GridTypes.Private]; + export enum TasksFilterStates { All_On = `All On`, Tasks = `Tasks`, diff --git a/styles/_finaloverwrite.scss b/styles/_finaloverwrite.scss index 52d73bb..f74bf9d 100644 --- a/styles/_finaloverwrite.scss +++ b/styles/_finaloverwrite.scss @@ -58,6 +58,8 @@ button { } } +.pointerEventsNone { pointer-events: none !important; } + // * { // --main: var(--grass); // --gameBlue: var(--main); diff --git a/styles/_migration.scss b/styles/_migration.scss new file mode 100644 index 0000000..cb70f67 --- /dev/null +++ b/styles/_migration.scss @@ -0,0 +1,4 @@ +.timeComponent { + font-weight: 500; + min-width: max-content; +} \ No newline at end of file diff --git a/styles/_utility.scss b/styles/_utility.scss index f12509a..5778469 100644 --- a/styles/_utility.scss +++ b/styles/_utility.scss @@ -1,6 +1,8 @@ .hidden { display: none; } .flexThis { display: flex; } +.blurred { filter: blur(15px); } .rowThis { flex-direction: row; } +.transition { transition: var(--transition); } @mixin setWidth($width) { height: $width !important; diff --git a/theme.config.tsx b/theme.config.tsx index 5d37de4..8cd0cc3 100644 --- a/theme.config.tsx +++ b/theme.config.tsx @@ -7,6 +7,7 @@ import Footer from './components/footer'; import AuthState from './components/auth-state'; import { AuthStates } from './shared/types/types'; import { DocsThemeConfig } from 'nextra-theme-docs'; +import Time from './components/time'; const setToc = (e) => { let toc = document.querySelector(`.nextra-toc`); @@ -20,6 +21,7 @@ const navForm = (headerForm = false) => { return (
+