Skip to content

Commit b97a639

Browse files
skjnldsvszaimen
authored andcommitted
fix: use folder material design icon
Signed-off-by: skjnldsv <[email protected]>
1 parent f287ba9 commit b97a639

5 files changed

Lines changed: 39 additions & 24 deletions

File tree

js/recommendations-main.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

js/recommendations-main.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package-lock.json

Lines changed: 11 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
"@nextcloud/vue": "^8.9.1",
3333
"lodash": "^4.17.21",
3434
"vue": "^2.7.16",
35+
"vue-material-design-icons": "^5.3.0",
3536
"vuex": "^3.6.2"
3637
},
3738
"devDependencies": {

src/components/RecommendedFile.vue

Lines changed: 24 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,7 @@
11
<!--
2-
- @copyright 2019 Christoph Wurst <[email protected]>
3-
-
4-
- @author 2019 Christoph Wurst <[email protected]>
5-
-
6-
- @license GNU AGPL version 3 or any later version
7-
-
8-
- This program is free software: you can redistribute it and/or modify
9-
- it under the terms of the GNU Affero General Public License as
10-
- published by the Free Software Foundation, either version 3 of the
11-
- License, or (at your option) any later version.
12-
-
13-
- This program is distributed in the hope that it will be useful,
14-
- but WITHOUT ANY WARRANTY; without even the implied warranty of
15-
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16-
- GNU Affero General Public License for more details.
17-
-
18-
- You should have received a copy of the GNU Affero General Public License
19-
- along with this program. If not, see <http://www.gnu.org/licenses/>.
20-
-->
2+
- SPDX-FileCopyrightText: 2019 Nextcloud GmbH and Nextcloud contributors
3+
- SPDX-License-Identifier: AGPL-3.0-or-later
4+
-->
215

226
<template>
237
<a class="recommendation"
@@ -26,8 +10,11 @@
2610
:title="path"
2711
@click.prevent="navigate"
2812
@keyup.enter.prevent="navigate">
29-
<div class="thumbnail"
30-
:style="{ 'background-image': 'url(' + previewUrl + ')' }" />
13+
<!-- Preview or mime icon -->
14+
<FolderIcon v-if="isFolder" class="thumbnail" />
15+
<div v-else class="thumbnail" :style="{ 'background-image': 'url(' + previewUrl + ')' }" />
16+
17+
<!-- Details -->
3118
<div class="details">
3219
<div class="file-name">
3320
<template v-if="extension">
@@ -53,8 +40,15 @@ import { translate as t } from '@nextcloud/l10n'
5340
import { generateUrl } from '@nextcloud/router'
5441
import { joinPaths } from '@nextcloud/paths'
5542
43+
import FolderIcon from 'vue-material-design-icons/Folder.vue'
44+
5645
export default {
5746
name: 'RecommendedFile',
47+
48+
components: {
49+
FolderIcon,
50+
},
51+
5852
props: {
5953
id: {
6054
type: String,
@@ -179,6 +173,15 @@ export default {
179173
background-size: contain;
180174
flex-shrink: 0;
181175
border-radius: var(--border-radius);
176+
display: flex;
177+
justify-content: center;
178+
align-items: center;
179+
// For the folder icon
180+
:deep(svg) {
181+
color: var(--color-primary-element);
182+
width: 100%;
183+
height: 100%;
184+
}
182185
}
183186
184187
.details {

0 commit comments

Comments
 (0)