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: skjnldsv <skjnldsv@protonmail.com>
  • Loading branch information
skjnldsv committed May 30, 2024
1 parent a5e48bf commit d990265
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 24 deletions.
4 changes: 2 additions & 2 deletions js/recommendations-main.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js/recommendations-main.js.map

Large diffs are not rendered by default.

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 @@ -32,6 +32,7 @@
"@nextcloud/vue": "^8.9.1",
"lodash": "^4.17.21",
"vue": "^2.7.16",
"vue-material-design-icons": "^5.3.0",
"vuex": "^3.6.2"
},
"devDependencies": {
Expand Down
45 changes: 24 additions & 21 deletions src/components/RecommendedFile.vue
Original file line number Diff line number Diff line change
@@ -1,23 +1,7 @@
<!--
- @copyright 2019 Christoph Wurst <christoph@winzerhof-wurst.at>
-
- @author 2019 Christoph Wurst <christoph@winzerhof-wurst.at>
-
- @license GNU AGPL version 3 or any later version
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU Affero General Public License as
- published by the Free Software Foundation, either version 3 of the
- License, or (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU Affero General Public License for more details.
-
- You should have received a copy of the GNU Affero General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
- SPDX-FileCopyrightText: 2019 Nextcloud GmbH and Nextcloud contributors
- SPDX-License-Identifier: AGPL-3.0-or-later
-->

<template>
<a class="recommendation"
Expand All @@ -26,8 +10,11 @@
:title="path"
@click.prevent="navigate"
@keyup.enter.prevent="navigate">
<div class="thumbnail"
:style="{ 'background-image': 'url(' + previewUrl + ')' }" />
<!-- Preview or mime icon -->
<FolderIcon v-if="isFolder" class="thumbnail" />
<div v-else class="thumbnail" :style="{ 'background-image': 'url(' + previewUrl + ')' }" />

<!-- Details -->
<div class="details">
<div class="file-name">
<template v-if="extension">
Expand All @@ -53,8 +40,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 @@ -179,6 +173,15 @@ export default {
background-size: contain;
flex-shrink: 0;
border-radius: var(--border-radius);
display: flex;
justify-content: center;
align-items: center;
// For the folder icon
:deep(svg) {
color: var(--color-primary-element);
width: 100%;
height: 100%;
}
}
.details {
Expand Down

0 comments on commit d990265

Please sign in to comment.