= ({ onCloseHandler }) => {
Last Updated: 5/16/23
diff --git a/lib/backend/models/presentation.ts b/lib/backend/models/presentation.ts
index a69ab6f..914e2dc 100644
--- a/lib/backend/models/presentation.ts
+++ b/lib/backend/models/presentation.ts
@@ -4,6 +4,7 @@ interface iPresentation {
subtitle: string
slideCount: number
id: string
+ date: Date
thumbnail: {
contentUrl?: string
height?: number
diff --git a/lib/backend/schemas/user.ts b/lib/backend/schemas/user.ts
index 1b5d35e..897629f 100644
--- a/lib/backend/schemas/user.ts
+++ b/lib/backend/schemas/user.ts
@@ -17,6 +17,7 @@ const schema = {
subtitle: String,
slideCount: Number,
id: String,
+ date: Date,
thumbnail: {
contentUrl: String,
height: Number,
diff --git a/lib/backend/util/createPresentation.ts b/lib/backend/util/createPresentation.ts
index 9879713..a16e9bd 100644
--- a/lib/backend/util/createPresentation.ts
+++ b/lib/backend/util/createPresentation.ts
@@ -194,6 +194,7 @@ async function createPresentation(
title,
subtitle,
slideCount: parameters.slideCount,
+ date: new Date(),
thumbnail: response.data,
}
} catch (err) {
diff --git a/lib/frontend/models/presentation.ts b/lib/frontend/models/presentation.ts
index 4c26659..5c7f412 100644
--- a/lib/frontend/models/presentation.ts
+++ b/lib/frontend/models/presentation.ts
@@ -2,6 +2,8 @@ interface iPresentation {
presentationId: string
title: string
subtitle: string
+ slideCount: number
+ date?: Date
thumbnail: {
contentUrl: string
height: number
diff --git a/pages/app.tsx b/pages/app.tsx
index a2bfbbe..6eb4073 100644
--- a/pages/app.tsx
+++ b/pages/app.tsx
@@ -100,7 +100,7 @@ const App: FC = () => {
const { user, setUser } = useStore()
- const { theme, setTheme } = useTheme()
+ const { theme, resolvedTheme, setTheme } = useTheme()
const [mounted, setMounted] = useState(false)
const [state, setState] = useState({
@@ -632,9 +632,7 @@ const App: FC = () => {
: 20
: 0,
}}
- className={`top-right-container ${
- !user && "shadow"
- }`}
+ className={`top-right-container`}
>
{state.profileLoading ? (
@@ -709,7 +707,7 @@ const App: FC = () => {
- {width <= 2000 ? (
+ {width <= 2000 && mounted ? (
{
.innerHTML as Category,
})
}
+ style={{
+ color:
+ resolvedTheme ===
+ "light"
+ ? "black"
+ : "white",
+ }}
>
{category}
diff --git a/pages/index.tsx b/pages/index.tsx
index 1110f5e..813ead2 100644
--- a/pages/index.tsx
+++ b/pages/index.tsx
@@ -13,7 +13,7 @@ const Home: FC = () => {
-
About
+ About
{features.map((feature, index) => {
return (
diff --git a/pages/presentations.tsx b/pages/presentations.tsx
index 884a756..de39a5d 100644
--- a/pages/presentations.tsx
+++ b/pages/presentations.tsx
@@ -2,6 +2,7 @@ import React, { useEffect, useState } from "react"
import { Col, Container, Image, Row } from "react-bootstrap"
import iPresentation from "../lib/frontend/models/presentation"
import BackArrow from "../components/BackArrow"
+import Presentation from "../components/Presentation"
import api from "../lib/frontend/axios"
import iError from "../lib/frontend/models/error"
@@ -11,28 +12,14 @@ import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"
import { faWarning } from "@fortawesome/free-solid-svg-icons"
import Button from "../components/Button"
import { useRouter } from "next/router"
-import { useSpring, animated } from "react-spring"
+import PresentationModal from "../components/PresentationModal"
interface iState {
loading: boolean
- presentations: iPresentation[]
error: iError | null
-}
-
-const trans = (x, y, s) =>
- `perspective(600px) rotateX(${x}deg) rotateY(${y}deg) scale(${s})`
-
-const calc = (x, y) => {
- if (typeof window !== "undefined") {
- const BUFFER = 50
-
- const why = -(y - window.innerHeight / 2) / BUFFER
- const ex = (x - window.innerWidth / 2) / BUFFER
-
- console.log("why", why)
- console.log("y", y)
- return [-(y / 50), x / 50, 1.1]
- }
+ showModal: boolean
+ selectedPresentation: iPresentation | null
+ presentations: iPresentation[]
}
const Presentations: React.FC = () => {
@@ -41,13 +28,28 @@ const Presentations: React.FC = () => {
const { user } = useStore()
const [state, setState] = useState
({
- loading: false,
+ loading: true,
error: null,
+ showModal: false,
+ selectedPresentation: null,
presentations: [
{
presentationId: "1",
title: "Test",
subtitle: "Test2",
+ slideCount: 5,
+ thumbnail: {
+ contentUrl:
+ "https://images.pexels.com/photos/7116676/pexels-photo-7116676.jpeg?auto=compress&cs=tinysrgb&w=1260&h=750&dpr=2",
+ height: 300,
+ width: 300,
+ },
+ },
+ {
+ presentationId: "2",
+ title: "Test2",
+ subtitle: "Test3",
+ slideCount: 5,
thumbnail: {
contentUrl:
"https://images.pexels.com/photos/7116676/pexels-photo-7116676.jpeg?auto=compress&cs=tinysrgb&w=1260&h=750&dpr=2",
@@ -58,11 +60,6 @@ const Presentations: React.FC = () => {
],
})
- const [props, set] = useSpring(() => ({
- xys: [0, 0, 1],
- config: { mass: 5, tension: 350, friction: 40 },
- }))
-
useEffect(() => {
const fetchPresentations = async (): Promise<
iPresentation[] | void
@@ -115,10 +112,21 @@ const Presentations: React.FC = () => {
className="Home"
style={{ flex: 1, flexDirection: "column" }}
>
+ {state.selectedPresentation && (
+
+ setState({ ...state, selectedPresentation: null })
+ }
+ />
+ )}
-
+
Presentations
@@ -131,55 +139,26 @@ const Presentations: React.FC = () => {
<>
{!state.loading &&
state.presentations.length > 0 &&
- state.presentations.map(
- ({ title, subtitle, thumbnail }, index) => {
- return (
-
- {/* {
- const {
- clientX: x,
- clientY: y,
- } = e
-
- return set({
- xys: calc(x, y),
- })
- }}
- // onMouseLeave={() => set({ xys: [0, 0, 1] })}
- style={{
- transform:
- props.xys.interpolate(
- trans
- ),
- }}
- > */}
-
-
-
{title}
- {subtitle}
-
-
- )
- }
- )}
+ state.presentations.map((presentation, index) => {
+ return (
+
+
+ setState({
+ ...state,
+ selectedPresentation:
+ presentation,
+ })
+ }
+ />
+
+ )
+ })}
{state.loading && (
)}
@@ -193,10 +172,12 @@ const Presentations: React.FC = () => {
-
+
{state.error.message}
+ Contact}
+ >
+
+
+
+