Bläddra i källkod

Create icons once, add new icons, rm icon props, use new prop name

main
Miggy Eusebio 2 år sedan
committed by Eric Amodio
förälder
incheckning
0888dc5209
1 ändrade filer med 6 tillägg och 8 borttagningar
  1. +6
    -8
      src/webviews/apps/plus/graph/GraphWrapper.tsx

+ 6
- 8
src/webviews/apps/plus/graph/GraphWrapper.tsx Visa fil

@ -164,8 +164,8 @@ const debounceFrame = (func: DebouncableFn): DebouncedFn => {
};
};
const getIconElements = (): { [key: string]: ReactElement<any> } => {
const iconList = ['vm', 'cloud', 'tag', 'inbox', 'check', 'chrome-minimize'];
const createIconElements = (): { [key: string]: ReactElement<any> } => {
const iconList = ['vm', 'cloud', 'tag', 'inbox', 'check', 'loading', 'warning'];
const elementLibrary: { [key: string]: ReactElement<any> } = {};
iconList.forEach(iconKey => {
elementLibrary[iconKey] = createElement('span', { className: `codicon codicon-${iconKey}` });
@ -173,12 +173,10 @@ const getIconElements = (): { [key: string]: ReactElement } => {
return elementLibrary;
};
const getIconElementLibrary = (): ((key: string, props?: { [key: string]: string }) => ReactElement) => {
const iconElementLibrary = getIconElements();
const iconElementLibrary = createIconElements();
return (iconKey: string, _props?: { [propKey: string]: string }) => {
return iconElementLibrary[iconKey];
};
const getIconElementLibrary = (iconKey: string) => {
return iconElementLibrary[iconKey];
};
// eslint-disable-next-line @typescript-eslint/naming-convention
@ -313,10 +311,10 @@ export function GraphWrapper({
<GraphContainer
columnsSettings={graphColSettings}
cssVariables={styleProps.cssVariables}
getExternalIcon={getIconElementLibrary}
graphRows={graphList}
height={mainHeight}
hasMoreCommits={logState?.hasMore}
iconElementLibrary={getIconElementLibrary()}
isLoadingRows={isLoading}
nonce={nonce}
onColumnResized={handleOnColumnResized}

Laddar…
Avbryt
Spara