+
{}}
- messages={[
- {
- image: 'https://www.creative-tim.com/learning-lab/tailwind-starter-kit/img/team-4-470x470.png',
- name: 'AVantika',
- newNotification: false,
- selected: false,
- timestamp: 1664376815,
- },
- {
- image: 'https://www.creative-tim.com/learning-lab/tailwind-starter-kit/img/team-4-470x470.png',
- name: 'AVantika',
- newNotification: true,
- selected: false,
- timestamp: 1748347589,
- },
- {
- image: 'https://www.creative-tim.com/learning-lab/tailwind-starter-kit/img/team-4-470x470.png',
- name: 'AVantika',
- newNotification: false,
- selected: false,
- timestamp: 1231211842,
- },
- {
- image: 'https://www.creative-tim.com/learning-lab/tailwind-starter-kit/img/team-4-470x470.png',
- name: 'AVantika',
- newNotification: false,
- selected: false,
- timestamp: 1748347589,
- },
- {
- image: 'https://www.creative-tim.com/learning-lab/tailwind-starter-kit/img/team-4-470x470.png',
- name: 'AVantika',
- newNotification: false,
- selected: false,
- timestamp: 1341465382,
- },
- {
- image: 'https://www.creative-tim.com/learning-lab/tailwind-starter-kit/img/team-4-470x470.png',
- name: 'AVantika',
- newNotification: false,
- selected: false,
- timestamp: 1034500193,
- },
- ]}
+ handle={() => null}
+ messages={data.sentMessages}
+ handleSelect={(id: string) => setSelected(id)}
+ selected={selected}
/>
-
-
- {/*
- FIXME: Replace this with a component
- ALMP-559
-
*/}
+
+ {selected !== null && conversation ? (
+ <>
+
+
+ >
+ ) : (
+
+
+ Select a conversation to view
+
+
+ )}
>
)
}
-export default Index
+
+DirectMessageHomePage.getLayout = (page: any) => {
+ return
{page}
+}
+
+export default DirectMessageHomePage
diff --git a/tailwind.config.js b/tailwind.config.js
index 2aaa0c99..bfb21758 100644
--- a/tailwind.config.js
+++ b/tailwind.config.js
@@ -38,6 +38,9 @@ module.exports = {
borderRadius: {
DEFAULT: '1px',
},
+ scale: {
+ '-1': '-1',
+ },
},
},
plugins: [require('flowbite/plugin')],
diff --git a/types/graphql.d.ts b/types/graphql.d.ts
index ff41eb3f..74ad746a 100644
--- a/types/graphql.d.ts
+++ b/types/graphql.d.ts
@@ -96,19 +96,16 @@ export interface CoursePathInput {
export interface SectionPathInput {
id: string
- name: string
collections: CollectionPathInput[]
}
export interface CollectionPathInput {
id: string
- name: string
modules: ModulePathInput[]
}
export interface ModulePathInput {
id: string
- enrollmentID?: Nullable
}
export interface CreateContentArgs {
@@ -540,6 +537,11 @@ export interface IMutation {
message: string,
senderID: string
): boolean | Promise
+ createGroup(
+ name: string,
+ members: string[],
+ publicGroup?: Nullable
+ ): Group | Promise
addPlan(input?: Nullable): PlanOfStudy | Promise
updatePlan(
id: string,
@@ -724,12 +726,16 @@ export interface IQuery {
): Nullable | Promise>
thread(input?: Nullable): Thread[] | Promise
directMessages(
- receiverID: string
+ receiverID: string,
+ senderID: string
): DirectMessageResponse[] | Promise
groups(userID: string): Group[] | Promise
groupMessages(
groupID: string
): DirectMessageResponse[] | Promise
+ sentMessages(
+ senderID: string
+ ): DirectMessageResponse[] | Promise
plan(
studentID: string
): Nullable | Promise>
@@ -856,6 +862,7 @@ export interface Group {
members: User[]
public: boolean
messages: DirectMessageResponse[]
+ __typename?: string
}
export interface PlanOfStudy {
@@ -995,6 +1002,16 @@ export interface ModuleFlow {
currentSection?: Nullable
}
+export interface SimpleModuleFlow {
+ previousModule?: Nullable
+ previousCollection?: Nullable
+ nextModule?: Nullable
+ nextCollection?: Nullable
+ currentModule?: Nullable
+ currentCollection?: Nullable
+ currentSection?: Nullable
+}
+
export interface SimpleLearningPath {
id: string
createdAt: Date
@@ -1062,8 +1079,8 @@ export interface Path {
export interface CoursePath {
id: string
name: string
- prefix?: string
- number?: number
+ prefix?: Nullable
+ number?: Nullable
required: boolean
carnegieHours: number
sections: SectionPath[]
@@ -1230,6 +1247,7 @@ export interface User {
watchedThreads?: Nullable
watchedThreadIDs?: Nullable
createdThreads?: Nullable
+ __typename?: Nullable
}
export interface Token {
diff --git a/utils/gql_fetcher.ts b/utils/gql_fetcher.ts
index cef41077..03aafc57 100644
--- a/utils/gql_fetcher.ts
+++ b/utils/gql_fetcher.ts
@@ -1,4 +1,5 @@
import { GraphQLClient } from 'graphql-request'
+import { createClient } from 'graphql-ws'
const gqlFetcher = (args) => {
const client = new GraphQLClient(process.env.NEXT_PUBLIC_API_URL, {
@@ -14,4 +15,11 @@ export const client = new GraphQLClient(process.env.NEXT_PUBLIC_API_URL, {
headers: {},
})
+export const wsClient =
+ typeof window !== 'undefined'
+ ? createClient({
+ url: 'ws://localhost:5000/graphql',
+ })
+ : null
+
export default gqlFetcher