mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2025-02-16 17:25:58 +00:00
Change default Sort order for Gallery to MostRecent & fix gallery card height for empty tags (#545)
This commit is contained in:
parent
6582d3be37
commit
3eda8029ba
@ -47,6 +47,7 @@ export class GalleryCardComponent extends React.Component<GalleryCardComponentPr
|
|||||||
private static readonly cardItemGapBig = 10;
|
private static readonly cardItemGapBig = 10;
|
||||||
private static readonly cardItemGapSmall = 8;
|
private static readonly cardItemGapSmall = 8;
|
||||||
private static readonly cardDeleteSpinnerHeight = 360;
|
private static readonly cardDeleteSpinnerHeight = 360;
|
||||||
|
private static readonly smallTextLineHeight = 18;
|
||||||
|
|
||||||
constructor(props: GalleryCardComponentProps) {
|
constructor(props: GalleryCardComponentProps) {
|
||||||
super(props);
|
super(props);
|
||||||
@ -103,7 +104,7 @@ export class GalleryCardComponent extends React.Component<GalleryCardComponentPr
|
|||||||
</Card.Item>
|
</Card.Item>
|
||||||
|
|
||||||
<Card.Section styles={{ root: { padding: GalleryCardComponent.cardItemGapBig } }}>
|
<Card.Section styles={{ root: { padding: GalleryCardComponent.cardItemGapBig } }}>
|
||||||
<Text variant="small" nowrap>
|
<Text variant="small" nowrap styles={{ root: { height: GalleryCardComponent.smallTextLineHeight } }}>
|
||||||
{this.props.data.tags ? (
|
{this.props.data.tags ? (
|
||||||
this.props.data.tags.map((tag, index, array) => (
|
this.props.data.tags.map((tag, index, array) => (
|
||||||
<span key={tag}>
|
<span key={tag}>
|
||||||
@ -129,7 +130,7 @@ export class GalleryCardComponent extends React.Component<GalleryCardComponentPr
|
|||||||
{cardTitle}
|
{cardTitle}
|
||||||
</Text>
|
</Text>
|
||||||
|
|
||||||
<Text variant="small" styles={{ root: { height: 36 } }}>
|
<Text variant="small" styles={{ root: { height: GalleryCardComponent.smallTextLineHeight * 2 } }}>
|
||||||
{this.renderTruncatedDescription()}
|
{this.renderTruncatedDescription()}
|
||||||
</Text>
|
</Text>
|
||||||
|
|
||||||
|
@ -50,6 +50,13 @@ exports[`GalleryCardComponent renders 1`] = `
|
|||||||
>
|
>
|
||||||
<Text
|
<Text
|
||||||
nowrap={true}
|
nowrap={true}
|
||||||
|
styles={
|
||||||
|
Object {
|
||||||
|
"root": Object {
|
||||||
|
"height": 18,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
variant="small"
|
variant="small"
|
||||||
>
|
>
|
||||||
<span
|
<span
|
||||||
|
@ -36,7 +36,7 @@ export default class GalleryTab extends TabsBase {
|
|||||||
galleryItem: options.galleryItem,
|
galleryItem: options.galleryItem,
|
||||||
isFavorite: options.isFavorite,
|
isFavorite: options.isFavorite,
|
||||||
selectedTab: options.selectedTab,
|
selectedTab: options.selectedTab,
|
||||||
sortBy: SortBy.MostViewed,
|
sortBy: SortBy.MostRecent,
|
||||||
searchText: undefined,
|
searchText: undefined,
|
||||||
};
|
};
|
||||||
this.galleryAndNotebookViewerComponentAdapter = new GalleryAndNotebookViewerComponentAdapter(
|
this.galleryAndNotebookViewerComponentAdapter = new GalleryAndNotebookViewerComponentAdapter(
|
||||||
|
@ -27,7 +27,7 @@ const onInit = async () => {
|
|||||||
const props: GalleryAndNotebookViewerComponentProps = {
|
const props: GalleryAndNotebookViewerComponentProps = {
|
||||||
junoClient: new JunoClient(),
|
junoClient: new JunoClient(),
|
||||||
selectedTab: galleryViewerProps.selectedTab || GalleryTab.PublicGallery,
|
selectedTab: galleryViewerProps.selectedTab || GalleryTab.PublicGallery,
|
||||||
sortBy: galleryViewerProps.sortBy || SortBy.MostViewed,
|
sortBy: galleryViewerProps.sortBy || SortBy.MostRecent,
|
||||||
searchText: galleryViewerProps.searchText,
|
searchText: galleryViewerProps.searchText,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user