Line data Source code
1 : import * as React from 'react';
2 :
3 : import { ConnectorInfo } from './connector_info.js';
4 : import { useColorScheme } from '../config/color_scheme.js';
5 :
6 : /// The style of the icon of a connector. The monochrome logos take the color of the text and would turn as grey as
7 : /// muted text around them, they keep the full text color. The colored logos have colors of their own.
8 1 : export const CONNECTOR_ICON_STYLE: React.CSSProperties = { color: 'var(--color_fg)' };
9 :
10 : /// The symbol of the icon of a connector in the color scheme of the app.
11 : /// The light scheme shows the colored logos, the dark scheme the monochrome ones, which take the color of the text.
12 1 : export function useConnectorIcon(): (info: ConnectorInfo) => string {
13 1 : const scheme = useColorScheme();
14 1 : return React.useCallback((info: ConnectorInfo) => scheme === 'dark' ? info.icons.uncolored : info.icons.colored, [scheme]);
15 1 : }
|