Skip to content

Commit

Permalink
fix(downloads): improve colors and priority
Browse files Browse the repository at this point in the history
  • Loading branch information
fgravin committed Jun 21, 2022
1 parent a0cc599 commit 44e794a
Showing 1 changed file with 21 additions and 21 deletions.
42 changes: 21 additions & 21 deletions libs/util/shared/src/lib/links/link-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,15 @@ export const FORMATS = {
color: '#559d7f',
mimeTypes: ['text/csv', 'application/csv'],
},
excel: {
extensions: ['xls', 'xlsx', 'ms-excel', 'openxmlformats-officedocument'],
priority: 2,
color: '#0f4395',
mimeTypes: [
'application/vnd.ms-excel',
'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
],
},
geojson: {
extensions: ['geojson'],
priority: 3,
Expand Down Expand Up @@ -39,37 +48,28 @@ export const FORMATS = {
},
gpkg: {
extensions: ['gpkg', 'geopackage'],
priority: 0,
color: 'var(--color-primary)',
priority: 6,
color: '#ea79ba',
mimeTypes: ['application/geopackage+sqlite3'],
},
excel: {
extensions: ['xls', 'xlsx', 'ms-excel', 'openxmlformats-officedocument'],
priority: 2,
color: 'var(--color-primary)',
mimeTypes: [
'application/vnd.ms-excel',
'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
],
zip: {
extensions: ['zip'],
priority: 7,
color: '#f2bb3a',
mimeTypes: ['application/zip'],
},
pdf: {
extensions: ['pdf'],
priority: 0,
color: 'var(--color-primary)',
priority: 8,
color: '#db544a',
mimeTypes: ['application/vnd.ms-excel'],
},
jpg: {
extensions: ['jpg', 'jpeg', 'jfif', 'pjpeg', 'pjp'],
priority: 0,
color: 'var(--color-primary)',
priority: 8,
color: '#673ab7',
mimeTypes: ['image/jpg'],
},
zip: {
extensions: ['zip'],
priority: 0,
color: 'var(--color-primary)',
mimeTypes: ['application/zip'],
},
}

export function sortPriority(link: MetadataLinkValid): number {
Expand Down Expand Up @@ -138,5 +138,5 @@ export function getBadgeColor(linkFormat: string): string | void {
return FORMATS[format].color
}
}
return 'var(--color-primary)' // Default color ?
return 'var(--color-gray-700)' // Default color ?
}

0 comments on commit 44e794a

Please sign in to comment.