DiaryCard.TaskIcon
The DiaryCard.TaskIcon component displays a measurement type icon. It is inherited from the Tile module's TaskIcon and exposed on DiaryCard for convenience.
Basic Example
import { MeasurementTypeKey } from "@ovok/core";
import { DiaryCard } from "@ovok/native";
import * as React from "react";
const BasicDiaryCardTaskIconExample = () => {
return (
<DiaryCard.TaskIcon measurementTypeKey={MeasurementTypeKey.bodyWeight} />
);
};
export default BasicDiaryCardTaskIconExample;
Props
The public TaskIconProps type is exported from @ovok/native. The current
renderer accepts the documented values but does not forward arbitrary SVG props
or style to SvgXml.
Primary Props
| Prop | Type | Default | Description |
|---|---|---|---|
measurementTypeKey | MeasurementTypeKey | required | Key of the measurement type to render |
size | number | 20 | Icon size in px |
color | string | theme.colors.primary | Icon color |
style | SvgXml style | undefined | Accepted by the public type; the current renderer does not forward it to SvgXml |
testID | string | undefined | Test identifier |
Styling
Theme Colors Used
theme.colors.primary- Default icon color whencoloris not provided
If the measurement key has no bundled SVG mapping, the component returns null; it
does not render a generic placeholder. The core key used for the urine-analysis icon
is MeasurementTypeKey.uricAcid; a separate urineAnalysis name is not mapped and
will therefore render nothing.