mirror of
https://github.com/jeffvli/feishin.git
synced 2026-05-09 20:29:36 +02:00
add compact styling to LibraryHeader
This commit is contained in:
@@ -93,6 +93,7 @@ export const PlaylistDetailSongListHeader = ({
|
|||||||
</PageHeader>
|
</PageHeader>
|
||||||
) : (
|
) : (
|
||||||
<LibraryHeader
|
<LibraryHeader
|
||||||
|
compact
|
||||||
imageUrl={imageUrl}
|
imageUrl={imageUrl}
|
||||||
item={{
|
item={{
|
||||||
imageId: detailQuery?.data?.imageId,
|
imageId: detailQuery?.data?.imageId,
|
||||||
|
|||||||
@@ -56,6 +56,52 @@
|
|||||||
height: 250px;
|
height: 250px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
&.compact {
|
||||||
|
min-height: unset;
|
||||||
|
padding: var(--theme-spacing-md) var(--theme-spacing-xs);
|
||||||
|
|
||||||
|
:global(.item-image-placeholder) {
|
||||||
|
width: 250px !important;
|
||||||
|
height: 250px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.image {
|
||||||
|
width: 250px !important;
|
||||||
|
height: 250px;
|
||||||
|
}
|
||||||
|
|
||||||
|
@container (min-width: $mantine-breakpoint-sm) {
|
||||||
|
grid-template-columns: 200px minmax(0, 1fr);
|
||||||
|
min-height: unset;
|
||||||
|
padding: var(--theme-spacing-md) var(--theme-spacing-sm);
|
||||||
|
|
||||||
|
.image {
|
||||||
|
width: 200px !important;
|
||||||
|
height: 200px;
|
||||||
|
}
|
||||||
|
|
||||||
|
:global(.item-image-placeholder) {
|
||||||
|
width: 200px !important;
|
||||||
|
height: 200px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@container (min-width: $mantine-breakpoint-lg) {
|
||||||
|
grid-template-columns: 200px minmax(0, 1fr);
|
||||||
|
padding: var(--theme-spacing-md) var(--theme-spacing-md);
|
||||||
|
|
||||||
|
.image {
|
||||||
|
width: 200px !important;
|
||||||
|
height: 200px;
|
||||||
|
}
|
||||||
|
|
||||||
|
:global(.item-image-placeholder) {
|
||||||
|
width: 200px !important;
|
||||||
|
height: 200px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.image-section {
|
.image-section {
|
||||||
|
|||||||
@@ -32,6 +32,7 @@ import { Play } from '/@/shared/types/types';
|
|||||||
|
|
||||||
interface LibraryHeaderProps {
|
interface LibraryHeaderProps {
|
||||||
children?: ReactNode;
|
children?: ReactNode;
|
||||||
|
compact?: boolean;
|
||||||
containerClassName?: string;
|
containerClassName?: string;
|
||||||
imagePlaceholderUrl?: null | string;
|
imagePlaceholderUrl?: null | string;
|
||||||
imageUrl?: null | string;
|
imageUrl?: null | string;
|
||||||
@@ -49,7 +50,7 @@ interface LibraryHeaderProps {
|
|||||||
|
|
||||||
export const LibraryHeader = forwardRef(
|
export const LibraryHeader = forwardRef(
|
||||||
(
|
(
|
||||||
{ children, containerClassName, imageUrl, item, title }: LibraryHeaderProps,
|
{ children, compact, containerClassName, imageUrl, item, title }: LibraryHeaderProps,
|
||||||
ref: Ref<HTMLDivElement>,
|
ref: Ref<HTMLDivElement>,
|
||||||
) => {
|
) => {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
@@ -125,7 +126,14 @@ export const LibraryHeader = forwardRef(
|
|||||||
}, [item.explicitStatus, item.imageId, item.type]);
|
}, [item.explicitStatus, item.imageId, item.type]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={clsx(styles.libraryHeader, containerClassName)} ref={ref}>
|
<div
|
||||||
|
className={clsx(
|
||||||
|
styles.libraryHeader,
|
||||||
|
containerClassName,
|
||||||
|
compact && styles.compact,
|
||||||
|
)}
|
||||||
|
ref={ref}
|
||||||
|
>
|
||||||
<div
|
<div
|
||||||
className={styles.imageSection}
|
className={styles.imageSection}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
|
|||||||
Reference in New Issue
Block a user