Skip to content
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

Fix Ribbon banner #19

Merged
merged 1 commit into from
Jan 5, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 9 additions & 6 deletions src/yooldo/components/RibbonBanner.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ import { useState } from 'react';

export interface RibbonBannerProps {
className?: string;
toggleClassName?: boolean;
toggleClassName?: string;
iconClassName?: string;
onOpenHandler?: (open: boolean) => void;
hideToggleIcon?: boolean;
children?: React.ReactNode;
Expand All @@ -15,6 +16,7 @@ export interface RibbonBannerProps {
export const RibbonBanner: React.FC<RibbonBannerProps> = ({
className,
toggleClassName,
iconClassName,
onOpenHandler,
hideToggleIcon,
children,
Expand All @@ -25,8 +27,7 @@ export const RibbonBanner: React.FC<RibbonBannerProps> = ({
<aside
className={cn([
'yl-relative yl-flex yl-w-full yl-items-center yl-justify-center yl-transition-all',
!open && 'yl-min-h-0 yl-h-0',
open && 'yl-min-h-[40px]',
'yl-min-h-[40px]',
className,
])}
>
Expand Down Expand Up @@ -75,7 +76,7 @@ export const RibbonBanner: React.FC<RibbonBannerProps> = ({
>
<div
className={cn([
'yl-text-xs yl-tracking-tight hover:yl-bg-white hover:yl-bg-opacity-10 yl-px-2 yl-transition-all',
'yl-text-xs yl-tracking-tight hover:yl-bg-white hover:yl-bg-opacity-10 yl-px-2 yl-py-1 yl-transition-all yl-rounded-md',
!open && 'yl-opacity-0 yl-invisible yl-h-0',
])}
>
Expand All @@ -84,7 +85,8 @@ export const RibbonBanner: React.FC<RibbonBannerProps> = ({
{!hideToggleIcon && (
<button
className={cn([
'yl-absolute yl-top-full yl-left-1/2 -yl-translate-x-1/2 yl-flex yl-h-5 yl-w-5 yl-items-center yl-justify-center',
'yl-absolute yl-top-full yl-left-1/2 -yl-translate-x-1/2 yl-flex yl-h-7 yl-w-7 yl-items-center yl-justify-center yl-rounded-full hover:yl-bg-[#ffffff20]',
!open && '-yl-translate-y-[calc(50%_+_4px)]',
toggleClassName,
])}
onClick={(e) => {
Expand All @@ -99,8 +101,9 @@ export const RibbonBanner: React.FC<RibbonBannerProps> = ({
) : (
<ChevronDoubleUpIcon
className={cn([
'yl-h-5 yl-w-5 dark:yl-text-yooldo-white yl-transition-transform yl-text-yooldo-black',
'yl-h-5 yl-w-5 yl-text-yooldo-white yl-transition-transform',
!open && 'yl-rotate-180',
iconClassName,
])}
/>
)}
Expand Down