Skip to content

Commit

Permalink
TeamList: move field.width to layout.styles.fieldId.width
Browse files Browse the repository at this point in the history
  • Loading branch information
oandregal committed Aug 26, 2024
1 parent e6653e2 commit 4e3bc78
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,5 @@ export interface DataViewsSort {

export type DataViewsState = View & {
selectedItem?: any | undefined;
layout?: any; // TODO: improve this type.
};
12 changes: 10 additions & 2 deletions client/a8c-for-agencies/sections/team/primary/team-list/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,16 @@ export default function TeamList() {

const isDesktop = useDesktopBreakpoint();

const [ dataViewsState, setDataViewsState ] = useState< DataViewsState >( initialDataViewsState );
const [ dataViewsState, setDataViewsState ] = useState< DataViewsState >( {
...initialDataViewsState,
layout: {
styles: {
actions: {
width: isDesktop ? '10%' : undefined,
},
},
},
} );

const title = translate( 'Manage team members' );

Expand Down Expand Up @@ -86,7 +95,6 @@ export default function TeamList() {
/>
);
},
width: isDesktop ? '40%' : undefined,
enableHiding: false,
enableSorting: false,
},
Expand Down

0 comments on commit 4e3bc78

Please sign in to comment.