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:
Zac Ioannidis
2020-11-20 06:35:57 +00:00
committed by GitHub
parent 3ce1c3c890
commit e1de58e701
4 changed files with 101 additions and 144 deletions

31
src/common/card.js Normal file
View 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
}