posts: factor out post gallery component.

Factor out thumbnail galleries into a PostGallery component.

This changes the html structure so that post galleries on all pages are
always wrapped in a `.posts-container` class. This fixes an issue with
thumbnails on the pool show page not being aligned correctly on mobile,
like they are on the post index page. This also affected thumbnail
galleries on other pages, like wiki pages and user profiles.
This commit is contained in:
evazion
2021-11-22 20:46:04 -06:00
parent 15657aad6d
commit 74e28e14b8
17 changed files with 147 additions and 97 deletions

View File

@@ -32,25 +32,9 @@
}
#has-parent-relationship-preview, #has-children-relationship-preview {
overflow-x: auto;
white-space: nowrap;
article.post-preview {
width: auto;
height: auto;
margin: 0.5rem 0;
padding: 0.5rem;
overflow: hidden;
vertical-align: top;
article.post-preview.current-post {
border-radius: 0.25rem;
&.current-post {
background-color: var(--preview-selected-color);
}
img {
white-space: normal;
}
background-color: var(--preview-selected-color);
}
}

View File

@@ -40,14 +40,4 @@
}
}
}
.posts-container {
display: grid;
grid-template-columns: repeat(3, minmax(0, 1fr));
gap: 0.25rem;
&.user-disable-cropped-false article.post-preview img.has-cropped-true {
object-fit: none;
}
}
}