Skip to content

Commit

Permalink
fix(ui): various fix (NangoHQ#2552)
Browse files Browse the repository at this point in the history
## Describe your changes

- Fix getLogsUrl when getting null for date
- Fix button centering
- Fix tooltip color for copy button
  • Loading branch information
bodinsamuel authored Jul 26, 2024
1 parent e11e069 commit c7103aa
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 9 deletions.
6 changes: 1 addition & 5 deletions packages/webapp/src/components/ui/button/Button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,7 @@ const Button = forwardRef<HTMLButtonElement, ButtonProps>(function Button({ size
}

return (
<button
ref={ref}
className={cn(buttonStyles({ className, variant, size }), 'relative flex gap-2 items-center justify-center', isLoading && 'opacity-0')}
{...props}
>
<button ref={ref} className={cn(buttonStyles({ variant, size }), 'relative flex gap-2 items-center', className, isLoading && 'opacity-0')} {...props}>
{children}
{isLoading && <Loader className="animate-spin flex inset-x-0 h-full" />}
</button>
Expand Down
4 changes: 3 additions & 1 deletion packages/webapp/src/components/ui/button/CopyButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,9 @@ export const CopyButton: React.FC<ClipboardButtonProps> = ({ text, iconType = 'c
{iconType === 'link' ? <Link2Icon className={cn(`h-4`, className)} /> : <CopyIcon className={cn(`h-4 w-4`, className)} />}
</Button>
</TooltipTrigger>
<TooltipContent sideOffset={10}>{tooltipText}</TooltipContent>
<TooltipContent sideOffset={10} className="text-white">
{tooltipText}
</TooltipContent>
</Tooltip>
);
};
2 changes: 1 addition & 1 deletion packages/webapp/src/pages/Account/InviteSignup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ export const InviteSignup: React.FC = () => {
</div>
<div className="w-full">
<Link to={'/signup'}>
<Button className="w-full" size={'lg'}>
<Button className="w-full justify-center" size={'lg'}>
Back to signup
</Button>
</Link>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ export const SyncRow: React.FC<{ sync: SyncResponse; connection: Connection; pro
env,
connections: connection?.connection_id,
syncs: sync.name,
day: new Date(sync.latest_sync?.updated_at)
day: sync.latest_sync?.updated_at ? new Date(sync.latest_sync.updated_at) : null
});
}, [env, sync.name]);

Expand Down
2 changes: 1 addition & 1 deletion packages/webapp/src/utils/logs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export function getLogsUrl(
if (!val || key === 'env') {
continue;
}
if (key === 'day') {
if (key === 'day' && val) {
const from = new Date(val);
from.setHours(0, 0);
const to = new Date(val);
Expand Down

0 comments on commit c7103aa

Please sign in to comment.