-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #872 from boxwise/feature/add_breadcrumb_to_transfers
Add Breadcrumbs and menus transfer views
- Loading branch information
Showing
37 changed files
with
312 additions
and
243 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
import { useContext } from "react"; | ||
import { GlobalPreferencesContext } from "providers/GlobalPreferencesProvider"; | ||
import { Breadcrumb, BreadcrumbItem, BreadcrumbLink, Button } from "@chakra-ui/react"; | ||
import { ChevronLeftIcon, ChevronRightIcon } from "@chakra-ui/icons"; | ||
import { Link } from "react-router-dom"; | ||
|
||
interface IBreadcrumbItemData { | ||
label: string; | ||
// eslint-disable-next-line react/require-default-props | ||
linkPath?: string; | ||
} | ||
|
||
interface IBreadcrumbNavigationProps { | ||
items: IBreadcrumbItemData[]; | ||
} | ||
|
||
export function MobileBreadcrumbButton({ label, linkPath }: IBreadcrumbItemData) { | ||
return ( | ||
<Button | ||
variant="outline" | ||
color="black" | ||
borderColor="black" | ||
as={Link} | ||
to={linkPath ?? "#"} | ||
border="2px" | ||
borderRadius={0} | ||
mb={4} | ||
leftIcon={<ChevronLeftIcon />} | ||
> | ||
{label} | ||
</Button> | ||
); | ||
} | ||
|
||
export function BreadcrumbNavigation({ items }: IBreadcrumbNavigationProps) { | ||
const { globalPreferences } = useContext(GlobalPreferencesContext); | ||
const orgName = globalPreferences.organisation?.name; | ||
const baseName = globalPreferences.selectedBase?.name; | ||
return ( | ||
<Breadcrumb separator={<ChevronRightIcon />} fontSize="md" mb={4}> | ||
<BreadcrumbItem> | ||
<BreadcrumbLink as={Link} to="#"> | ||
{orgName} | ||
</BreadcrumbLink> | ||
</BreadcrumbItem> | ||
<BreadcrumbItem> | ||
<BreadcrumbLink as={Link} to="#"> | ||
{baseName} | ||
</BreadcrumbLink> | ||
</BreadcrumbItem> | ||
{items.map((item) => ( | ||
<BreadcrumbItem key={`breadcrumb${item.label}`}> | ||
<BreadcrumbLink as={Link} to={item.linkPath ?? "#"}> | ||
{item.label} | ||
</BreadcrumbLink> | ||
</BreadcrumbItem> | ||
))} | ||
</Breadcrumb> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.