Skip to content
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

PORTALS-3177: Minor improvements to UI of Explore Slats in Portals #1490

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ import {
export const explorePageRoutes: RouteObject[] = [
{
path: 'Programs',
element: <CardContainerLogic {...programs} sql={programsSql} />,
element: (
<CardContainerLogic {...programs} sql={programsSql} compact={true} />
),
},
{
path: 'Projects',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@ export type CardContainerLogicProps = {
lockedColumn?: LockedColumn
initialLimit?: number
multiCardList?: boolean
compact?: boolean
} & CardConfiguration &
Pick<
QueryVisualizationWrapperProps,
Expand Down Expand Up @@ -245,6 +246,7 @@ export function CardContainerLogic(props: CardContainerLogicProps) {
cardConfiguration={props}
initialLimit={props.initialLimit}
multiCardList={props.multiCardList}
compact={props.compact}
/>
</QueryWrapperErrorBoundary>
</QueryVisualizationWrapper>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ export type RowSetViewProps = {
initialLimit?: number
hideDownload?: boolean
multiCardList?: boolean
compact?: boolean
}

/**
Expand All @@ -27,7 +28,13 @@ export type RowSetViewProps = {
* @constructor
*/
export function RowSetView(props: RowSetViewProps) {
const { cardConfiguration, hideDownload, initialLimit, multiCardList } = props
const {
cardConfiguration,
hideDownload,
initialLimit,
multiCardList,
compact,
} = props

const [initialLimitIsApplied, setInitialLimitIsApplied] = useState(
initialLimit != null,
Expand All @@ -54,7 +61,35 @@ export function RowSetView(props: RowSetViewProps) {

return (
<SynapseErrorBoundary>
<div className={`RowSetView`}>
<Box
className={`RowSetView`}
sx={theme => ({
...(compact && {
'& .SRC-imageThumbnail': {
display: 'flex',
alignItems: 'center',
maxWidth: '80px',
},
[theme.breakpoints.up('md')]: {
'& > div': {
display: 'grid',
gridTemplateColumns: 'repeat(2, 1fr)',
gap: '30px',
marginTop: '30px',
},
'& .SRC-portalCard': {
margin: '0',
},
},
[theme.breakpoints.up('xl')]: {
'& > div': {
display: 'grid',
gridTemplateColumns: 'repeat(3, 1fr)',
},
},
}),
})}
>
{isLoading && (
<QueryWrapperLoadingScreen progressMessage={progressMessage} />
)}
Expand Down Expand Up @@ -103,7 +138,7 @@ export function RowSetView(props: RowSetViewProps) {
)}
</Suspense>
<LastUpdatedOn />
</div>
</Box>
</SynapseErrorBoundary>
)
}
Loading