@t2ca/gatsby-theme-showcase 1.0.87 → 1.0.89
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@t2ca/gatsby-theme-showcase",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.89",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"devDependencies": {
|
|
7
|
+
"@emotion/eslint-plugin": "^11.0.0",
|
|
7
8
|
"babel-eslint": "^10.0.2",
|
|
8
9
|
"eslint": "^7.0.0",
|
|
9
10
|
"eslint-config-prettier": "^6.0.0",
|
|
10
|
-
"eslint-plugin-emotion": "^11.0.0",
|
|
11
11
|
"eslint-plugin-graphql": "^4.0.0",
|
|
12
12
|
"eslint-plugin-import": "^2.18.0",
|
|
13
13
|
"eslint-plugin-jsx-a11y": "^6.2.3",
|
|
@@ -22,6 +22,7 @@
|
|
|
22
22
|
"react-dom": "16.3.1"
|
|
23
23
|
},
|
|
24
24
|
"dependencies": {
|
|
25
|
+
"@emotion/react": "^11.0.0",
|
|
25
26
|
"@emotion/styled": "^11.0.0",
|
|
26
27
|
"@theme-ui/components": "^0.4.0-rc.5",
|
|
27
28
|
"@theme-ui/preset-bootstrap": "^0.4.0-rc.5",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from "react"
|
|
2
2
|
import styled from "@emotion/styled"
|
|
3
|
-
import {
|
|
3
|
+
import { useThemeUI } from "theme-ui"
|
|
4
4
|
|
|
5
5
|
const IconWrapper = styled.button`
|
|
6
6
|
padding: 0;
|
|
@@ -87,7 +87,8 @@ const MoonMask = styled.div`
|
|
|
87
87
|
`
|
|
88
88
|
|
|
89
89
|
const ColorModeToggle = () => {
|
|
90
|
-
const
|
|
90
|
+
const context = useThemeUI()
|
|
91
|
+
const { theme, colorMode, setColorMode } = context
|
|
91
92
|
const isDark = colorMode === `dark`
|
|
92
93
|
|
|
93
94
|
const toggleColorMode = (e) => {
|
|
@@ -97,13 +98,12 @@ const ColorModeToggle = () => {
|
|
|
97
98
|
|
|
98
99
|
return (
|
|
99
100
|
<IconWrapper
|
|
100
|
-
isDark={isDark}
|
|
101
101
|
onClick={toggleColorMode}
|
|
102
102
|
aria-label={isDark ? `Activate light mode` : `Activate dark mode`}
|
|
103
103
|
title={isDark ? `Activate light mode` : `Activate dark mode`}
|
|
104
104
|
>
|
|
105
|
-
<MoonOrSun isDark={isDark} />
|
|
106
|
-
<MoonMask isDark={isDark} />
|
|
105
|
+
<MoonOrSun isDark={isDark} theme={theme} />
|
|
106
|
+
<MoonMask isDark={isDark} theme={theme} />
|
|
107
107
|
</IconWrapper>
|
|
108
108
|
)
|
|
109
109
|
}
|