From 945dd61421d099a3fbbe15c0842e09b156157312 Mon Sep 17 00:00:00 2001 From: unix Date: Sun, 19 Apr 2020 13:06:27 +0800 Subject: [PATCH 1/2] fix(display): hide shadow on dark mode --- components/display/display.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/components/display/display.tsx b/components/display/display.tsx index 9fc379d..dd4aea9 100644 --- a/components/display/display.tsx +++ b/components/display/display.tsx @@ -1,4 +1,4 @@ -import React, { ReactNode } from 'react' +import React, { ReactNode, useMemo } from 'react' import withDefaults from '../utils/with-defaults' import useTheme from '../styles/use-theme' @@ -22,6 +22,8 @@ const Display: React.FC> = React.memo(({ children, caption, shadow, className, width, ...props }) => { const theme = useTheme() + const showShadow = useMemo(() => shadow && theme.type !== 'dark', [theme.type, shadow]) + return (
{children}
@@ -40,7 +42,7 @@ const Display: React.FC> = React.memo(({ border-radius: 4px; overflow: hidden; width: ${width ? width : 'max-content'}; - box-shadow: ${shadow ? theme.expressiveness.shadowLarge : 'none'}; + box-shadow: ${showShadow ? theme.expressiveness.shadowLarge : 'none'}; max-width: 100%; } From 4487bb12fead141ab2b388f5683dbd36c096cf7b Mon Sep 17 00:00:00 2001 From: unix Date: Sun, 19 Apr 2020 13:14:45 +0800 Subject: [PATCH 2/2] ci: limit thread on circleci --- .circleci/config.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index f05d2e6..a7b993e 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -22,8 +22,7 @@ jobs: key: v2-dependencies-{{ checksum "package.json" }} - run: yarn run lint - - run: yarn run test - - run: npm test -- -w 1 --coverage + - run: yarn test -w 1 --coverage - run: bash <(curl -s https://codecov.io/bash) build: