-
Notifications
You must be signed in to change notification settings - Fork 15
feat: improve appearing controls styles #1436
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,5 @@ | ||
.developer-ui-link-button { | ||
display: none; | ||
|
||
&_visible { | ||
display: inline-block; | ||
} | ||
@import '../../styles/mixins.scss'; | ||
|
||
.data-table__row:hover &, | ||
.ydb-paginated-table__row:hover & { | ||
display: inline-block; | ||
} | ||
.developer-ui-link-button { | ||
@include table-hover-appearing-button(); | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,45 @@ | ||
import {ArrowUpRightFromSquare} from '@gravity-ui/icons'; | ||
import type {ButtonSize} from '@gravity-ui/uikit'; | ||
import {Button, Icon} from '@gravity-ui/uikit'; | ||
|
||
import {cn} from '../../utils/cn'; | ||
|
||
import i18n from './i18n'; | ||
|
||
import './DeveloperUILinkButton.scss'; | ||
|
||
const b = cn('developer-ui-link-button'); | ||
|
||
const buttonSizeToIconSize: Record<ButtonSize, number> = { | ||
xs: 14, | ||
s: 16, | ||
m: 16, | ||
l: 18, | ||
xl: 18, | ||
}; | ||
|
||
interface DeveloperUiLinkProps { | ||
className?: string; | ||
visible?: boolean; | ||
href: string; | ||
size?: ButtonSize; | ||
} | ||
|
||
export function DeveloperUILinkButton({href, visible = false, className}: DeveloperUiLinkProps) { | ||
export function DeveloperUILinkButton({ | ||
href, | ||
visible = false, | ||
className, | ||
size = 's', | ||
}: DeveloperUiLinkProps) { | ||
return ( | ||
<Button size="s" href={href} className={b({visible}, className)} target="_blank"> | ||
<Icon data={ArrowUpRightFromSquare} /> | ||
<Button | ||
size={size} | ||
href={href} | ||
className={b({visible}, className)} | ||
target="_blank" | ||
title={i18n('action_go-to', {href})} | ||
> | ||
<Icon data={ArrowUpRightFromSquare} size={buttonSizeToIconSize[size]} /> | ||
</Button> | ||
); | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"action_go-to": "Go to {{href}}" | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import {registerKeysets} from '../../../utils/i18n'; | ||
|
||
import en from './en.json'; | ||
|
||
const COMPONENT = 'ydb-developer-ui-button'; | ||
|
||
export default registerKeysets(COMPONENT, {en}); |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,7 @@ | ||
import {Link as UIKitLink} from '@gravity-ui/uikit'; | ||
import {ClipboardButton, Link as UIKitLink} from '@gravity-ui/uikit'; | ||
|
||
import {EFlag} from '../../types/api/enums'; | ||
import {cn} from '../../utils/cn'; | ||
import {ClipboardButton} from '../ClipboardButton'; | ||
import {InternalLink} from '../InternalLink/InternalLink'; | ||
import {StatusIcon} from '../StatusIcon/StatusIcon'; | ||
import type {StatusIconMode, StatusIconSize} from '../StatusIcon/StatusIcon'; | ||
|
@@ -95,18 +94,21 @@ export function EntityStatus({ | |
</span> | ||
)} | ||
<span className={b('link', {'with-left-trim': withLeftTrim})}>{renderLink()}</span> | ||
{hasClipboardButton && ( | ||
<ClipboardButton | ||
text={name} | ||
size="s" | ||
className={b('clipboard-button', { | ||
visible: clipboardButtonAlwaysVisible, | ||
})} | ||
/> | ||
)} | ||
{additionalControls && ( | ||
<span className={b('additional-controls ')}>{additionalControls}</span> | ||
)} | ||
<div className={b('controls-wrapper')}> | ||
{hasClipboardButton && ( | ||
<ClipboardButton | ||
text={name} | ||
size="xs" | ||
view="normal" | ||
className={b('clipboard-button', { | ||
visible: clipboardButtonAlwaysVisible, | ||
})} | ||
/> | ||
)} | ||
{additionalControls && ( | ||
<span className={b('additional-controls')}>{additionalControls}</span> | ||
)} | ||
</div> | ||
Comment on lines
+108
to
+110
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Lets try the hardest way number 1. I hope I've found a solution. |
||
</div> | ||
); | ||
} |
Uh oh!
There was an error while loading. Please reload this page.
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.
I suppose we can use Button Icons as here
and icon size should be set automatically according to button size
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.
Discussed with uikit team, button doesn't affect it's icon size. We should explicitly set icon size we want.