Skip to content

Commit

Permalink
updated color for light theme
Browse files Browse the repository at this point in the history
  • Loading branch information
czgu committed Nov 19, 2024
1 parent 0f2dad3 commit d840712
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { useCallback, useEffect } from 'react';
import React, { useEffect } from 'react';
import { useDispatch, useSelector } from 'react-redux';

import { IFunctionDescription } from 'const/metastore';
Expand Down Expand Up @@ -59,7 +59,7 @@ export const FunctionDocumentationTooltipByName: React.FunctionComponent<{
if (language) {
dispatch(fetchFunctionDocumentationIfNeeded(language));
}
}, [language]);
}, [dispatch, language]);

const functionDefs = functionDocumentationByNameByLanguage?.[language];
const functionNameLower = (functionName || '').toLowerCase();
Expand Down
1 change: 1 addition & 0 deletions querybook/webapp/components/QueryEditor/QueryEditor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,7 @@ export const QueryEditor: React.FC<
useHoverTooltipExtension({
codeAnalysisRef,
metastoreId: 1,
language,
});

const openTableModalCommand = useCallback((editorView: EditorView) => {
Expand Down
3 changes: 2 additions & 1 deletion querybook/webapp/components/QueryEditor/themes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ export const CustomXcodeTheme = xcodeLightInit({
gutterBackground: 'var(--bg-color)',
},
styles: [
{ tag: [t.special(t.propertyName)], color: '#327A9E' },
{ tag: [t.special(t.propertyName)], color: '#005cc5' },
{ tag: [t.constant(t.name), t.standard(t.name)], color: '#D23423' },
{ tag: [t.number], color: '#098658' },
],
});
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,11 @@ import { reduxStore } from 'redux/store';
export const useHoverTooltipExtension = ({
codeAnalysisRef,
metastoreId,
language,
}: {
codeAnalysisRef: MutableRefObject<ICodeAnalysis>;
metastoreId: number;
language: string;
}) => {
const getTableAtV5Position = useCallback(
(codeAnalysis, v5Pos: { line: number; ch: number }) => {
Expand Down Expand Up @@ -57,7 +59,7 @@ export const useHoverTooltipExtension = ({
const v5Pos = offsetToPos(editorView, selection.from);
return getTableAtV5Position(codeAnalysisRef.current, v5Pos);
},
[getTableAtV5Position]
[codeAnalysisRef, getTableAtV5Position]
);

const getHoverTooltips: HoverTooltipSource = useCallback(
Expand All @@ -80,7 +82,7 @@ export const useHoverTooltipExtension = ({
} else if (nextChar === '(') {
tooltipComponent = (
<FunctionDocumentationTooltipByName
language="sqlite"
language={language}
functionName={token.text}
/>
);
Expand All @@ -107,7 +109,7 @@ export const useHoverTooltipExtension = ({
},
};
},
[]
[codeAnalysisRef, getTableAtV5Position, language, metastoreId]
);

const extension = useMemo(
Expand Down

0 comments on commit d840712

Please sign in to comment.