Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/ui/src/components/avatar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export interface AvatarProps extends ComponentPropsWithoutRef<'span'> {
}

const Avatar = forwardRef<HTMLSpanElement, AvatarProps>(
({ name, src, size = 'md', rounded = false, className, ...props }, ref) => {
({ name, src, size = 'sm', rounded = false, className, ...props }, ref) => {
const initials = getInitials(name || '')

return (
Expand Down
8 changes: 6 additions & 2 deletions packages/ui/src/components/branch-tag.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { CopyTag, Link } from '@/components'
import { CopyTag, Link, Tag } from '@/components'

import type { TagProps } from './tag'

Expand All @@ -7,6 +7,7 @@ interface BranchTagProps {
spaceId?: string
repoId?: string
hideBranchIcon?: boolean
hideCopyButton?: boolean
theme?: TagProps['theme']
variant?: TagProps['variant']
size?: TagProps['size']
Expand All @@ -17,13 +18,16 @@ const BranchTag: React.FC<BranchTagProps> = ({
spaceId,
repoId,
hideBranchIcon,
hideCopyButton,
theme = 'gray',
variant = 'secondary',
size = 'md'
}) => {
const TagComponent = hideCopyButton ? Tag : CopyTag

return (
<Link noHoverUnderline to={`${spaceId ? `/${spaceId}` : ''}/repos/${repoId}/files/${branchName}`}>
<CopyTag
<TagComponent
variant={variant}
theme={theme}
size={size}
Expand Down
2 changes: 1 addition & 1 deletion packages/ui/src/components/copy-tag.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ type CopyTagProps = TagProps & {
onActionClick?: never
}

export function CopyTag(props: CopyTagProps) {
export function CopyTag({ ...props }: CopyTagProps) {
const { value } = props

const [copied, setCopied] = useState(false)
Expand Down
9 changes: 7 additions & 2 deletions packages/ui/src/components/more-actions-tooltip.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { forwardRef } from 'react'

import { useRouterContext } from '@/context'
import { Button, ButtonVariants } from '@components/button'
import { Button, ButtonProps, ButtonVariants } from '@components/button'
import { DropdownMenu } from '@components/dropdown-menu'
import { IconV2, type IconPropsV2 } from '@components/icon-v2'
import { cn } from '@utils/cn'
Expand All @@ -17,6 +17,7 @@ export interface ActionData {
}

export interface MoreActionsTooltipProps {
theme?: ButtonProps['theme']
actions: ActionData[]
isInTable?: boolean
iconName?: IconPropsV2['name']
Expand All @@ -30,14 +31,18 @@ export interface MoreActionsTooltipProps {
* A component for displaying a button that, when clicked, shows a tooltip with a list of actions.
*/
export const MoreActionsTooltip = forwardRef<HTMLButtonElement, MoreActionsTooltipProps>(
({ actions, iconName = 'more-vert', sideOffset = 2, alignOffset = 0, className, buttonVariant = 'ghost' }, ref) => {
(
{ theme, actions, iconName = 'more-vert', sideOffset = 2, alignOffset = 0, className, buttonVariant = 'ghost' },
ref
) => {
const { Link } = useRouterContext()
if (!actions.length) return <></>

return (
<DropdownMenu.Root>
<DropdownMenu.Trigger ref={ref} asChild>
<Button
theme={theme}
className={cn('text-icons-1 hover:text-icons-2 data-[state=open]:text-icons-2')}
variant={buttonVariant}
iconOnly
Expand Down
2 changes: 1 addition & 1 deletion packages/ui/src/components/text.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ export const textVariants = cva('', {
warning: 'text-cn-warning',
merged: 'text-cn-merged',
danger: 'text-cn-danger',
accent: 'text-cn-brand'
brand: 'text-cn-brand'
},
lineClamp: {
default: '',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ export const PullRequestSideBar: FC<PullRequestSideBarProps> = ({
}) => {
return (
<Layout.Vertical gap="md">
<Layout.Vertical gap="md">
<Layout.Vertical gap="2xs">
<ReviewersHeader
currentUserId={currentUserId}
usersList={usersList}
Expand All @@ -95,7 +95,7 @@ export const PullRequestSideBar: FC<PullRequestSideBarProps> = ({
/>
</Layout.Vertical>
{!isCreatingPr ? (
<Layout.Vertical gap="md">
<Layout.Vertical gap="2xs">
<LabelsHeader
labelsList={labelsList}
labelsValues={labelsValues}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
import { useMemo, useRef } from 'react'

import { Button, DropdownMenu, IconV2, SearchInput, Text, useSearchableDropdownKeyboardNavigation } from '@/components'
import {
Button,
DropdownMenu,
IconV2,
Layout,
SearchInput,
Text,
useSearchableDropdownKeyboardNavigation
} from '@/components'
import { useTranslation } from '@/context'
import { PrincipalType } from '@/types'
import { PRReviewer } from '@/views'
Expand Down Expand Up @@ -46,7 +54,7 @@ const ReviewersHeader = ({
const handleCloseValuesView = useRef(debounce(() => handleSearchQuery(''), 300)).current

return (
<div className="mb-0.5 flex items-center justify-between">
<Layout.Flex align="center" justify="between">
<Text as="h5" variant="body-strong" color="foreground-1">
{t('views:pullRequests.reviewers', 'Reviewers')}
</Text>
Expand Down Expand Up @@ -94,7 +102,7 @@ const ReviewersHeader = ({
})}
</DropdownMenu.Content>
</DropdownMenu.Root>
</div>
</Layout.Flex>
)
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Alert } from '@components/alert'
import { Layout } from '@components/layout'
import { Text } from '@components/text'

import { EnumPullReqReviewDecision, PullReqReviewDecision } from '../../pull-request.types'
Expand Down Expand Up @@ -28,13 +29,13 @@ const ReviewersList: React.FC<ReviewersListProps> = ({
addReviewerError,
removeReviewerError
}) => (
<div className="flex flex-col gap-3">
{addReviewerError || removeReviewerError ? (
<Layout.Vertical gapY="md">
{(addReviewerError || removeReviewerError) && (
<Alert.Root theme="danger">
<Alert.Title>Failed to add reviewer</Alert.Title>
<Alert.Description>{addReviewerError ?? removeReviewerError}</Alert.Description>
</Alert.Root>
) : null}
)}

{reviewers.length ? (
reviewers.map(({ reviewer, review_decision, sha }) => (
Expand All @@ -52,7 +53,7 @@ const ReviewersList: React.FC<ReviewersListProps> = ({
No reviewers
</Text>
)}
</div>
</Layout.Vertical>
)

export { ReviewersList }
Loading