mirror of
https://github.com/bellingcat/ukraine-timemap.git
synced 2026-06-13 05:48:36 +03:00
Added generators for card layouts. (#182)
* Added generators for card layouts. These are optionally defined in the timemap config * Removed US2020-specific layout generation - now it's being specified in the config
This commit is contained in:
31
src/common/card.js
Normal file
31
src/common/card.js
Normal file
@@ -0,0 +1,31 @@
|
||||
// Sensible defaults for generating a basic card layout
|
||||
// based on the example Timemap datasheet.
|
||||
const basic = ({ event }) => {
|
||||
return [
|
||||
[
|
||||
{
|
||||
kind: 'date',
|
||||
title: 'Incident Date',
|
||||
value: event.datetime || event.date || ``
|
||||
},
|
||||
{
|
||||
kind: 'text',
|
||||
title: 'Location',
|
||||
value: event.location || `—`
|
||||
}
|
||||
],
|
||||
[{ kind: 'line-break', times: 0.4 }],
|
||||
[
|
||||
{
|
||||
kind: 'text',
|
||||
title: 'Summary',
|
||||
value: event.description || ``,
|
||||
scaleFont: 1.1
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
|
||||
export default {
|
||||
basic
|
||||
}
|
||||
Reference in New Issue
Block a user