Skip to content

Try: make the "primary colum" clickable #103277

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

Draft
wants to merge 1 commit into
base: trunk
Choose a base branch
from
Draft
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
8 changes: 2 additions & 6 deletions client/dashboard/sites/index.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { DataViews, filterSortAndPaginate } from '@automattic/dataviews';
import { useQuery } from '@tanstack/react-query';
import { useNavigate } from '@tanstack/react-router';
import { Button, ExternalLink } from '@wordpress/components';
import { Button } from '@wordpress/components';
import { useResizeObserver } from '@wordpress/compose';
import { __ } from '@wordpress/i18n';
import { Icon, check } from '@wordpress/icons';
Expand Down Expand Up @@ -41,11 +41,7 @@ const DEFAULT_FIELDS: Field< Site >[] = [
id: 'URL',
label: __( 'URL' ),
enableGlobalSearch: true,
render: ( { item }: { item: Site } ) => (
<ExternalLink href={ item.URL } style={ { overflowWrap: 'anywhere' } }>
{ new URL( item.URL ).hostname }
</ExternalLink>
),
getValue: ( { item } ) => new URL( item.URL ).hostname,
},
{
id: 'icon.ico',
Expand Down
1 change: 0 additions & 1 deletion client/dashboard/sites/site-icon/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
background-color: #f5f7f7;
border: 1px solid #eee;
color: var(--wp-admin-theme-color);
cursor: default;
display: flex;
flex-shrink: 0;
font-size: 24px;
Expand Down
10 changes: 7 additions & 3 deletions packages/dataviews/src/components/dataviews/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -88,11 +88,15 @@
}
}

.dataviews-title-field--clickable {
.dataviews-column-primary--clickable {
cursor: pointer;
color: $gray-800;
.dataviews-title-field {
color: $gray-800;
}
&:hover {
color: var(--wp-admin-theme-color);
.dataviews-title-field {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we flatten this to &:hover .dataviews-title-field?

color: var(--wp-admin-theme-color);
}
}
@include link-reset();
}
Original file line number Diff line number Diff line change
Expand Up @@ -33,19 +33,18 @@ function ColumnPrimary< Item >( {
item,
isItemClickable,
onClickItem,
className:
'dataviews-view-table__cell-content-wrapper dataviews-title-field',
className: 'dataviews-column-primary',
} );
return (
<HStack spacing={ 3 } justify="flex-start">
<HStack spacing={ 3 } justify="flex-start" { ...clickableProps }>
{ mediaField && (
<div className="dataviews-view-table__cell-content-wrapper dataviews-column-primary__media">
<mediaField.render item={ item } field={ mediaField } />
</div>
) }
<VStack spacing={ 0 }>
{ titleField && (
<div { ...clickableProps }>
<div className="dataviews-view-table__cell-content-wrapper dataviews-title-field">
{ level !== undefined && (
<span className="dataviews-view-table__level">
{ '—'.repeat( level ) }&nbsp;
Expand Down
Loading