Skip to content

Commit

Permalink
feat: minor ui fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
KristinaSpasevska committed Nov 7, 2023
1 parent 6d83714 commit 96e31e2
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 15 deletions.
2 changes: 1 addition & 1 deletion packages/apps/tools/locales/en/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@
"for PACT developers": "for PACT developers",
"This option is meant for developers who need more sophisticated options within the user interface.": "This option is meant for developers who need more sophisticated options within the user interface.",
"dApp Developers": "dApp Developers",
"for Javascript developers": "for Javascript developerssss",
"for Javascript developers": "for JavaScript developers",
"The coins have been funded to the given account.": "The coins have been funded to the given account.",
"coins have been funded to": "coins have been funded to",
"form-status-title-erroneous": "Something went wrong",
Expand Down
6 changes: 4 additions & 2 deletions packages/apps/tools/src/components/Common/Layout/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import classNames from 'classnames';
import type { FC, ReactNode } from 'react';
import React from 'react';
import { Header, Sidebar } from './partials';
import { gridItemMainStyle, headerStyle } from './styles.css';
import { gridItemMainStyle, headerStyle, sidebarStyle } from './styles.css';

interface IProps {
children?: ReactNode;
Expand All @@ -17,7 +17,9 @@ export const Layout: FC<IProps> = ({ children }: IProps) => {
<header className={headerStyle}>
<Header />
</header>
<Sidebar />
<aside className={classNames(sidebarStyle, { isMenuOpen })}>
<Sidebar />
</aside>
<main className={classNames(gridItemMainStyle, { isMenuOpen })}>
{children}
</main>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ export const Menu: FC = () => {
key={`menu-link-${index}`}
href={item.href}
active={item.href === router.pathname}
target={item.target}
/>
))}
</Accordion.Root>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,40 +2,33 @@ import { Tooltip } from '@kadena/react-ui';
import classNames from 'classnames';
import Link from 'next/link';
import type { ButtonHTMLAttributes, FC } from 'react';
import React, { useRef } from 'react';
import React from 'react';
import { gridMiniMenuLinkButtonStyle } from './styles.css';

export interface IMenuLinkButtonProps
extends ButtonHTMLAttributes<HTMLButtonElement> {
title?: string;
href?: string;
active?: boolean;
target?: string;
}

export const MenuLinkButton: FC<IMenuLinkButtonProps> = ({
active,
title,
href,
target = '_self',
...rest
}) => {
const tooltipRef = useRef<HTMLDivElement>(null);

const button = (
<>
<button
className={classNames(gridMiniMenuLinkButtonStyle, { active })}
onMouseEnter={(e) => Tooltip.handler(e, tooltipRef)}
onMouseLeave={(e) => Tooltip.handler(e, tooltipRef)}
{...rest}
aria-label={title}
>
{title}
</button>
{!!title && (
<Tooltip.Root placement="right" ref={tooltipRef}>
{title}
</Tooltip.Root>
)}
</>
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ export const gridMiniMenuLinkButtonStyle = style([
fontWeight: '$bold',
}),
{
transition: 'all 0.1s ease',
width: '100%',
borderBottom: `1px solid ${vars.colors.$borderDefault}`,
selectors: {
Expand Down
16 changes: 15 additions & 1 deletion packages/apps/tools/src/components/Common/Layout/styles.css.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ export const gridItemMainStyle = style([
paddingTop: '$20',
paddingBottom: '$16',
paddingRight: '$6',
width: 'max-content',
}),
{
width: '680px',
paddingLeft: `calc(${vars.sizes.$20} + ${vars.sizes.$2})`,
selectors: {
'&.isMenuOpen': {
Expand All @@ -29,3 +29,17 @@ export const gridItemMainStyle = style([
},
},
]);

export const sidebarStyle = style([
sprinkles({
width: '$16',
}),
{
transition: 'width 0.1s ease',
selectors: {
'&.isMenuOpen': {
width: `calc(${vars.sizes.$64} + ${vars.sizes.$35})`,
},
},
},
]);

0 comments on commit 96e31e2

Please sign in to comment.