-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Resolve DOO-61, DOO-72 "Comments, Board UI, Sheets, and Tenancy API" (#…
…63) * Images work in live collab. * Images serialization and deserialization. * Cleanup and tenant api. * Fix tests/linting. * Remove adjust skip. * Skeleton top bar layout. * Top bar ui. * Comments sheet. * Tenancy and stores. * Hooked stores, all but streaming indicator. * Base UI template complete. * Comments * Add dashboard logo * Fix board scroll data format.
- Loading branch information
Showing
42 changed files
with
1,692 additions
and
346 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,33 @@ | ||
* { margin: 0; padding: 0;} | ||
root { height: 100%;} | ||
body, html { height:100%; background-color: transparent !important; } | ||
* { | ||
margin: 0; | ||
padding: 0; | ||
} | ||
root { | ||
height: 100% !important; | ||
} | ||
body, | ||
html { | ||
height: 100%; | ||
background-color: transparent !important; | ||
} | ||
|
||
/* Custom scrollbar */ | ||
::-webkit-scrollbar { | ||
width: var(--scrollbar-w); | ||
} | ||
::-webkit-scrollbar-track { | ||
background-color: transparent; | ||
} | ||
::-webkit-scrollbar-thumb { | ||
background-color: var(--scrollbar-colour); | ||
border-radius: 30px; | ||
border: 5px solid transparent; | ||
background-clip: content-box; | ||
outline-offset: -20px; | ||
} | ||
::-webkit-scrollbar-thumb:hover { | ||
background-color: var(--scrollbar-hover); | ||
} | ||
::-webkit-scrollbar-corner { | ||
background: rgba(0, 0, 0, 0); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
import { sfu } from './sfu'; | ||
import { stableDiffusion } from './stableDiffusion'; | ||
import { tenancy } from './tenancy'; | ||
|
||
export { sfu, stableDiffusion }; | ||
export { sfu, tenancy, stableDiffusion }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import { REST } from '@/constants'; | ||
import axios from 'axios'; | ||
|
||
/** | ||
* Defines REST methods for the live socket | ||
* tenancy API. | ||
* @author Yousef Yassin | ||
*/ | ||
|
||
/** | ||
* Returns a list of active tenants, referenced | ||
* by their ids, in the specified room. | ||
* @param roomID The ID of the room to query. | ||
* @returns The list of active tenants. | ||
*/ | ||
const getActiveTenants = async (roomID: string) => { | ||
try { | ||
const { data } = await axios.put(REST.tenants.get, { | ||
roomId: roomID, | ||
}); | ||
return data.tenantIds; | ||
} catch (e) { | ||
console.error('Failed to query tenants'); | ||
} | ||
}; | ||
|
||
export const tenancy = { get: getActiveTenants }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,117 @@ | ||
import React from 'react'; | ||
import { Button, buttonVariants } from '../ui/button'; | ||
import { ArrowLeftIcon, ChatBubbleIcon } from '@radix-ui/react-icons'; | ||
import { useAppStore } from '@/stores/AppStore'; | ||
import { Users2Icon } from 'lucide-react'; | ||
import { cn } from '@/lib/utils'; | ||
import UserList from './UserList/UserList'; | ||
import { useCanvasBoardStore } from '@/stores/CanavasBoardStore'; | ||
import { unixToFormattedDate } from '@/lib/misc'; | ||
|
||
/** | ||
* Defines a header for the board containing the title, last modified date, and buttons for sharing and viewing comments. A list of active | ||
* users in the room is also displayed. | ||
* @author Yousef Yassin | ||
*/ | ||
|
||
/** | ||
* The board header component. | ||
* @param Control parameters for the share dialog. | ||
* @returns The component | ||
*/ | ||
const BoardHeader = ({ | ||
isShareDialogOpen, | ||
setIsShareDialogOpen, | ||
}: { | ||
isShareDialogOpen: boolean; | ||
setIsShareDialogOpen: (value: boolean) => void; | ||
}) => { | ||
const { boardMeta } = useCanvasBoardStore(['boardMeta']); | ||
const { | ||
setMode, | ||
isUsingStableDiffusion, | ||
isViewingComments, | ||
setIsViewingComments, | ||
setIsUsingStableDiffusion, | ||
} = useAppStore([ | ||
'setMode', | ||
'isUsingStableDiffusion', | ||
'isViewingComments', | ||
'setIsViewingComments', | ||
'setIsUsingStableDiffusion', | ||
]); | ||
|
||
return ( | ||
<div | ||
className="flex flex-row justify-between items-center p-[0.5rem]" | ||
style={{ | ||
backgroundColor: 'white', | ||
flexGrow: 1, | ||
zIndex: 10, | ||
}} | ||
> | ||
<div className="flex flex-row"> | ||
<div className="flex flex-row"> | ||
<div | ||
className="flex items-center pr-[1.5rem] pl-[0.5rem]" | ||
style={{ | ||
height: '100%', | ||
}} | ||
> | ||
{/* Back to dashboard button */} | ||
<Button | ||
variant="secondary" | ||
className="border-solid border-2 border-indigo-300 hover:border-indigo-400 stroke-indigo-300 hover:stroke-indigo-400 px-3 py-2" | ||
onClick={() => setMode('dashboard')} | ||
> | ||
<span className="sr-only">Back to dashboard</span> | ||
<ArrowLeftIcon className="h-4 w-4" /> | ||
</Button> | ||
</div> | ||
{/* Board info */} | ||
<div className="flex flex-col"> | ||
<h2 className="text-xl font-semibold tracking-tight"> | ||
{boardMeta.title} | ||
</h2> | ||
<p className="text-sm text-muted-foreground"> | ||
Last Edited: {unixToFormattedDate(boardMeta.lastModified)} | ||
</p> | ||
</div> | ||
</div> | ||
</div> | ||
{/* Right side justified, we push this to the left when the sidebar is opened */} | ||
<div | ||
className={`flex flex-row gap-12 items-center transition-spacing duration-300 ease-in-out ${ | ||
isUsingStableDiffusion || isViewingComments ? 'mr-[25rem]' : '' | ||
}`} | ||
> | ||
{/* Avatars of active tenants */} | ||
<UserList /> | ||
{/* Comment section button */} | ||
<Button | ||
variant="secondary" | ||
className="border-solid border-2 border-indigo-300 hover:border-indigo-400 stroke-indigo-300 hover:stroke-indigo-400 px-3 py-2 " | ||
onClick={() => { | ||
setIsViewingComments(!isViewingComments); | ||
!isViewingComments && setIsUsingStableDiffusion(false); | ||
}} | ||
> | ||
<ChatBubbleIcon className="h-4 w-4" /> | ||
</Button> | ||
{/* Share Dialog */} | ||
<Button | ||
className={cn( | ||
buttonVariants({ variant: 'ghost', size: 'sm' }), | ||
'h-full bg-muted text-gray-200 bg-indigo-300 hover:bg-indigo-400 hover:text-white justify-start items-center border-2 border-indigo-300 hover:border-indigo-400', | ||
)} | ||
onClick={() => setIsShareDialogOpen(!isShareDialogOpen)} | ||
> | ||
<Users2Icon className="h-4 w-4 mr-2" /> | ||
<span className="ml-auto">Share</span> | ||
</Button> | ||
</div> | ||
</div> | ||
); | ||
}; | ||
|
||
export default BoardHeader; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.