mirror of
https://github.com/chenasraf/cospend-nc.git
synced 2026-05-17 17:38:10 +00:00
fix search fallback icon [skip ci]
Signed-off-by: Julien Veyssier <eneiluj@posteo.net>
This commit is contained in:
9
css/cospend-search.css
Normal file
9
css/cospend-search.css
Normal file
@@ -0,0 +1,9 @@
|
||||
.icon-cospend-search-fallback {
|
||||
background-image: url(./../img/app_black.svg);
|
||||
filter: var(--background-invert-if-dark);
|
||||
}
|
||||
|
||||
/* for NC <= 24 */
|
||||
body.theme--dark .icon-cospend-search-fallback {
|
||||
background-image: url(./../img/app.svg);
|
||||
}
|
||||
@@ -20,6 +20,7 @@ use OCP\Notification\IManager as INotificationManager;
|
||||
use OCA\Cospend\Search\CospendSearchProvider;
|
||||
use OCA\Cospend\Dashboard\CospendWidget;
|
||||
use OCA\Cospend\Notification\Notifier;
|
||||
use OCP\Util;
|
||||
|
||||
/**
|
||||
* Class Application
|
||||
@@ -91,7 +92,7 @@ class Application extends App implements IBootstrap {
|
||||
}
|
||||
|
||||
public function boot(IBootContext $context): void {
|
||||
Util::addStyle(self::APP_ID, 'cospend-search');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -124,11 +124,6 @@ class CospendSearchProvider implements IProvider {
|
||||
$offset = $query->getCursor();
|
||||
$offset = $offset ? (int) $offset : 0;
|
||||
|
||||
$theme = $this->config->getUserValue($user->getUID(), 'accessibility', 'theme');
|
||||
$thumbnailUrl = ($theme === 'dark') ?
|
||||
$this->urlGenerator->imagePath('cospend', 'app.svg') :
|
||||
$this->urlGenerator->imagePath('cospend', 'app_black.svg');
|
||||
|
||||
$resultBills = [];
|
||||
|
||||
// get user's projects
|
||||
@@ -154,15 +149,15 @@ class CospendSearchProvider implements IProvider {
|
||||
$resultBills = array_slice($resultBills, $offset, $limit);
|
||||
|
||||
// build formatted
|
||||
$formattedResults = array_map(function (array $bill) use ($projectsById, $thumbnailUrl):CospendSearchResultEntry {
|
||||
$formattedResults = array_map(function (array $bill) use ($projectsById):CospendSearchResultEntry {
|
||||
$projectId = $bill['projectId'];
|
||||
// $projectName = $projectsById[$projectId]['name'];
|
||||
return new CospendSearchResultEntry(
|
||||
$thumbnailUrl,
|
||||
'',
|
||||
$this->getMainText($bill, $projectsById[$projectId]),
|
||||
$this->getSubline($bill, $projectsById[$projectId]),
|
||||
$this->getDeepLinkToCospendApp($projectId, $bill['id']),
|
||||
'',
|
||||
'icon-cospend-search-fallback',
|
||||
false
|
||||
);
|
||||
}, $resultBills);
|
||||
|
||||
Reference in New Issue
Block a user