Centering card groups on mobile.

This commit is contained in:
Roland 2022-01-31 09:53:17 -07:00
parent 723d9863bf
commit 8d93268552
No known key found for this signature in database
GPG key ID: 9D6DBD3ACF11AB93
3 changed files with 22 additions and 13 deletions

View file

@ -147,11 +147,11 @@ export function VideoCard({video}) {
export function VideoCards({videos}) {
return (
<Card.Group>
<CardGroupCentered>
{videos.map((v) => {
return <VideoCard key={v['id']} video={v}/>
})}
</Card.Group>
</CardGroupCentered>
)
}
@ -506,14 +506,6 @@ export function changePageHistory(history, location, activePage, searchStr, sear
scrollToTop();
}
export function objectToQuery(d) {
// Return an HTTP query string based on the provided dictionary.
// Do not include key/values when the value is null if noNull=true
let arr = Object.keys(d).map((k) => d[k] === null ? '' : `${k}=${d[k]}`);
arr = arr.filter((i) => i !== '')
return arr.join('&');
}
export function ClearButton({onClick, style, label, icon = 'close'}) {
return <Button icon
labelPosition='right'
@ -669,3 +661,20 @@ export function PageContainer(props) {
</>
)
}
export function CardGroupCentered(props) {
return (
<>
<Responsive minWidth={770}>
<Card.Group>
{props.children}
</Card.Group>
</Responsive>
<Responsive maxWidth={769}>
<Card.Group centered>
{props.children}
</Card.Group>
</Responsive>
</>
)
}