Skip to content

Commit

Permalink
Fix spacing in accordion and Jest badge generation (#39)
Browse files Browse the repository at this point in the history
  • Loading branch information
Prayag-Das authored Jul 6, 2024
1 parent 6719e4c commit e2d7997
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 22 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/badges.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ jobs:
uses: jpb06/jest-badges-action@latest
with:
branches: '*'
coverage-summary-path: app/coverage/coverage-summary.json
coverage-summary-path: ui/coverage/coverage-summary.json
no-commit: true
target-branch: badges

Expand Down
6 changes: 2 additions & 4 deletions ui/src/components/layout/header/header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,11 @@ const Header = async () => {

<div className="hidden sm:flex space-x-1" data-testid="header-links">
<Menu/>
{currentUser && currentUser.roles.includes(Role.UH) && (
{currentUser.roles.includes(Role.UH) && (
<AuthMenuZ/>
)}
<LoginButton currentUser={currentUser}/>
<div className="px-4">
<ColorSchemeToggle/>
</div>
<ColorSchemeToggle />
</div>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const AuthMenuZ = () => {
<NavigationMenuItem>
<Link href="/contact" legacyBehavior passHref>
<NavigationMenuLink className={navigationMenuTriggerStyle()}>
Contact
Contact
</NavigationMenuLink>
</Link>
</NavigationMenuItem>
Expand Down
11 changes: 2 additions & 9 deletions ui/src/components/layout/header/header_menu/header-menu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,25 +19,18 @@ const Menu = () => {
<NavigationMenuItem>
<Link href="/" legacyBehavior passHref>
<NavigationMenuLink className={navigationMenuTriggerStyle()}>
Home
Home
</NavigationMenuLink>
</Link>
</NavigationMenuItem>
<NavigationMenuItem>
<Link href="/about" legacyBehavior passHref>
<NavigationMenuLink className={navigationMenuTriggerStyle()}>
About
About
</NavigationMenuLink>
</Link>
</NavigationMenuItem>
<CampusDropdown/>
<NavigationMenuItem>
<Link href="/contact" legacyBehavior passHref>
<NavigationMenuLink className={navigationMenuTriggerStyle()}>
Contact
</NavigationMenuLink>
</Link>
</NavigationMenuItem>
</NavigationMenuList>
</NavigationMenu>
);
Expand Down
9 changes: 3 additions & 6 deletions ui/src/components/layout/header/login_button/login-button.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use client';

import { Button } from '@/components/ui/button'
import {IconLogin2} from '@tabler/icons-react';
import { IconLogin2, IconLogout } from '@tabler/icons-react';
import Role from '@/access/role';
import User from '@/access/user';
import { login, logout } from '@/access/authentication';
Expand All @@ -13,11 +13,8 @@ const LoginButton = ({
}) => (
<>
{!currentUser.roles.includes(Role.UH)
? <Button className={"bg-cyan-600 ring-1 ring-cyan-800 text-white hover:bg-cyan-800"} onClick={() =>
login()}>
Login <IconLogin2 />
</Button>
: <Button variant="default" onClick={() => logout()}>Logout ({currentUser.uid})</Button>}
? <Button variant="outline" onClick={() => login()}>Login <IconLogin2 /></Button>
: <Button onClick={() => logout()}>Logout ({currentUser.uid})&nbsp;<IconLogout /></Button>}
</>
);

Expand Down
2 changes: 1 addition & 1 deletion ui/src/components/ui/accordion.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ const AccordionTrigger = React.forwardRef<
>
{children}
<ChevronDownIcon
className="text-black h-4 w-4 shrink-0 text-muted-foreground transition-transform duration-200"
className="size-5 transition-transform duration-200"
/>
</AccordionPrimitive.Trigger>
</AccordionPrimitive.Header>
Expand Down

0 comments on commit e2d7997

Please sign in to comment.