mirror of
https://github.com/fergalmoran/radio-otherway.git
synced 2025-12-22 09:50:29 +00:00
Images working (needs testing)
This commit is contained in:
97
.eslintrc.js
Normal file
97
.eslintrc.js
Normal file
@@ -0,0 +1,97 @@
|
||||
const prettierConfig = require("./.prettierrc.js");
|
||||
|
||||
module.exports = {
|
||||
env: {
|
||||
browser: true,
|
||||
commonjs: true,
|
||||
es2021: true,
|
||||
node: true,
|
||||
},
|
||||
extends: [
|
||||
"next",
|
||||
"prettier",
|
||||
"eslint:recommended",
|
||||
"plugin:react/recommended",
|
||||
"plugin:react-hooks/recommended",
|
||||
"plugin:prettier/recommended",
|
||||
"plugin:@typescript-eslint/eslint-recommended",
|
||||
"plugin:@typescript-eslint/recommended",
|
||||
"next/core-web-vitals",
|
||||
],
|
||||
parserOptions: {
|
||||
ecmaFeatures: {
|
||||
jsx: true,
|
||||
},
|
||||
ecmaVersion: 12,
|
||||
sourceType: "module",
|
||||
},
|
||||
plugins: ["react"],
|
||||
rules: {
|
||||
// Possible errors
|
||||
"no-console": "warn",
|
||||
// Best practices
|
||||
"dot-notation": "error",
|
||||
"no-else-return": "error",
|
||||
"no-floating-decimal": "error",
|
||||
"no-sequences": "error",
|
||||
// Stylistic
|
||||
"array-bracket-spacing": "error",
|
||||
"computed-property-spacing": ["error", "never"],
|
||||
curly: "error",
|
||||
"no-lonely-if": "error",
|
||||
"no-unneeded-ternary": "error",
|
||||
"one-var-declaration-per-line": "error",
|
||||
quotes: [
|
||||
"error",
|
||||
"single",
|
||||
{
|
||||
allowTemplateLiterals: false,
|
||||
avoidEscape: true,
|
||||
},
|
||||
],
|
||||
// ES6
|
||||
"array-callback-return": "off",
|
||||
"prefer-const": "error",
|
||||
// Imports
|
||||
"import/prefer-default-export": "off",
|
||||
"sort-imports": [
|
||||
"error",
|
||||
{
|
||||
ignoreCase: true,
|
||||
ignoreDeclarationSort: true,
|
||||
},
|
||||
],
|
||||
"no-unused-expressions": "off",
|
||||
"no-prototype-builtins": "off",
|
||||
// REACT
|
||||
"react/jsx-uses-react": "off",
|
||||
"react/react-in-jsx-scope": "off",
|
||||
"jsx-a11y/href-no-hash": [0],
|
||||
"react/display-name": 0,
|
||||
"react/no-deprecated": "error",
|
||||
"react/no-unsafe": [
|
||||
"error",
|
||||
{
|
||||
checkAliases: true,
|
||||
},
|
||||
],
|
||||
"react/jsx-sort-props": [
|
||||
"error",
|
||||
{
|
||||
ignoreCase: true,
|
||||
},
|
||||
],
|
||||
"react-hooks/rules-of-hooks": "error",
|
||||
"react-hooks/exhaustive-deps": 0,
|
||||
// Prettier
|
||||
// eslint looks for the prettier config at the top level of the package/app
|
||||
// but the config lives in the `config/` directory. Passing the config here
|
||||
// to get around this.
|
||||
"prettier/prettier": ["error", prettierConfig],
|
||||
},
|
||||
settings: {
|
||||
react: {
|
||||
version: "detect",
|
||||
},
|
||||
},
|
||||
};
|
||||
@@ -1,3 +0,0 @@
|
||||
{
|
||||
"extends": "next/core-web-vitals"
|
||||
}
|
||||
@@ -7,7 +7,7 @@
|
||||
"dev": "node ./server.js",
|
||||
"debug": "node ./server.js",
|
||||
"dev-nossl": "next dev",
|
||||
"build": "next build",
|
||||
"build": "next build && next export",
|
||||
"start": "next start",
|
||||
"lint": "next lint"
|
||||
},
|
||||
@@ -17,17 +17,18 @@
|
||||
"@next/font": "13.2.0",
|
||||
"@prisma/client": "^4.9.0",
|
||||
"@types/feather-icons": "^4.29.1",
|
||||
"@types/logrocket-react": "^3.0.0",
|
||||
"@types/node": "18.14.2",
|
||||
"@types/react": "18.0.28",
|
||||
"@types/react-dom": "18.0.11",
|
||||
"@upstash/qstash": "^0.3.6",
|
||||
"axios": "^1.3.4",
|
||||
"babel": "^6.23.0",
|
||||
"classnames": "^2.3.2",
|
||||
"daisyui": "^2.49.0",
|
||||
"encoding": "^0.1.13",
|
||||
"eslint": "8.35.0",
|
||||
"eslint-config-next": "13.2.3",
|
||||
"eslint-plugin-react-hooks": "^4.6.0",
|
||||
"feather-icons": "^4.29.0",
|
||||
"firebase": "^9.17.1",
|
||||
"firebase-admin": "^11.5.0",
|
||||
@@ -36,7 +37,6 @@
|
||||
"http-status-codes": "^2.2.0",
|
||||
"localforage": "^1.10.0",
|
||||
"logrocket": "^3.0.1",
|
||||
"logrocket-react": "^5.0.1",
|
||||
"next": "13.2.3",
|
||||
"next-logger": "^3.0.1",
|
||||
"next-seo": "^5.15.0",
|
||||
@@ -61,9 +61,10 @@
|
||||
"@google-cloud/local-auth": "2.1.1",
|
||||
"@hookform/devtools": "^4.3.0",
|
||||
"autoprefixer": "^10.4.13",
|
||||
"eslint-config-prettier": "^8.6.0",
|
||||
"googleapis": "111.0.0",
|
||||
"postcss": "^8.4.21",
|
||||
"prettier": "^2.8.3",
|
||||
"prettier": "^2.8.4",
|
||||
"prettier-plugin-tailwindcss": "^0.2.2",
|
||||
"prisma": "^4.9.0",
|
||||
"tailwindcss": "^3.2.4"
|
||||
|
||||
@@ -7,14 +7,12 @@ import { NavBar, PushNotificationWrapper } from "@/components/layout";
|
||||
import { AuthUserProvider } from "@/lib/auth/authUserContext";
|
||||
import { themeChange } from "theme-change";
|
||||
import Script from "next/script";
|
||||
import logger from "@/lib/util/logging";
|
||||
import { Toaster } from "react-hot-toast";
|
||||
import { LoggingProvider, ThemeProvider } from "@/components/providers";
|
||||
const LogRocket = require("logrocket");
|
||||
const setupLogRocketReact = require("logrocket-react");
|
||||
import useLogRocket from "@/lib/util/logging/logRocket";
|
||||
import logger from "@/lib/util/logging";
|
||||
import FirestoreProvider from "@/components/providers/FirebaseProvider";
|
||||
|
||||
// only initialize when in the browser
|
||||
|
||||
const font = Raleway({
|
||||
weight: ["400", "700"],
|
||||
subsets: ["latin"],
|
||||
@@ -25,17 +23,16 @@ const RootLayout = ({ children }: React.PropsWithChildren) => {
|
||||
React.useEffect(() => {
|
||||
logger.info("Bootstrapping application");
|
||||
themeChange(false);
|
||||
}, []);
|
||||
}, [logger]);
|
||||
|
||||
return (
|
||||
<html lang="en">
|
||||
<head>
|
||||
<Script src="/theme.js" />
|
||||
</head>
|
||||
<LoggingProvider>
|
||||
<body className={`${font.className}`}>
|
||||
<ThemeProvider>
|
||||
<Toaster />
|
||||
<FirestoreProvider>
|
||||
<AuthUserProvider>
|
||||
<PushNotificationWrapper>
|
||||
<div className="flex flex-col min-h-screen bg-base-100">
|
||||
@@ -46,9 +43,8 @@ const RootLayout = ({ children }: React.PropsWithChildren) => {
|
||||
</div>
|
||||
</PushNotificationWrapper>
|
||||
</AuthUserProvider>
|
||||
</ThemeProvider>
|
||||
</FirestoreProvider>
|
||||
</body>
|
||||
</LoggingProvider>
|
||||
</html>
|
||||
);
|
||||
};
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import React from "react";
|
||||
import { useState } from "react";
|
||||
const LogRocket = require("logrocket");
|
||||
const setupLogRocketReact = require("logrocket-react");
|
||||
import packageJson from "../../package.json";
|
||||
|
||||
const Loading = () => {
|
||||
@@ -26,7 +25,6 @@ const Loading = () => {
|
||||
},
|
||||
},
|
||||
});
|
||||
setupLogRocketReact(LogRocket);
|
||||
}
|
||||
|
||||
return (
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
import React from "react";
|
||||
import HomePageComponent from "@/components/pages/home";
|
||||
import LogRocket from "logrocket";
|
||||
import setupLogRocketReact from "logrocket-react";
|
||||
|
||||
export const metadata = {
|
||||
title: "Radio Otherway",
|
||||
|
||||
@@ -104,7 +104,15 @@ const ProfilePageComponentProfile = ({
|
||||
subHeading="Upload a wide photo for the top of your profile page"
|
||||
/>
|
||||
<div className="mt-1 sm:col-span-2 sm:mt-0">
|
||||
|
||||
<FirebaseImageUpload
|
||||
forType="user"
|
||||
imageType="profile"
|
||||
itemId={profile.id}
|
||||
imageUrl={profile.headerPhotoURL}
|
||||
controlName="headerPhotoURL"
|
||||
setValue={setValue}
|
||||
{...register("headerPhotoURL")}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
53
src/components/providers/FirebaseProvider.tsx
Normal file
53
src/components/providers/FirebaseProvider.tsx
Normal file
@@ -0,0 +1,53 @@
|
||||
import { FirestoreProvider, useFirebaseApp } from "reactfire";
|
||||
import { useMemo } from "react";
|
||||
|
||||
import {
|
||||
enableIndexedDbPersistence,
|
||||
connectFirestoreEmulator,
|
||||
initializeFirestore,
|
||||
} from "firebase/firestore";
|
||||
|
||||
import { isBrowser } from "~/core/generic";
|
||||
|
||||
export default function FirestoreProvider({
|
||||
children,
|
||||
useEmulator,
|
||||
}: React.PropsWithChildren<{ useEmulator?: boolean }>) {
|
||||
const firestore = useFirestore();
|
||||
|
||||
// connect to emulator if enabled
|
||||
if (useEmulator) {
|
||||
const host = getFirestoreHost();
|
||||
const port = Number(getFirestorePort());
|
||||
|
||||
try {
|
||||
connectFirestoreEmulator(firestore, host, port);
|
||||
} catch (e) {
|
||||
// this may happen on re-renderings
|
||||
}
|
||||
}
|
||||
|
||||
const enablePersistence = isBrowser();
|
||||
|
||||
// We enable offline capabilities by caching Firestore in IndexedDB
|
||||
// NB: if you don't want to cache results, please remove the next few lines
|
||||
if (enablePersistence) {
|
||||
enableIndexedDbPersistence(firestore);
|
||||
}
|
||||
|
||||
return <FirestoreProvider sdk={firestore}>{children}</FirestoreProvider>;
|
||||
}
|
||||
|
||||
function getFirestoreHost() {
|
||||
return process.env.NEXT_PUBLIC_FIREBASE_EMULATOR_HOST ?? "localhost";
|
||||
}
|
||||
|
||||
function getFirestorePort() {
|
||||
return process.env.NEXT_PUBLIC_FIRESTORE_EMULATOR_PORT ?? 8080;
|
||||
}
|
||||
|
||||
function useFirestore() {
|
||||
const app = useFirebaseApp();
|
||||
|
||||
return useMemo(() => initializeFirestore(app, {}), [app]);
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
import React from "react";
|
||||
|
||||
const LoggingProvider = ({ children }: React.PropsWithChildren) => {
|
||||
return <>{children}</>;
|
||||
};
|
||||
|
||||
export default LoggingProvider;
|
||||
@@ -1,3 +1,2 @@
|
||||
import LoggingProvider from "./LoggingProvider";
|
||||
import ThemeProvider from "./ThemeProvider";
|
||||
export { LoggingProvider, ThemeProvider };
|
||||
export { ThemeProvider };
|
||||
|
||||
@@ -191,7 +191,40 @@ const FirebaseImageUploader = forwardRef<
|
||||
)}
|
||||
</div>
|
||||
) : (
|
||||
<div>Hello</div>
|
||||
<div className="flex justify-center max-w-lg px-6 pt-5 pb-6 border-2 border-dashed rounded-md">
|
||||
<div className="space-y-1 text-center">
|
||||
<svg
|
||||
className="w-12 h-12 mx-auto "
|
||||
stroke="currentColor"
|
||||
fill="none"
|
||||
viewBox="0 0 48 48"
|
||||
aria-hidden="true"
|
||||
>
|
||||
<path
|
||||
d="M28 8H12a4 4 0 00-4 4v20m32-12v8m0 0v8a4 4 0 01-4 4H12a4 4 0 01-4-4v-4m32-4l-3.172-3.172a4 4 0 00-5.656 0L28 28M8 32l9.172-9.172a4 4 0 015.656 0L28 28m0 0l4 4m4-24h8m-4-4v8m-12 4h.02"
|
||||
strokeWidth={2}
|
||||
strokeLinecap="round"
|
||||
strokeLinejoin="round"
|
||||
/>
|
||||
</svg>
|
||||
<div className="flex text-sm ">
|
||||
<label
|
||||
htmlFor="file-upload"
|
||||
className="relative font-medium rounded-md cursor-pointer te focus-within:outline-none focus-within:ring-2 focus-within:ring-offset-2"
|
||||
>
|
||||
<span>Upload a file</span>
|
||||
<input
|
||||
id="file-upload"
|
||||
name="file-upload"
|
||||
type="file"
|
||||
className="sr-only"
|
||||
/>
|
||||
</label>
|
||||
<p className="pl-1">or drag and drop</p>
|
||||
</div>
|
||||
<p className="text-xs ">PNG, JPG, GIF up to 10MB</p>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
);
|
||||
|
||||
@@ -7,6 +7,6 @@ const firebaseConfig = {
|
||||
storageBucket: "radio-otherway.appspot.com",
|
||||
messagingSenderId: "47147490249",
|
||||
appId: "1:47147490249:web:a84515b3ce1c481826e618",
|
||||
measurementId: "G-12YB78EZM4"
|
||||
measurementId: "G-12YB78EZM4",
|
||||
};
|
||||
export const app = initializeApp(firebaseConfig);
|
||||
|
||||
1
src/lib/core/generic/index.ts
Normal file
1
src/lib/core/generic/index.ts
Normal file
@@ -0,0 +1 @@
|
||||
export const isServer = typeof window === "undefined" ? false : true;
|
||||
7
src/lib/db/collections.ts
Normal file
7
src/lib/db/collections.ts
Normal file
@@ -0,0 +1,7 @@
|
||||
import {
|
||||
CollectionReference,
|
||||
collection,
|
||||
DocumentData,
|
||||
} from "firebase/firestore";
|
||||
import { firestore } from "../auth/firebase";
|
||||
|
||||
35
src/lib/db/converters.ts
Normal file
35
src/lib/db/converters.ts
Normal file
@@ -0,0 +1,35 @@
|
||||
import { NotificationSchedule, Show } from "@/models";
|
||||
import { DocumentData, QueryDocumentSnapshot, SnapshotOptions, Timestamp, WithFieldValue } from "firebase/firestore";
|
||||
|
||||
const showConverter = {
|
||||
toFirestore(show: WithFieldValue<Show>): DocumentData {
|
||||
return {
|
||||
...show,
|
||||
date: show.date
|
||||
? Timestamp.fromDate(new Date(show.date as string))
|
||||
: new Date(),
|
||||
};
|
||||
},
|
||||
fromFirestore(
|
||||
snapshot: QueryDocumentSnapshot,
|
||||
options: SnapshotOptions
|
||||
): Show {
|
||||
const data = snapshot.data(options)!;
|
||||
return new Show(snapshot.id, data.title, data.date.toDate(), data.creator);
|
||||
},
|
||||
};
|
||||
const noticeConverter = {
|
||||
toFirestore(notice: WithFieldValue<NotificationSchedule>): DocumentData {
|
||||
return notice;
|
||||
},
|
||||
fromFirestore(
|
||||
snapshot: QueryDocumentSnapshot,
|
||||
options: SnapshotOptions
|
||||
): NotificationSchedule {
|
||||
const data = snapshot.data(options)!;
|
||||
return new NotificationSchedule(
|
||||
data.scheduleTimes.map((r: any) => r.toDate())
|
||||
);
|
||||
},
|
||||
};
|
||||
export { showConverter, noticeConverter };
|
||||
18
src/lib/db/hooks/useGetUserProfile.tsx
Normal file
18
src/lib/db/hooks/useGetUserProfile.tsx
Normal file
@@ -0,0 +1,18 @@
|
||||
import { useFirestore, useFirestoreDocData } from "reactfire";
|
||||
import { doc, DocumentReference } from "firebase/firestore";
|
||||
import { Organization } from "~/lib/organizations/types/organization";
|
||||
|
||||
type Response = Organization & { id: string };
|
||||
|
||||
export function useFetchOrganization(organizationId: string) {
|
||||
const firestore = useFirestore();
|
||||
const organizationsPath = `/organizations`;
|
||||
|
||||
const ref = doc(
|
||||
firestore,
|
||||
organizationsPath,
|
||||
organizationId
|
||||
) as DocumentReference<Response>;
|
||||
|
||||
return useFirestoreDocData(ref, { idField: "id" });
|
||||
}
|
||||
@@ -21,45 +21,10 @@ const firebaseConfig = {
|
||||
measurementId: "G-12YB78EZM4",
|
||||
};
|
||||
export const firebaseApp = initializeApp(firebaseConfig);
|
||||
initializeFirestore(firebaseApp, {
|
||||
ignoreUndefinedProperties: true,
|
||||
});
|
||||
const firestore = getFirestore();
|
||||
|
||||
const createCollection = <T = DocumentData>(collectionName: string) => {
|
||||
return collection(firestore, collectionName) as CollectionReference<T>;
|
||||
};
|
||||
const showConverter = {
|
||||
toFirestore(show: WithFieldValue<Show>): DocumentData {
|
||||
return {
|
||||
...show,
|
||||
date: show.date
|
||||
? Timestamp.fromDate(new Date(show.date as string))
|
||||
: new Date(),
|
||||
};
|
||||
},
|
||||
fromFirestore(
|
||||
snapshot: QueryDocumentSnapshot,
|
||||
options: SnapshotOptions
|
||||
): Show {
|
||||
const data = snapshot.data(options)!;
|
||||
return new Show(snapshot.id, data.title, data.date.toDate(), data.creator);
|
||||
},
|
||||
};
|
||||
const noticeConverter = {
|
||||
toFirestore(notice: WithFieldValue<NotificationSchedule>): DocumentData {
|
||||
return notice;
|
||||
},
|
||||
fromFirestore(
|
||||
snapshot: QueryDocumentSnapshot,
|
||||
options: SnapshotOptions
|
||||
): NotificationSchedule {
|
||||
const data = snapshot.data(options)!;
|
||||
return new NotificationSchedule(
|
||||
data.scheduleTimes.map((r: any) => r.toDate())
|
||||
);
|
||||
},
|
||||
};
|
||||
|
||||
// Import all your model types
|
||||
import {
|
||||
Show,
|
||||
@@ -68,12 +33,15 @@ import {
|
||||
Profile,
|
||||
NotificationSchedule,
|
||||
} from "@/models";
|
||||
import { storage } from "./firebaseConfig";
|
||||
import { storage } from "../firebase";
|
||||
import { noticeConverter, showConverter } from "./converters";
|
||||
import { firestore } from "../auth/firebase";
|
||||
// export all your collections
|
||||
|
||||
export const users = createCollection<Profile>("users");
|
||||
export const shows =
|
||||
createCollection<Show>("shows").withConverter(showConverter);
|
||||
|
||||
export const notificationSchedules =
|
||||
createCollection<NotificationSchedule>("noticeSchedules").withConverter(
|
||||
noticeConverter
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import firebase, { getApp, getApps, initializeApp } from "firebase/app";
|
||||
import { getStorage } from "firebase/storage";
|
||||
import "firebase/auth";
|
||||
import { getFirestore } from "firebase/firestore";
|
||||
|
||||
const firebaseConfig = {
|
||||
apiKey: "AIzaSyDtk_Ym-AZroXsHvQVcdHXYyc_TvgycAWw",
|
||||
@@ -15,3 +16,4 @@ const firebaseConfig = {
|
||||
// export default admin.firestore();
|
||||
export const app = initializeApp(firebaseConfig);
|
||||
export const storage = getStorage(app);
|
||||
export const db = getFirestore();
|
||||
@@ -1,3 +1,4 @@
|
||||
import { firebaseLogging } from "./logRocket";
|
||||
const logger = (() => {
|
||||
const checkIfLogsEnabled = () => {
|
||||
if (process.browser) {
|
||||
|
||||
12
src/lib/util/logging/logRocket.tsx
Normal file
12
src/lib/util/logging/logRocket.tsx
Normal file
@@ -0,0 +1,12 @@
|
||||
import LogRocket from "logrocket";
|
||||
|
||||
const useLogRocket = () => {
|
||||
const logrocketId = process.env.NEXT_PUBLIC_LOGROCKET_ID || "";
|
||||
|
||||
setTimeout(() => {
|
||||
LogRocket.init(logrocketId);
|
||||
}, 100);
|
||||
return null;
|
||||
};
|
||||
|
||||
export default useLogRocket;
|
||||
@@ -1,89 +0,0 @@
|
||||
import LogRocket from "logrocket";
|
||||
import * as React from "react";
|
||||
|
||||
export const logRocketIdentify = (id: string, options?: any) => {
|
||||
console.debug(`log rocket identify ${id}`);
|
||||
if (id) {
|
||||
LogRocket.identify(id, {
|
||||
...(!!options && options),
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
type LogRocket = {
|
||||
LogRocket: any;
|
||||
initialized: boolean;
|
||||
setEnabled: (enabled: boolean) => void;
|
||||
};
|
||||
|
||||
export const LogRocketContext = React.createContext<LogRocket>({
|
||||
LogRocket,
|
||||
initialized: false,
|
||||
setEnabled: (enabled: boolean) => {},
|
||||
});
|
||||
|
||||
export const LogRocketProvider: React.FunctionComponent = ({
|
||||
children,
|
||||
}: React.PropsWithChildren) => {
|
||||
const [initialized, setInitialized] = React.useState(false);
|
||||
const [enabled, setEnabled] = React.useState(true);
|
||||
if (typeof window !== "undefined") {
|
||||
LogRocket.init("qfpqoi/radio-otherway", {
|
||||
console: {
|
||||
isEnabled: false,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
const identifyViewer = React.useCallback(
|
||||
(viewer: Viewer) => {
|
||||
if (!viewer) return;
|
||||
|
||||
if (!initialized) {
|
||||
initialize();
|
||||
}
|
||||
if (enabled && initialized) {
|
||||
const { contact_id, ...rest } = viewer;
|
||||
logRocketIdentify(contact_id, {
|
||||
...rest,
|
||||
});
|
||||
setIdentified(viewer);
|
||||
}
|
||||
},
|
||||
[enabled, initialized, initialize]
|
||||
);
|
||||
|
||||
React.useEffect(() => {
|
||||
identifyViewer(viewer);
|
||||
}, [identified, initialized, viewer]);
|
||||
|
||||
React.useEffect(() => {
|
||||
if (!initialized) {
|
||||
initialize();
|
||||
}
|
||||
}, [initialized, initialize]);
|
||||
|
||||
return (
|
||||
<LogRocketContext.Provider
|
||||
value={{
|
||||
LogRocket,
|
||||
identified,
|
||||
identifyViewer,
|
||||
initialized,
|
||||
setEnabled,
|
||||
}}
|
||||
>
|
||||
{children}
|
||||
</LogRocketContext.Provider>
|
||||
);
|
||||
};
|
||||
|
||||
export default function useLogRocket({ viewer }: { viewer: any }) {
|
||||
const logRocketContext = React.useContext(LogRocketContext);
|
||||
|
||||
if (viewer) {
|
||||
logRocketContext.identifyViewer(viewer);
|
||||
}
|
||||
|
||||
return logRocketContext;
|
||||
}
|
||||
@@ -2,6 +2,7 @@ import Profile from "./profile";
|
||||
import Show from "./show";
|
||||
import Reminder from "./reminder";
|
||||
import Notification from "./notification";
|
||||
import Viewer from "./viewer";
|
||||
import DeviceRegistration from "./deviceregistration";
|
||||
import type { RemindersProcessed } from "./processes";
|
||||
import NotificationSchedule from "./notificationSchedule";
|
||||
@@ -11,7 +12,8 @@ export {
|
||||
Show,
|
||||
Reminder,
|
||||
Notification,
|
||||
type Viewer,
|
||||
DeviceRegistration,
|
||||
NotificationSchedule,
|
||||
RemindersProcessed
|
||||
RemindersProcessed,
|
||||
};
|
||||
|
||||
5
src/models/viewer.ts
Normal file
5
src/models/viewer.ts
Normal file
@@ -0,0 +1,5 @@
|
||||
export type Viewer = {
|
||||
contact_id: string;
|
||||
email: string;
|
||||
name: string;
|
||||
};
|
||||
50
yarn.lock
50
yarn.lock
@@ -1032,13 +1032,6 @@
|
||||
resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.14.191.tgz#09511e7f7cba275acd8b419ddac8da9a6a79e2fa"
|
||||
integrity sha512-BdZ5BCCvho3EIXw6wUCXHe7rS53AIDPLE+JzwgT+OsJk53oBfbSmZZ7CX4VaRoN78N+TJpFi9QPlfIVNmJYWxQ==
|
||||
|
||||
"@types/logrocket-react@^3.0.0":
|
||||
version "3.0.0"
|
||||
resolved "https://registry.yarnpkg.com/@types/logrocket-react/-/logrocket-react-3.0.0.tgz#88278ec2fe093ff55496d66aea9056fe1061ecea"
|
||||
integrity sha512-bQ7LUwqwt2RNpRoco3vt8QBHy78nOQFF+KfFRol1PgKq8S1nIiLYA6Y0ZUAzqGw1viA0lyjAHlPQeTI+wl4wnw==
|
||||
dependencies:
|
||||
logrocket "1.0.1"
|
||||
|
||||
"@types/long@^4.0.0", "@types/long@^4.0.1":
|
||||
version "4.0.2"
|
||||
resolved "https://registry.yarnpkg.com/@types/long/-/long-4.0.2.tgz#b74129719fc8d11c01868010082d483b7545591a"
|
||||
@@ -1067,7 +1060,12 @@
|
||||
resolved "https://registry.yarnpkg.com/@types/minimatch/-/minimatch-5.1.2.tgz#07508b45797cb81ec3f273011b054cd0755eddca"
|
||||
integrity sha512-K0VQKziLUWkVKiRVrx4a40iPaxTUefQmjtkQofBkYRcoaaL/8rhwDWww9qWbrgicNOgnpIsMxyNIUM4+n6dUIA==
|
||||
|
||||
"@types/node@*", "@types/node@18.14.2", "@types/node@>=12.12.47", "@types/node@>=13.7.0":
|
||||
"@types/node@*", "@types/node@>=12.12.47", "@types/node@>=13.7.0":
|
||||
version "18.14.3"
|
||||
resolved "https://registry.yarnpkg.com/@types/node/-/node-18.14.3.tgz#485070908df2e7b476ecaf83108e50b4d925a153"
|
||||
integrity sha512-1y36CC5iL5CMyKALzwX9cwwxcWIxvIBe3gzs4GrXWXEQ8klQnCZ2U/WDGiNrXHmQcUhnaun17XG9TEIDlGj2RA==
|
||||
|
||||
"@types/node@18.14.2":
|
||||
version "18.14.2"
|
||||
resolved "https://registry.yarnpkg.com/@types/node/-/node-18.14.2.tgz#c076ed1d7b6095078ad3cf21dfeea951842778b1"
|
||||
integrity sha512-1uEQxww3DaghA0RxqHx0O0ppVlo43pJhepY51OxuQIKHpjbnYLA7vcdwioNPzIqmC2u3I/dmylcqjlh0e7AyUA==
|
||||
@@ -1431,6 +1429,11 @@ babel-plugin-macros@^3.1.0:
|
||||
cosmiconfig "^7.0.0"
|
||||
resolve "^1.19.0"
|
||||
|
||||
babel@^6.23.0:
|
||||
version "6.23.0"
|
||||
resolved "https://registry.yarnpkg.com/babel/-/babel-6.23.0.tgz#d0d1e7d803e974765beea3232d4e153c0efb90f4"
|
||||
integrity sha512-ZDcCaI8Vlct8PJ3DvmyqUz+5X2Ylz3ZuuItBe/74yXosk2dwyVo/aN7MCJ8HJzhnnJ+6yP4o+lDgG9MBe91DLA==
|
||||
|
||||
balanced-match@^1.0.0:
|
||||
version "1.0.2"
|
||||
resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.2.tgz#e83e3a7e3f300b34cb9d87f615fa0cbf357690ee"
|
||||
@@ -2108,6 +2111,11 @@ eslint-config-next@13.2.3:
|
||||
eslint-plugin-react "^7.31.7"
|
||||
eslint-plugin-react-hooks "^4.5.0"
|
||||
|
||||
eslint-config-prettier@^8.6.0:
|
||||
version "8.6.0"
|
||||
resolved "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-8.6.0.tgz#dec1d29ab728f4fa63061774e1672ac4e363d207"
|
||||
integrity sha512-bAF0eLpLVqP5oEVUFKpMA+NnRFICwn9X8B5jrR9FcqnYBuPbqWEjTEspPWMj5ye6czoSLDweCzSo3Ko7gGrZaA==
|
||||
|
||||
eslint-import-resolver-node@^0.3.6, eslint-import-resolver-node@^0.3.7:
|
||||
version "0.3.7"
|
||||
resolved "https://registry.yarnpkg.com/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.7.tgz#83b375187d412324a1963d84fa664377a23eb4d7"
|
||||
@@ -2180,7 +2188,7 @@ eslint-plugin-jsx-a11y@^6.5.1:
|
||||
object.fromentries "^2.0.6"
|
||||
semver "^6.3.0"
|
||||
|
||||
eslint-plugin-react-hooks@^4.5.0:
|
||||
eslint-plugin-react-hooks@^4.5.0, eslint-plugin-react-hooks@^4.6.0:
|
||||
version "4.6.0"
|
||||
resolved "https://registry.yarnpkg.com/eslint-plugin-react-hooks/-/eslint-plugin-react-hooks-4.6.0.tgz#4c3e697ad95b77e93f8646aaa1630c1ba607edd3"
|
||||
integrity sha512-oFc7Itz9Qxh2x4gNHStv3BqJq54ExXmfC+a1NjAta66IAN87Wu0R/QArgIS9qKzX3dXKPI9H5crl9QchNMY9+g==
|
||||
@@ -2292,9 +2300,9 @@ esprima@^4.0.1:
|
||||
integrity sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==
|
||||
|
||||
esquery@^1.4.2:
|
||||
version "1.4.2"
|
||||
resolved "https://registry.yarnpkg.com/esquery/-/esquery-1.4.2.tgz#c6d3fee05dd665808e2ad870631f221f5617b1d1"
|
||||
integrity sha512-JVSoLdTlTDkmjFmab7H/9SL9qGSyjElT3myyKp7krqjVFQCDLmj1QFaCLRFBszBKI0XVZaiiXvuPIX3ZwHe1Ng==
|
||||
version "1.5.0"
|
||||
resolved "https://registry.yarnpkg.com/esquery/-/esquery-1.5.0.tgz#6ce17738de8577694edd7361c57182ac8cb0db0b"
|
||||
integrity sha512-YQLXUplAwJgCydQ78IMJywZCceoqk1oH01OERdSAJc/7U2AylwjhSCLDEtqwg811idIS/9fIU5GjG73IgjKMVg==
|
||||
dependencies:
|
||||
estraverse "^5.1.0"
|
||||
|
||||
@@ -3516,16 +3524,6 @@ lodash@^4.17.15, lodash@^4.17.21:
|
||||
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c"
|
||||
integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==
|
||||
|
||||
logrocket-react@^5.0.1:
|
||||
version "5.0.1"
|
||||
resolved "https://registry.yarnpkg.com/logrocket-react/-/logrocket-react-5.0.1.tgz#f71a1cfa539bafe581576a7a6b92dfc6104c5a7b"
|
||||
integrity sha512-d5RAi1giur9Yv7/lDK/c2S1hviopN5K1XMMpfpSFRDG3Rr/j5RmGuvNHdXNTJUwGuxTVrpnKUOB43ceQMJfO1Q==
|
||||
|
||||
logrocket@1.0.1:
|
||||
version "1.0.1"
|
||||
resolved "https://registry.yarnpkg.com/logrocket/-/logrocket-1.0.1.tgz#0555ec619d2db54a7b345c4e8df09baea835b176"
|
||||
integrity sha512-oPA0c5GzMKsWp/6p19OaujZQMzttluqVOI+989uHeciPAljPZvGEpZRbNO3Rr+jC/8jVLJdlMP9IHuyhKsASGA==
|
||||
|
||||
logrocket@^3.0.1:
|
||||
version "3.0.1"
|
||||
resolved "https://registry.yarnpkg.com/logrocket/-/logrocket-3.0.1.tgz#c746e8df3d5fee999b152975e51db1908357a6f0"
|
||||
@@ -4106,7 +4104,7 @@ prettier-plugin-tailwindcss@^0.2.2:
|
||||
resolved "https://registry.yarnpkg.com/prettier-plugin-tailwindcss/-/prettier-plugin-tailwindcss-0.2.3.tgz#b68a1de10056fc84055426af132c2697bea0955c"
|
||||
integrity sha512-s2N5Dh7Ao5KTV1mao5ZBnn8EKtUcDPJEkGViZIjI0Ij9TTI5zgTz4IHOxW33jOdjHKa8CSjM88scelUiC5TNRQ==
|
||||
|
||||
prettier@^2.8.3:
|
||||
prettier@^2.8.4:
|
||||
version "2.8.4"
|
||||
resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.8.4.tgz#34dd2595629bfbb79d344ac4a91ff948694463c3"
|
||||
integrity sha512-vIS4Rlc2FNh0BySk3Wkd6xmwxB0FpOndW5fisM5H8hsZSxU2VWVB5CWIkIjWvrHjIhxk2g3bfMKM87zNTrZddw==
|
||||
@@ -4813,9 +4811,9 @@ text-table@^0.2.0:
|
||||
integrity sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==
|
||||
|
||||
theme-change@^2.3.0:
|
||||
version "2.3.0"
|
||||
resolved "https://registry.yarnpkg.com/theme-change/-/theme-change-2.3.0.tgz#9fec33d44c514253a0b0e9a65df4bcfa8bf9f741"
|
||||
integrity sha512-MOv3g4dQfte9Q7WZKyLRshcw9JqcJCwB+CO1OS7lN1WMJcQyPzmpgwm5Ve55vQ4qt62g++A9+8s1x+vRPpm42w==
|
||||
version "2.4.0"
|
||||
resolved "https://registry.yarnpkg.com/theme-change/-/theme-change-2.4.0.tgz#db9e7fded16a2fcd5555e19fa3755ef9ff4996da"
|
||||
integrity sha512-HbMckoxM7sV8L7wk53S5ceiBQWcTxFozuvUmvjdjPqpyVFkzPQHylSsDHYyT8qTruORe+1Sft7ExqlXQEeWHBA==
|
||||
|
||||
thread-stream@^0.15.1:
|
||||
version "0.15.2"
|
||||
|
||||
Reference in New Issue
Block a user