Skip to content

Commit

Permalink
Merge branch 'refactor/refactor-base' of github.com:Chia-Network/cadt…
Browse files Browse the repository at this point in the history
…-ui into refactor/refactor-base
  • Loading branch information
MichaelTaylor3D committed Apr 4, 2024
2 parents 6c24308 + 65ec76a commit 5f82b60
Show file tree
Hide file tree
Showing 7 changed files with 60 additions and 6 deletions.
11 changes: 10 additions & 1 deletion src/renderer/components/blocks/layout/LeftNav.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@ import { useCallback, useState } from 'react';
import { useLocation, useNavigate } from 'react-router-dom';
import { IoMenu } from 'react-icons/io5';
import { FormattedMessage } from 'react-intl';
import { Sidebar } from '@/components';
import {Sidebar, WarehouseIcon} from '@/components';
import ROUTES from '@/routes/route-constants';
import {Card} from "@/components";

const LeftNav = () => {
const navigate = useNavigate();
Expand Down Expand Up @@ -66,6 +67,14 @@ const LeftNav = () => {
{/* Original Desktop LeftNav Layout */}
<div className="hidden md:block">
<Sidebar aria-label="App Navigation">
<Card className="max-w-sm mb-6 shadow-none">
<div className={'flex space-x-3 justify-center'}>
<WarehouseIcon height={24} width={24}/>
<div>
<FormattedMessage id={'warehouse'}/>
</div>
</div>
</Card>
<Sidebar.Items>
<Sidebar.ItemGroup>
<Sidebar.Item
Expand Down
33 changes: 33 additions & 0 deletions src/renderer/components/icons/WarehouseIcon.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import React from 'react';

interface WarehouseIconProps {
width: number | string | undefined;
height: number | string | undefined;
}

const WarehouseIcon: React.FC<WarehouseIconProps> = ({ width, height }: WarehouseIconProps) => {
return (
<svg
width={`${width}px`}
height={`${height}px`}
viewBox="0 0 22 18"
fill="none"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M15.5 7.45312H6.49998C6.39685 7.45312 6.31248 7.5375 6.31248 7.64062V17.0625C6.31248 17.1656 6.39685 17.25 6.49998 17.25H15.5C15.6031 17.25 15.6875 17.1656 15.6875 17.0625V7.64062C15.6875 7.5375 15.6031 7.45312 15.5 7.45312ZM7.81248 8.95312H14.1875V11.6953H7.81248V8.95312ZM14.1875 15.75H7.81248V13.0078H14.1875V15.75Z"
fill="currentColor"
/>
<path
d="M8.93748 14.5312C8.93748 14.7302 9.01649 14.9209 9.15715 15.0616C9.2978 15.2022 9.48856 15.2812 9.68748 15.2812C9.88639 15.2812 10.0772 15.2022 10.2178 15.0616C10.3585 14.9209 10.4375 14.7302 10.4375 14.5312C10.4375 14.3323 10.3585 14.1416 10.2178 14.0009C10.0772 13.8603 9.88639 13.7812 9.68748 13.7812C9.48856 13.7812 9.2978 13.8603 9.15715 14.0009C9.01649 14.1416 8.93748 14.3323 8.93748 14.5312ZM8.93748 10.3594C8.93748 10.5583 9.01649 10.7491 9.15715 10.8897C9.2978 11.0304 9.48856 11.1094 9.68748 11.1094C9.88639 11.1094 10.0772 11.0304 10.2178 10.8897C10.3585 10.7491 10.4375 10.5583 10.4375 10.3594C10.4375 10.1605 10.3585 9.9697 10.2178 9.82904C10.0772 9.68839 9.88639 9.60938 9.68748 9.60938C9.48856 9.60938 9.2978 9.68839 9.15715 9.82904C9.01649 9.9697 8.93748 10.1605 8.93748 10.3594Z"
fill="currentColor"
/>
<path
d="M18.0181 5.64609C16.9447 2.8125 14.2095 0.796875 11.0056 0.796875C7.8017 0.796875 5.06655 2.81016 3.99311 5.64375C1.97514 6.17578 0.489205 8.02031 0.500923 10.2094C0.514986 12.6562 2.41342 14.6461 4.80405 14.8594C4.9142 14.8687 5.00795 14.782 5.00795 14.6719V13.2562C5.00795 13.1625 4.93764 13.0828 4.84389 13.0711C4.21108 12.9914 3.61342 12.7148 3.15405 12.2625C2.59155 11.7117 2.28217 10.9711 2.28217 10.1859C2.28217 9.52969 2.49545 8.91094 2.89624 8.39531C3.28764 7.89375 3.83842 7.53047 4.44545 7.37109L5.33374 7.13672L5.65952 6.27656C5.86108 5.74219 6.14233 5.24062 6.49624 4.78828C6.84545 4.33828 7.2603 3.94453 7.72436 3.61641C8.68764 2.93906 9.82202 2.58047 11.0056 2.58047C12.1892 2.58047 13.3236 2.93906 14.2869 3.61875C14.7533 3.94687 15.1658 4.34062 15.515 4.79062C15.8689 5.24297 16.1501 5.74453 16.3517 6.27891L16.6751 7.13672L17.5611 7.37109C18.8314 7.70859 19.7197 8.86406 19.7197 10.1836C19.7197 10.9711 19.4103 11.7094 18.8478 12.2602C18.3908 12.7102 17.7955 12.9891 17.1626 13.0687C17.0689 13.0805 17.0009 13.1602 17.0009 13.2539V14.6719C17.0009 14.782 17.097 14.8687 17.2072 14.8594C19.5908 14.6437 21.4845 12.6562 21.5009 10.2141C21.515 8.025 20.0314 6.18047 18.0181 5.64609Z"
fill="currentColor"
/>
</svg>
);
};

export { WarehouseIcon };
3 changes: 2 additions & 1 deletion src/renderer/components/icons/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
export * from './AppLogo';
export * from './AppLogo';
export * from './WarehouseIcon';
9 changes: 9 additions & 0 deletions src/renderer/components/proxy/Card.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import {Card as FlowbiteCard, CardProps} from 'flowbite-react';

function Card({ children, ...props }: CardProps) {
return (
<FlowbiteCard {...props}>{children}</FlowbiteCard>
);
}

export {Card};
4 changes: 2 additions & 2 deletions src/renderer/components/proxy/Sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {
SidebarProps,
SidebarItemProps,
SidebarItemsProps,
SidebarItemGroupProps
SidebarItemGroupProps,
} from 'flowbite-react';

function Sidebar({ children, ...props }: SidebarProps) {
Expand All @@ -26,7 +26,7 @@ function ItemGroup({children, ...props}: SidebarItemGroupProps) {

function Item({children, ...props}: SidebarItemProps) {
return (
<FlowbiteSidebar.Item {...props}>{children}</FlowbiteSidebar.Item>
<FlowbiteSidebar.Item className={'active:bg-green-500 dark:active:bg-green-500'} {...props}>{children}</FlowbiteSidebar.Item>
);
}

Expand Down
3 changes: 2 additions & 1 deletion src/renderer/components/proxy/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ export * from './Dropdown';
export * from './TextInput';
export * from './Spinner';
export * from './Sidebar';
export * from './Tooltip';
export * from './Tooltip';
export * from './Card';
3 changes: 2 additions & 1 deletion src/renderer/translations/tokens/en-US.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,6 @@
"validation-body": "Validation Body",
"glossary": "Glossary",
"term": "Term",
"description": "Description"
"description": "Description",
"warehouse": "Warehouse"
}

0 comments on commit 5f82b60

Please sign in to comment.