From 26b484e988b15eb478042c9c4d47e7704f94f98b Mon Sep 17 00:00:00 2001 From: Priscila Oliveira Date: Sun, 22 Mar 2020 12:26:06 +0100 Subject: [PATCH 1/8] feat(style): added dark mode --- .secrets-baseline | 9 ++- src/App/App.tsx | 2 +- src/App/__snapshots__/App.test.tsx.snap | 74 ++++++++++++++++--- .../__snapshots__/ActionBar.test.tsx.snap | 2 +- .../DetailContainer/DetailContainerTabs.tsx | 10 +-- .../DetailContainer.test.tsx.snap | 9 ++- .../DetailSidebar/DetailSidebar.tsx | 8 +- .../DetailSidebar/DetailSidebarTitle.tsx | 18 ++--- .../__snapshots__/Developers.test.tsx.snap | 2 +- .../Footer/__snapshots__/Footer.test.tsx.snap | 4 +- src/components/Footer/styles.ts | 8 +- src/components/Header/Header.tsx | 10 +-- src/components/Header/HeaderLeft.tsx | 7 +- src/components/Header/HeaderLogo.tsx | 25 ------- src/components/Header/HeaderRight.tsx | 34 ++++++--- src/components/Header/HeaderToolTipIcon.tsx | 19 ++++- .../Header/__snapshots__/Header.test.tsx.snap | 58 ++++++++++++++- .../__snapshots__/Loading.test.tsx.snap | 4 +- src/components/Loading/styles.ts | 8 +- .../LoginDialog/LoginDialogFormError.tsx | 5 +- .../LoginDialog/LoginDialogHeader.tsx | 1 + src/components/Logo/Logo.tsx | 43 ++++++++--- .../Logo/img/logo-black-and-white.svg | 1 + .../__snapshots__/Notfound.test.tsx.snap | 2 +- src/components/Package/styles.ts | 9 +-- src/components/Readme/Readme.spec.tsx | 2 +- src/components/Readme/Readme.tsx | 13 +++- .../Readme/__snapshots__/Readme.spec.tsx.snap | 4 +- .../RegistryInfoContent.tsx | 18 +---- src/components/RegistryInfoDialog/styles.ts | 5 +- .../__snapshots__/Spinner.test.tsx.snap | 2 +- src/components/Spinner/styles.ts | 4 +- .../__snapshots__/UpLinks.test.tsx.snap | 2 +- src/components/UpLinks/styles.ts | 12 +-- src/components/Versions/Versions.tsx | 1 + src/components/Versions/styles.ts | 12 +-- src/design-tokens/ThemeContext.ts | 10 +++ src/design-tokens/ThemeProvider.tsx | 27 +++++-- src/design-tokens/theme.ts | 53 ++++++++----- src/design-tokens/useTheme.ts | 7 ++ tools/webpack.dev.config.babel.js | 1 - 41 files changed, 357 insertions(+), 188 deletions(-) delete mode 100644 src/components/Header/HeaderLogo.tsx create mode 100644 src/components/Logo/img/logo-black-and-white.svg create mode 100644 src/design-tokens/ThemeContext.ts create mode 100644 src/design-tokens/useTheme.ts diff --git a/.secrets-baseline b/.secrets-baseline index 992b28fe7..cd4918f33 100644 --- a/.secrets-baseline +++ b/.secrets-baseline @@ -3,7 +3,7 @@ "files": null, "lines": null }, - "generated_at": "2019-09-29T18:19:50Z", + "generated_at": "2020-03-22T16:15:24Z", "plugins_used": [ { "name": "AWSKeyDetector" @@ -23,6 +23,7 @@ "name": "HexHighEntropyString" }, { + "keyword_exclude": null, "name": "KeywordDetector" }, { @@ -36,5 +37,9 @@ } ], "results": {}, - "version": "0.12.4" + "version": "0.13.0", + "word_list": { + "file": null, + "hash": null + } } diff --git a/src/App/App.tsx b/src/App/App.tsx index 2b21059e8..99aa2b0d7 100644 --- a/src/App/App.tsx +++ b/src/App/App.tsx @@ -19,7 +19,7 @@ import AppRoute, { history } from './AppRoute'; import loadDayJSLocale from './load-dayjs-locale'; const StyledBox = styled(Box)<{ theme?: Theme }>(({ theme }) => ({ - backgroundColor: theme && theme.palette.white, + backgroundColor: theme?.palette.background.default, })); const StyledBoxContent = styled(Box)<{ theme?: Theme }>(({ theme }) => ({ diff --git a/src/App/__snapshots__/App.test.tsx.snap b/src/App/__snapshots__/App.test.tsx.snap index 057a7c373..daad90761 100644 --- a/src/App/__snapshots__/App.test.tsx.snap +++ b/src/App/__snapshots__/App.test.tsx.snap @@ -2,11 +2,11 @@ exports[` should display the Header component 1`] = ` .emotion-78 { - background-color: #fff; + background-color: #1A202C; } .emotion-24 { - background-color: #4b5e40; + background-color: #253341; min-height: 60px; display: -webkit-box; display: -webkit-flex; @@ -153,9 +153,9 @@ exports[` should display the Header component 1`] = ` } .emotion-76 { - background: #f9f9f9; + background: #253341; border-top: 1px solid #e3e3e3; - color: #999999; + color: #fff; font-size: 14px; padding: 20px; } @@ -322,7 +322,7 @@ exports[` should display the Header component 1`] = ` margin: 0 0 30px 0; border-radius: 25px; box-shadow: 0 10px 20px 0 rgba(69,58,100,0.2); - background: #f7f8f6; + background: #000; } .emotion-26 { @@ -353,7 +353,7 @@ exports[` should display the Header component 1`] = ` } .emotion-30 { - color: #4b5e40; + color: #fff; }
should display the Header component 1`] = ` class="MuiTouchRipple-root" /> + + + + + + + +