-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Improve the Vercel & Slack integration settings pages #4848
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
7 commits
Select commit
Hold shift + click to select a range
fd8f0d1
feat(webapp): improve Vercel & Slack integration blank states
samejr 1757427
feat(webapp): rebuild Vercel & Slack integration connected states on …
samejr 590f73f
fix(webapp): add an accessible name to the Vercel Configure link
samejr 8279fc2
chore(webapp): drop the server-changes note for the integration setti…
samejr ea5e324
Merge remote-tracking branch 'origin/main' into samejr/castries
samejr a48fd40
Merge remote-tracking branch 'origin/main' into samejr/castries
samejr 97cebf5
chore(webapp): remove explanatory comments from the integration setti…
samejr 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
There are no files selected for viewing
67 changes: 67 additions & 0 deletions
67
apps/webapp/app/components/integrations/ProjectConnectSelect.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 |
|---|---|---|
| @@ -0,0 +1,67 @@ | ||
| import { useNavigation } from "@remix-run/react"; | ||
| import { useEffect, useState } from "react"; | ||
| import { ChevronExtraSmallDown } from "~/assets/icons/ChevronExtraSmallDown"; | ||
| import { DropdownIcon } from "~/assets/icons/DropdownIcon"; | ||
| import { FolderClosedIcon } from "~/assets/icons/FolderClosedIcon"; | ||
| import { | ||
| Popover, | ||
| PopoverContent, | ||
| PopoverMenuItem, | ||
| PopoverTrigger, | ||
| } from "~/components/primitives/Popover"; | ||
|
|
||
| type ConnectableProject = { id: string; slug: string; name: string }; | ||
|
|
||
| const MENU_LABEL = "text-[0.90625rem] font-medium tracking-[-0.01em]"; | ||
|
|
||
| export function ProjectConnectSelect({ | ||
| projects, | ||
| configurePathFor, | ||
| }: { | ||
| projects: ConnectableProject[]; | ||
| configurePathFor: (project: ConnectableProject) => string; | ||
| }) { | ||
| const [isOpen, setIsOpen] = useState(false); | ||
| const navigation = useNavigation(); | ||
|
|
||
| useEffect(() => { | ||
| // oxlint-disable-next-line react/set-state-in-effect -- sync menu state after navigation. | ||
| setIsOpen(false); | ||
| }, [navigation.location?.pathname]); | ||
|
|
||
| if (projects.length === 0) { | ||
| return null; | ||
| } | ||
|
|
||
| return ( | ||
| <Popover open={isOpen} onOpenChange={setIsOpen}> | ||
| <PopoverTrigger className="group mt-2 flex h-8 w-fit cursor-pointer items-center gap-2 rounded border border-grid-bright pl-2.5 pr-2 hover:bg-background-hover focus-custom"> | ||
| <span className={`${MENU_LABEL} text-text-bright`}>Select project to configure</span> | ||
| <DropdownIcon className="size-4 min-w-4 text-text-dimmed group-hover:text-text-bright" /> | ||
| </PopoverTrigger> | ||
| <PopoverContent | ||
| className="min-w-56 overflow-y-auto p-0 scrollbar-thin scrollbar-track-transparent scrollbar-thumb-surface-control" | ||
| align="center" | ||
| sideOffset={4} | ||
| > | ||
| <div className="flex flex-col gap-1 p-1"> | ||
| {projects.map((project) => ( | ||
| <PopoverMenuItem | ||
| key={project.id} | ||
| to={configurePathFor(project)} | ||
| title={ | ||
| <span className="flex w-full items-center justify-between gap-2 text-text-bright"> | ||
| <span className="min-w-0 grow truncate text-left">{project.name}</span> | ||
| <ChevronExtraSmallDown className="size-3.5 shrink-0 -rotate-90 text-text-dimmed opacity-0 transition-opacity group-hover/button:opacity-100" /> | ||
| </span> | ||
| } | ||
| icon={FolderClosedIcon} | ||
| leadingIconClassName="h-5 w-5 text-indigo-500" | ||
| className={MENU_LABEL} | ||
| /> | ||
| ))} | ||
| </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
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.
Uh oh!
There was an error while loading. Please reload this page.