-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ebf880e
commit c62ce93
Showing
11 changed files
with
201 additions
and
14 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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 |
---|---|---|
|
@@ -12,6 +12,7 @@ | |
|
||
.HistoryUserBadge { | ||
position: relative; | ||
vertical-align: text-bottom; | ||
bottom: -7px; | ||
} | ||
|
||
|
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,9 @@ | ||
.InlineUserBadge { | ||
vertical-align: middle; | ||
padding-right: 0; | ||
padding-top: 0; | ||
} | ||
|
||
.InlineUserBadge:first-child { | ||
padding-left: 0; | ||
} |
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,26 @@ | ||
import { ComponentProps, FC, useRef } from 'react'; | ||
import { Tooltip } from '@taskany/bricks/harmony'; | ||
import { nullable } from '@taskany/bricks'; | ||
|
||
import { UserBadge } from '../UserBadge/UserBadge'; | ||
|
||
import s from './InlineUserBadge.module.css'; | ||
|
||
interface InlineUserBadgeProps extends ComponentProps<typeof UserBadge> { | ||
tooltip?: string; | ||
} | ||
|
||
export const InlineUserBadge: FC<InlineUserBadgeProps> = ({ tooltip, ...props }) => { | ||
const badgeRef = useRef<HTMLDivElement>(null); | ||
|
||
return ( | ||
<> | ||
<UserBadge ref={badgeRef} className={s.InlineUserBadge} as="span" {...props} /> | ||
{nullable(tooltip, (t) => ( | ||
<Tooltip arrow reference={badgeRef} placement="top"> | ||
{t} | ||
</Tooltip> | ||
))} | ||
</> | ||
); | ||
}; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
const crewLinkRegExp = new RegExp(`^${process.env.NEXT_PUBLIC_CREW_URL}(ru/|en/)?(?<login>[^/]+)/?$`); | ||
|
||
export const parseCrewLink = (link: string): string => { | ||
return link.match(crewLinkRegExp)?.groups?.login ?? ''; | ||
}; |