Skip to content

Commit

Permalink
Make tiles on non-projects views smaller by default
Browse files Browse the repository at this point in the history
  • Loading branch information
pascalwengerter committed Jan 16, 2023
1 parent 06cd00e commit e4f086d
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 5 deletions.
25 changes: 20 additions & 5 deletions packages/web-app-files/src/components/FilesList/ResourceTiles.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
<template>
<div>
<oc-list class="oc-tiles oc-flex">
<li v-for="(resource, index) in data" :key="resource.id" class="oc-tiles-item">
<li
v-for="(resource, index) in data"
:key="resource.id"
class="oc-tiles-item"
:class="tileWidth === 'small' ? 'small-tiles' : ''"
>
<oc-tile
:ref="
(el) => {
Expand Down Expand Up @@ -83,6 +88,10 @@ export default defineComponent({
data: {
type: Array as PropType<Resource[]>,
default: () => []
},
tileWidth: {
type: String,
default: ''
}
},
emits: ['fileClick', 'rowMounted'],
Expand Down Expand Up @@ -187,12 +196,18 @@ export default defineComponent({

<style lang="scss" scoped>
.oc-tiles {
flex-wrap: wrap;
gap: 15px;
justify-content: flex-start;
column-gap: 8px;
display: grid;
grid-template-columns: repeat(auto-fill, 160px);
justify-content: space-between;
row-gap: 32px;
.oc-tiles-item {
width: 252px;
width: 18rem;
&.small-tiles {
width: 12rem;
}
@media (max-width: $oc-breakpoint-xsmall-max) {
width: 100%;
Expand Down
1 change: 1 addition & 0 deletions packages/web-app-files/src/views/spaces/GenericSpace.vue
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
v-else-if="viewMode === ViewModeConstants.tilesView.name"
:data="paginatedResources"
class="oc-px-m oc-pt-l"
tile-width="small"
@rowMounted="rowMounted"
@fileClick="$_fileActions_triggerDefaultAction"
>
Expand Down

0 comments on commit e4f086d

Please sign in to comment.