felixangell / biodefence

biodefence
https://biodefence.netlify.com
1 stars 0 forks source link

Implemented a notification queue/card system + lipid generation #20

Closed felixangell closed 5 years ago

felixangell commented 5 years ago

You send cards to be rendered on the screen using queueInfoCard:

this.queueInfoCard(new InfoCard({
    id: 0,
    title: 'Drink more water',
    desc: 'Hydration is very important!! Hydration is very important!! Hydration is very important!! Hydration is very important!! Hydration is very important!! Hydration is very important!! Hydration is very important!!',
    showOnce: true,
}));

19 still need to implement card duration taken from the json objects, as well as loading the data from a the json objects by ID (or maybe title, or a key?) so that rather than pushing a new object, you would do something like:

this.queueInfoCard('dehydrated');

For that to work, a little 'variable' or key needs to be added to each object, e.g. "key": "dehydrated", and they must be unique

cc @HarryAmmon @JamesMcGovern @td251

felixangell commented 5 years ago

Forgot to say, this also implements "lipid generation", following the table in the docs. Feel free to review the code or add any comments to bits you don't understand.