How to use the @dhis2/ui-core.theme.primary800 function in @dhis2/ui-core

To help you get started, we’ve selected a few @dhis2/ui-core examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github dhis2 / dashboards-app / src / components / Item / VisualizationItem / ItemHeaderButtons.js View on Github external
border: `1px solid ${colors.grey200}`,
    },
};

const baseStyle = {
    icon: style.iconBase,
    container: style.buttonBase,
};

const disabledStyle = {
    icon: style.iconBase,
    container: style.buttonDisabled,
};

const activeStyle = {
    icon: { ...style.iconBase, fill: theme.primary800 },
    container: {
        ...style.buttonBase,
        backgroundColor: theme.primary100,
    },
};

const inactiveStyle = disabled => (disabled ? disabledStyle : baseStyle);

const tableBtnStyle = (activeType, disabled) =>
    [REPORT_TABLE, EVENT_REPORT].includes(activeType)
        ? activeStyle
        : inactiveStyle(disabled);

const chartBtnStyle = (activeType, disabled) =>
    [CHART, EVENT_CHART].includes(activeType)
        ? activeStyle