-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add bradcrumb to issue listing
Close #1014
- Loading branch information
1 parent
c46d8de
commit e0f8b3d
Showing
5 changed files
with
58 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import type { MessageDescriptor } from 'react-intl'; | ||
import { FormattedMessage } from 'react-intl'; | ||
|
||
import { memo, type JSX } from 'react'; | ||
|
||
import type { LinkProps } from '@tanstack/react-router'; | ||
|
||
import { | ||
Breadcrumb, | ||
BreadcrumbItem, | ||
BreadcrumbLink, | ||
BreadcrumbList, | ||
BreadcrumbPage, | ||
BreadcrumbSeparator, | ||
} from './Breadcrumb'; | ||
|
||
const IssueBreadcrumb = ({ | ||
searchParams, | ||
locationMessage, | ||
}: { | ||
searchParams: LinkProps['search']; | ||
locationMessage: MessageDescriptor['id']; | ||
}): JSX.Element => { | ||
return ( | ||
<Breadcrumb className="pt-6 pb-6"> | ||
<BreadcrumbList> | ||
<BreadcrumbItem> | ||
<BreadcrumbLink to="/issues" search={searchParams}> | ||
<FormattedMessage id="issue.path" /> | ||
</BreadcrumbLink> | ||
</BreadcrumbItem> | ||
<BreadcrumbSeparator /> | ||
<BreadcrumbItem> | ||
<BreadcrumbPage> | ||
<FormattedMessage id={locationMessage} /> | ||
</BreadcrumbPage> | ||
</BreadcrumbItem> | ||
</BreadcrumbList> | ||
</Breadcrumb> | ||
); | ||
}; | ||
export const MemoizedIssueBreadcrumb = memo(IssueBreadcrumb); |
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