diff --git a/hyperglass/ui/components/ChakraSelect.js b/hyperglass/ui/components/ChakraSelect.js index d7408dc..bb72701 100644 --- a/hyperglass/ui/components/ChakraSelect.js +++ b/hyperglass/ui/components/ChakraSelect.js @@ -4,149 +4,173 @@ import Select from "react-select"; import { opposingColor } from "~/util"; const ChakraSelect = React.forwardRef( - ({ placeholder = "Select...", isFullWidth, size, children, ...props }, ref) => { - const theme = useTheme(); - const { colorMode } = useColorMode(); - const sizeMap = { - lg: { height: theme.space[12] }, - md: { height: theme.space[10] }, - sm: { height: theme.space[8] }, - }; - const colorSetPrimaryBg = { - dark: theme.colors.primary[300], - light: theme.colors.primary[500], - }; - const colorSetPrimaryColor = opposingColor(theme, colorSetPrimaryBg[colorMode]); - const bg = { dark: theme.colors.whiteAlpha[100], light: theme.colors.white }; - const color = { dark: theme.colors.whiteAlpha[800], light: theme.colors.black }; - const borderFocused = theme.colors.secondary[500]; - const borderDisabled = theme.colors.whiteAlpha[100]; - const border = { dark: theme.colors.whiteAlpha[50], light: theme.colors.gray[100] }; - const borderRadius = theme.space[1]; - const hoverColor = { dark: theme.colors.whiteAlpha[200], light: theme.colors.gray[300] }; - const { height } = sizeMap[size]; - const optionBgActive = { - dark: theme.colors.primary[400], - light: theme.colors.primary[600], - }; - const optionBgColor = opposingColor(theme, optionBgActive[colorMode]); - const optionSelectedBg = { - dark: theme.colors.whiteAlpha[400], - light: theme.colors.blackAlpha[400], - }; - const optionSelectedColor = opposingColor(theme, optionSelectedBg[colorMode]); - const selectedDisabled = theme.colors.whiteAlpha[400]; - const placeholderColor = { - dark: theme.colors.whiteAlpha[400], - light: theme.colors.gray[400], - }; - const menuBg = { dark: theme.colors.black, light: theme.colors.white }; - const menuColor = { dark: theme.colors.white, light: theme.colors.blackAlpha[800] }; - return ( - - ); - } + ( + { placeholder = "Select...", isFullWidth, size, children, ...props }, + ref + ) => { + const theme = useTheme(); + const { colorMode } = useColorMode(); + const sizeMap = { + lg: { height: theme.space[12] }, + md: { height: theme.space[10] }, + sm: { height: theme.space[8] } + }; + const colorSetPrimaryBg = { + dark: theme.colors.primary[300], + light: theme.colors.primary[500] + }; + const colorSetPrimaryColor = opposingColor( + theme, + colorSetPrimaryBg[colorMode] + ); + const bg = { + dark: theme.colors.whiteAlpha[100], + light: theme.colors.white + }; + const color = { + dark: theme.colors.whiteAlpha[800], + light: theme.colors.black + }; + const borderFocused = theme.colors.secondary[500]; + const borderDisabled = theme.colors.whiteAlpha[100]; + const border = { + dark: theme.colors.whiteAlpha[50], + light: theme.colors.gray[100] + }; + const borderRadius = theme.space[1]; + const hoverColor = { + dark: theme.colors.whiteAlpha[200], + light: theme.colors.gray[300] + }; + const { height } = sizeMap[size]; + const optionBgActive = { + dark: theme.colors.primary[400], + light: theme.colors.primary[600] + }; + const optionBgColor = opposingColor(theme, optionBgActive[colorMode]); + const optionSelectedBg = { + dark: theme.colors.whiteAlpha[400], + light: theme.colors.blackAlpha[400] + }; + const optionSelectedColor = opposingColor( + theme, + optionSelectedBg[colorMode] + ); + const selectedDisabled = theme.colors.whiteAlpha[400]; + const placeholderColor = { + dark: theme.colors.whiteAlpha[400], + light: theme.colors.gray[400] + }; + const menuBg = { dark: theme.colors.black, light: theme.colors.white }; + const menuColor = { + dark: theme.colors.white, + light: theme.colors.blackAlpha[800] + }; + return ( + + ); + } ); ChakraSelect.displayName = "ChakraSelect"; diff --git a/hyperglass/ui/components/HyperglassProvider.js b/hyperglass/ui/components/HyperglassProvider.js index 858ca04..e21e472 100644 --- a/hyperglass/ui/components/HyperglassProvider.js +++ b/hyperglass/ui/components/HyperglassProvider.js @@ -21,6 +21,8 @@ export const HyperglassProvider = ({ config, children }) => { const value = useMemo(() => config, [config]); const userTheme = value && makeTheme(value.web.theme); const theme = value ? userTheme : defaultTheme; + // console.log(value); + // console.log(theme); return ( diff --git a/hyperglass/ui/components/Table/MainTable.js b/hyperglass/ui/components/Table/MainTable.js index af9b236..38790ef 100644 --- a/hyperglass/ui/components/Table/MainTable.js +++ b/hyperglass/ui/components/Table/MainTable.js @@ -11,6 +11,7 @@ const MainTable = ({ children, ...props }) => { const { colorMode } = useColorMode(); return ( { - return ( - - - - ); + const { asPath } = useRouter(); + if (asPath === "/structured") { + return ; + } + return ( + + + + ); }; Hyperglass.displayName = "Hyperglass"; diff --git a/hyperglass/ui/util.js b/hyperglass/ui/util.js index 24e9f77..ac98ce6 100644 --- a/hyperglass/ui/util.js +++ b/hyperglass/ui/util.js @@ -10,7 +10,7 @@ const isDark = color => { const isLight = color => isDark(color); const opposingColor = (theme, color) => { - if (color.includes(".")) { + if (color.match(/^\w+\.\d+$/m)) { const colorParts = color.split("."); if (colorParts.length !== 2) { throw Error(`Color is improperly formatted. Got '${color}'`);