-
Notifications
You must be signed in to change notification settings - Fork 20
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 #323 from alleslabs/feat/breadcrumb
Feat/breadcrumb
- Loading branch information
Showing
16 changed files
with
382 additions
and
307 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
import { | ||
Breadcrumb as ChakraBreadcrumb, | ||
BreadcrumbItem as ChakraBreadcrumbItem, | ||
Text, | ||
} from "@chakra-ui/react"; | ||
|
||
import type { Option } from "lib/types"; | ||
|
||
import { AppLink } from "./AppLink"; | ||
import { CustomIcon } from "./icon"; | ||
|
||
type BreadcrumbItemProps = { | ||
text: Option<string>; | ||
href?: string; | ||
}; | ||
|
||
type BreadcrumbProps = { | ||
items: BreadcrumbItemProps[]; | ||
mb?: number; | ||
}; | ||
|
||
export const Breadcrumb = ({ items, mb = 0 }: BreadcrumbProps) => ( | ||
<ChakraBreadcrumb | ||
w="full" | ||
spacing="4px" | ||
mb={mb} | ||
separator={<CustomIcon name="chevron-right" boxSize={3} color="gray.600" />} | ||
> | ||
{items.map((item) => | ||
item.href ? ( | ||
item.text && ( | ||
<ChakraBreadcrumbItem | ||
_hover={{ opacity: 0.8 }} | ||
transition="all 0.25s ease-in-out" | ||
> | ||
<AppLink color="text.dark" href={item.href}> | ||
{item.text} | ||
</AppLink> | ||
</ChakraBreadcrumbItem> | ||
) | ||
) : ( | ||
<ChakraBreadcrumbItem isCurrentPage> | ||
<Text | ||
variant="body2" | ||
className="ellipsis" | ||
fontWeight={600} | ||
width="250px" | ||
color="text.dark" | ||
> | ||
{item.text} | ||
</Text> | ||
</ChakraBreadcrumbItem> | ||
) | ||
)} | ||
</ChakraBreadcrumb> | ||
); |
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.
2b3734b
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
osmosis-celatone-frontend-staging – ./
osmosis-celatone-frontend-staging-git-develop-alleslabs.vercel.app
osmosis-celatone-frontend-staging-alleslabs.vercel.app
celatone-frontend-staging.vercel.app
celatone-staging.osmosis.zone
osmosis-staging.celat.one