Skip to content

Commit

Permalink
fix: use folder material design icon
Browse files Browse the repository at this point in the history
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
  • Loading branch information
skjnldsv committed May 30, 2024
1 parent ec645b1 commit d434231
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 1 deletion.
11 changes: 11 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
"@nextcloud/vue-dashboard": "^2.0.1",
"lodash": "^4.17.21",
"vue": "^2.7.16",
"vue-material-design-icons": "^5.3.0",
"vuex": "^3.6.2"
},
"devDependencies": {
Expand Down
21 changes: 20 additions & 1 deletion src/components/RecommendedFile.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@
@click.prevent="navigate"
@keyup.enter.prevent="navigate">
<div class="thumbnail"
:style="{ 'background-image': 'url(' + previewUrl + ')' }" />
:style="{ 'background-image': isFolder ? '' : 'url(' + previewUrl + ')' }">
<FolderIcon v-if="isFolder" />
</div>
<div class="details">
<div class="file-name">
<template v-if="extension">
Expand All @@ -37,8 +39,15 @@ import { translate as t } from '@nextcloud/l10n'
import { generateUrl } from '@nextcloud/router'
import { joinPaths } from '@nextcloud/paths'
import FolderIcon from 'vue-material-design-icons/Folder.vue'
export default {
name: 'RecommendedFile',
components: {
FolderIcon,
},
props: {
id: {
type: String,
Expand Down Expand Up @@ -163,6 +172,16 @@ export default {
background-size: contain;
flex-shrink: 0;
border-radius: var(--border-radius);
display: flex;
justify-content: center;
align-items: center;
:deep(.material-design-icon.folder-icon) {
&, svg {
width: 100%;
height: 100%;
color: var(--color-primary-element);
}
}
}
.details {
Expand Down

0 comments on commit d434231

Please sign in to comment.