-
Notifications
You must be signed in to change notification settings - Fork 418
Enhance UI: video icons, share modal, Tailwind colors, rounded modals #1578
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
0e1ba80
add video chat icons
ComputelessComputer 207c5f9
apply icons to listen cta button
ComputelessComputer aefee49
remove responsive for profile
ComputelessComputer e3e4d3f
profile banner
ComputelessComputer 8d182e7
use tailwind colors
ComputelessComputer 68b4907
added separator
ComputelessComputer 6c69e25
make rounded-lg for modals
ComputelessComputer a99822c
prevent toggle from closing
ComputelessComputer d50a8db
added share modal
ComputelessComputer bf55e85
coderabbit fix
ComputelessComputer a75bc8e
fmt
ComputelessComputer a30abbd
fmt
yujonglee File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
236 changes: 233 additions & 3 deletions
236
apps/desktop2/src/components/main/body/sessions/outer-header/share.tsx
This file contains hidden or 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,9 +1,239 @@ | ||
| import { Avatar, AvatarFallback } from "@hypr/ui/components/ui/avatar"; | ||
| import { Button } from "@hypr/ui/components/ui/button"; | ||
| import { Popover, PopoverContent, PopoverTrigger } from "@hypr/ui/components/ui/popover"; | ||
| import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@hypr/ui/components/ui/select"; | ||
| import { Separator } from "@hypr/ui/components/ui/separator"; | ||
|
|
||
| import { CircleMinus, Link2Icon, SearchIcon } from "lucide-react"; | ||
| import { useState } from "react"; | ||
| import { getInitials } from "../../contacts/shared"; | ||
|
|
||
| interface Person { | ||
| id: string; | ||
| name: string; | ||
| email?: string; | ||
| role: "viewer" | "editor"; | ||
| isParticipant?: boolean; | ||
| } | ||
|
|
||
| export function ShareButton(_: { sessionId: string }) { | ||
| const [searchQuery, setSearchQuery] = useState(""); | ||
| const [selectedPeople, setSelectedPeople] = useState<Person[]>([]); | ||
| const [invitedPeople, setInvitedPeople] = useState<Person[]>([ | ||
| { id: "1", name: "John Doe", email: "john@example.com", role: "editor", isParticipant: true }, | ||
| { id: "2", name: "Jane Smith", email: "jane@example.com", role: "editor", isParticipant: true }, | ||
| ]); | ||
|
|
||
| const searchResults: Person[] = searchQuery.trim() | ||
| ? [ | ||
| { id: "3", name: "Alice Johnson", email: "alice@example.com", role: "viewer" as const }, | ||
| { id: "4", name: "Bob Wilson", email: "bob@example.com", role: "viewer" as const }, | ||
| ].filter((person) => person.name.toLowerCase().includes(searchQuery.toLowerCase())) | ||
| : []; | ||
|
|
||
| const handleSelectPerson = (person: Person) => { | ||
| if (!selectedPeople.find((p) => p.id === person.id)) { | ||
| setSelectedPeople([...selectedPeople, person]); | ||
| } | ||
| setSearchQuery(""); | ||
| }; | ||
|
|
||
| const handleRemoveSelected = (personId: string) => { | ||
| setSelectedPeople(selectedPeople.filter((p) => p.id !== personId)); | ||
| }; | ||
|
|
||
| const handleInvite = () => { | ||
| const newInvites = selectedPeople.filter( | ||
| (selected) => !invitedPeople.find((invited) => invited.id === selected.id), | ||
| ); | ||
| setInvitedPeople([...invitedPeople, ...newInvites]); | ||
| setSelectedPeople([]); | ||
| // TODO: Implement actual invite functionality | ||
| console.log("Invite:", newInvites); | ||
| }; | ||
|
|
||
| const handleRemovePerson = (personId: string) => { | ||
| setInvitedPeople(invitedPeople.filter((p) => p.id !== personId)); | ||
| }; | ||
|
|
||
| const handleRoleChange = (personId: string, role: "viewer" | "editor") => { | ||
| setInvitedPeople( | ||
| invitedPeople.map((p) => (p.id === personId ? { ...p, role } : p)), | ||
| ); | ||
| }; | ||
|
|
||
| const handleCopyLink = () => { | ||
| // TODO: Implement copy link functionality | ||
| console.log("Copy link"); | ||
| }; | ||
|
|
||
| return ( | ||
| <Button size="sm" variant="ghost"> | ||
| Share | ||
| </Button> | ||
| <Popover> | ||
| <PopoverTrigger asChild> | ||
| <Button size="sm" variant="ghost"> | ||
| Share | ||
| </Button> | ||
| </PopoverTrigger> | ||
|
|
||
| <PopoverContent className="w-[360px] shadow-lg" align="end"> | ||
| <div className="flex flex-col gap-4"> | ||
| <div className="flex flex-col gap-2"> | ||
| <div className="flex items-center px-3 py-2 gap-2 rounded-md bg-neutral-50 border border-neutral-200"> | ||
| <SearchIcon className="size-4 text-neutral-700 flex-shrink-0" /> | ||
| <input | ||
| type="text" | ||
| value={searchQuery} | ||
| onChange={(e) => setSearchQuery(e.target.value)} | ||
| placeholder="Search for people" | ||
| className="w-full bg-transparent text-sm focus:outline-none placeholder:text-neutral-500" | ||
| /> | ||
| </div> | ||
|
|
||
| {searchQuery.trim() && searchResults.length > 0 && ( | ||
| <div className="flex flex-col rounded-md border border-neutral-200 overflow-hidden"> | ||
| {searchResults.map((person) => ( | ||
| <button | ||
| key={person.id} | ||
| type="button" | ||
| onClick={() => handleSelectPerson(person)} | ||
| className="flex items-center justify-between px-3 py-2 text-sm text-left hover:bg-neutral-100 transition-colors w-full disabled:opacity-50" | ||
| disabled={selectedPeople.some((p) => p.id === person.id) | ||
| || invitedPeople.some((p) => p.id === person.id)} | ||
| > | ||
| <div className="flex items-center gap-2"> | ||
| <Avatar className="size-6"> | ||
| <AvatarFallback className="text-xs bg-neutral-200 text-neutral-700 font-medium"> | ||
| {getInitials(person.name)} | ||
| </AvatarFallback> | ||
| </Avatar> | ||
| <div className="flex flex-col"> | ||
| <span className="font-medium truncate">{person.name}</span> | ||
| {person.email && <span className="text-xs text-neutral-500">{person.email}</span>} | ||
| </div> | ||
| </div> | ||
| </button> | ||
| ))} | ||
| </div> | ||
| )} | ||
| </div> | ||
|
|
||
| {selectedPeople.length > 0 && ( | ||
| <div className="flex flex-col gap-2"> | ||
| <div className="flex flex-col rounded-md border border-neutral-100 bg-neutral-50 overflow-hidden"> | ||
| {selectedPeople.map((person) => ( | ||
| <div | ||
| key={person.id} | ||
| className="flex items-center justify-between gap-3 py-2 px-3 hover:bg-neutral-100 group transition-colors" | ||
| > | ||
| <div className="flex items-center gap-2.5 relative min-w-0 flex-1"> | ||
| <div className="relative size-7 flex items-center justify-center flex-shrink-0"> | ||
| <div className="absolute inset-0 flex items-center justify-center transition-opacity group-hover:opacity-0"> | ||
| <Avatar className="size-7"> | ||
| <AvatarFallback className="text-xs bg-neutral-200 text-neutral-700 font-medium"> | ||
| {getInitials(person.name)} | ||
| </AvatarFallback> | ||
| </Avatar> | ||
| </div> | ||
| <button | ||
| onClick={(e) => { | ||
| e.stopPropagation(); | ||
| handleRemoveSelected(person.id); | ||
| }} | ||
| className="flex items-center justify-center text-red-400 hover:text-red-600 absolute inset-0 rounded-full opacity-0 group-hover:opacity-100 transition-opacity bg-white shadow-sm" | ||
| > | ||
| <CircleMinus className="size-4" /> | ||
| </button> | ||
| </div> | ||
| <div className="flex flex-col min-w-0"> | ||
| <span className="text-sm font-medium text-neutral-700 truncate"> | ||
| {person.name} | ||
| </span> | ||
| {person.email && <span className="text-xs text-neutral-500 truncate">{person.email}</span>} | ||
| </div> | ||
| </div> | ||
| </div> | ||
| ))} | ||
| </div> | ||
| </div> | ||
| )} | ||
|
|
||
| {selectedPeople.length > 0 && ( | ||
| <Button onClick={handleInvite} className="w-full"> | ||
| Invite {selectedPeople.length} {selectedPeople.length === 1 ? "person" : "people"} | ||
| </Button> | ||
| )} | ||
|
|
||
| {selectedPeople.length > 0 && <Separator />} | ||
|
|
||
| {invitedPeople.length > 0 && ( | ||
| <div className="flex flex-col gap-2"> | ||
| <div className="text-xs font-medium text-neutral-500"> | ||
| People with access | ||
| </div> | ||
| <div className="flex flex-col rounded-md border border-neutral-100 bg-neutral-50 overflow-hidden max-h-[40vh] overflow-y-auto"> | ||
| {invitedPeople.map((person) => ( | ||
| <div | ||
| key={person.id} | ||
| className="flex items-center justify-between gap-3 py-2 px-3 hover:bg-neutral-100 group transition-colors" | ||
| > | ||
| <div className="flex items-center gap-2.5 relative min-w-0 flex-1"> | ||
| <div className="relative size-7 flex items-center justify-center flex-shrink-0"> | ||
| <div className="absolute inset-0 flex items-center justify-center transition-opacity group-hover:opacity-0"> | ||
| <Avatar className="size-7"> | ||
| <AvatarFallback className="text-xs bg-neutral-200 text-neutral-700 font-medium"> | ||
| {getInitials(person.name)} | ||
| </AvatarFallback> | ||
| </Avatar> | ||
| </div> | ||
| <button | ||
| onClick={(e) => { | ||
| e.stopPropagation(); | ||
| handleRemovePerson(person.id); | ||
| }} | ||
| className="flex items-center justify-center text-red-400 hover:text-red-600 absolute inset-0 rounded-full opacity-0 group-hover:opacity-100 transition-opacity bg-white shadow-sm" | ||
| > | ||
| <CircleMinus className="size-4" /> | ||
| </button> | ||
| </div> | ||
| <div className="flex flex-col min-w-0"> | ||
| <span className="text-sm font-medium text-neutral-700 truncate"> | ||
| {person.name} | ||
| </span> | ||
| {person.email && <span className="text-xs text-neutral-500 truncate">{person.email}</span>} | ||
| </div> | ||
| </div> | ||
|
|
||
| <Select | ||
| value={person.role} | ||
| onValueChange={(value: "viewer" | "editor") => handleRoleChange(person.id, value)} | ||
| > | ||
| <SelectTrigger | ||
| className="w-[100px] h-8 text-xs focus:ring-0 focus:ring-offset-0" | ||
| onClick={(e) => e.stopPropagation()} | ||
| > | ||
| <SelectValue /> | ||
| </SelectTrigger> | ||
| <SelectContent> | ||
| <SelectItem value="viewer">Viewer</SelectItem> | ||
| <SelectItem value="editor">Editor</SelectItem> | ||
| </SelectContent> | ||
| </Select> | ||
| </div> | ||
| ))} | ||
| </div> | ||
| </div> | ||
| )} | ||
|
|
||
| <Button | ||
| variant="outline" | ||
| className="w-full" | ||
| onClick={handleCopyLink} | ||
| > | ||
| <Link2Icon className="size-4" /> | ||
| Copy link | ||
| </Button> | ||
| </div> | ||
| </PopoverContent> | ||
| </Popover> | ||
| ); | ||
| } | ||
This file contains hidden or 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 hidden or 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.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion | 🟠 Major
Remove console.log statements before merging.
Debug console.log statements should be removed from production code.
Apply this diff:
setInvitedPeople([...invitedPeople, ...newInvites]); setSelectedPeople([]); - // TODO: Implement actual invite functionality - console.log("Invite:", newInvites); + // TODO: Implement actual invite functionality };const handleCopyLink = () => { - // TODO: Implement copy link functionality - console.log("Copy link"); + // TODO: Implement copy link functionality };Also applies to: 67-67
🤖 Prompt for AI Agents