Skip to content

Commit

Permalink
refactor(ui): simplify implementation of github provider using PAT (#…
Browse files Browse the repository at this point in the history
…1963)

* refactor(ui): implify implementation of github provider using PAT

* update

* remove useless component

* format

* [autofix.ci] apply automated fixes

* justify size

* [autofix.ci] apply automated fixes

* restructure-repository-providers

* consolidate layouts

* adjust ux

* update ux

* fix spacing

* update

* fix ui

* update

* update

* update

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Meng Zhang <[email protected]>
  • Loading branch information
3 people authored Apr 25, 2024
1 parent eb942ae commit 2615fbf
Show file tree
Hide file tree
Showing 34 changed files with 589 additions and 1,222 deletions.
13 changes: 8 additions & 5 deletions ee/tabby-ui/app/(dashboard)/components/sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,8 @@ export default function Sidebar({ children, className }: SidebarProps) {
</>
}
>
<SidebarButton href="/settings/git">
Git Providers
<SidebarButton href="/settings/repository/git">
Repository Providers
</SidebarButton>
<SidebarButton href="/settings/sso">SSO</SidebarButton>
<SidebarButton href="/settings/mail">
Expand Down Expand Up @@ -135,9 +135,12 @@ const linkVariants = cva(
function SidebarButton({ href, children }: SidebarButtonProps) {
const pathname = usePathname()
const isSelected = React.useMemo(() => {
return href === '/'
? href === pathname
: shouldPathnameHighlight(pathname, href)
if (href === '/') return href === pathname
if (href.startsWith('/settings/repository/github')) {
return pathname.startsWith('/settings/repository/')
}

return shouldPathnameHighlight(pathname, href)
}, [pathname, href])

const state = isSelected ? 'selected' : 'not-selected'
Expand Down

This file was deleted.

11 changes: 0 additions & 11 deletions ee/tabby-ui/app/(dashboard)/settings/(integrations)/git/page.tsx

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit 2615fbf

Please sign in to comment.