分享页: 照片按时间倒序、统一间距、卡片右下角显示日期与城市
This commit is contained in:
@@ -9,7 +9,7 @@ const MediaContainer = styled.div`
|
||||
flex-grow: 1;
|
||||
flex-basis: 0;
|
||||
height: 200px;
|
||||
margin: 4px 2px;
|
||||
margin: 2px;
|
||||
background-color: #eee;
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
@@ -136,9 +136,24 @@ const VideoThumbnailIcon = styled(VideoThumbnailIconSVG)`
|
||||
top: calc(50% - 22px);
|
||||
`
|
||||
|
||||
const Caption = styled.div`
|
||||
position: absolute;
|
||||
right: 6px;
|
||||
bottom: 4px;
|
||||
color: #ffd400;
|
||||
font-size: 12px;
|
||||
font-weight: 600;
|
||||
line-height: 1.2;
|
||||
white-space: nowrap;
|
||||
pointer-events: none;
|
||||
text-shadow: -1px -1px 0 #fff, 1px -1px 0 #fff, -1px 1px 0 #fff,
|
||||
1px 1px 0 #fff, 0 0 2px rgba(0, 0, 0, 0.35);
|
||||
`
|
||||
|
||||
type MediaThumbnailProps = {
|
||||
media: MediaGalleryFields
|
||||
active: boolean
|
||||
caption?: string | null
|
||||
selectImage(): void
|
||||
clickPresent(): void
|
||||
clickFavorite(): void
|
||||
@@ -147,6 +162,7 @@ type MediaThumbnailProps = {
|
||||
export const MediaThumbnail = ({
|
||||
media,
|
||||
active,
|
||||
caption,
|
||||
selectImage,
|
||||
clickPresent,
|
||||
clickFavorite,
|
||||
@@ -181,7 +197,7 @@ export const MediaThumbnail = ({
|
||||
key={media.id}
|
||||
style={{
|
||||
cursor: 'pointer',
|
||||
minWidth: `clamp(124px, ${minWidth}px, 100% - 8px)`,
|
||||
minWidth: `clamp(124px, ${minWidth}px, 100% - 4px)`,
|
||||
}}
|
||||
onClick={() => {
|
||||
clickPresent()
|
||||
@@ -206,6 +222,7 @@ export const MediaThumbnail = ({
|
||||
/>
|
||||
{heartIcon}
|
||||
</PhotoOverlay>
|
||||
{caption && <Caption>{caption}</Caption>}
|
||||
</MediaContainer>
|
||||
)
|
||||
}
|
||||
@@ -214,7 +231,7 @@ export const MediaPlaceholder = styled.div`
|
||||
flex-grow: 1;
|
||||
height: 200px;
|
||||
width: 300px;
|
||||
margin: 4px 2px;
|
||||
margin: 2px;
|
||||
background-color: #eee;
|
||||
position: relative;
|
||||
`
|
||||
|
||||
Reference in New Issue
Block a user