mirror of
https://github.com/ClaytonWWilson/CS307-Team24.git
synced 2026-03-10 21:25:04 +00:00
Dark Mode implementation
This commit is contained in:
34
twistter-frontend/package-lock.json
generated
34
twistter-frontend/package-lock.json
generated
@@ -3092,6 +3092,11 @@
|
||||
"merge": "^1.2.0"
|
||||
}
|
||||
},
|
||||
"exenv": {
|
||||
"version": "1.2.2",
|
||||
"resolved": "https://registry.npmjs.org/exenv/-/exenv-1.2.2.tgz",
|
||||
"integrity": "sha1-KueOhdmJQVhnCwPUe+wfA72Ru50="
|
||||
},
|
||||
"exit-hook": {
|
||||
"version": "1.1.1",
|
||||
"resolved": "https://registry.npmjs.org/exit-hook/-/exit-hook-1.1.1.tgz",
|
||||
@@ -3957,6 +3962,11 @@
|
||||
"resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz",
|
||||
"integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A=="
|
||||
},
|
||||
"fuse.js": {
|
||||
"version": "3.4.6",
|
||||
"resolved": "https://registry.npmjs.org/fuse.js/-/fuse.js-3.4.6.tgz",
|
||||
"integrity": "sha512-H6aJY4UpLFwxj1+5nAvufom5b2BT2v45P1MkPvdGIK8fWjQx/7o6tTT1+ALV0yawQvbmvCF0ufl2et8eJ7v7Cg=="
|
||||
},
|
||||
"gauge": {
|
||||
"version": "2.7.4",
|
||||
"resolved": "https://registry.npmjs.org/gauge/-/gauge-2.7.4.tgz",
|
||||
@@ -7167,6 +7177,22 @@
|
||||
"resolved": "https://registry.npmjs.org/react-is/-/react-is-16.9.0.tgz",
|
||||
"integrity": "sha512-tJBzzzIgnnRfEm046qRcURvwQnZVXmuCbscxUO5RWrGTXpon2d4c8mI0D8WE6ydVIm29JiLB6+RslkIvym9Rjw=="
|
||||
},
|
||||
"react-lifecycles-compat": {
|
||||
"version": "3.0.4",
|
||||
"resolved": "https://registry.npmjs.org/react-lifecycles-compat/-/react-lifecycles-compat-3.0.4.tgz",
|
||||
"integrity": "sha512-fBASbA6LnOU9dOU2eW7aQ8xmYBSXUIWr+UmF9b1efZBazGNO+rcXT/icdKnYm2pTwcRylVUYwW7H1PHfLekVzA=="
|
||||
},
|
||||
"react-modal": {
|
||||
"version": "3.11.1",
|
||||
"resolved": "https://registry.npmjs.org/react-modal/-/react-modal-3.11.1.tgz",
|
||||
"integrity": "sha512-8uN744Yq0X2lbfSLxsEEc2UV3RjSRb4yDVxRQ1aGzPo86QjNOwhQSukDb8U8kR+636TRTvfMren10fgOjAy9eA==",
|
||||
"requires": {
|
||||
"exenv": "^1.2.0",
|
||||
"prop-types": "^15.5.10",
|
||||
"react-lifecycles-compat": "^3.0.0",
|
||||
"warning": "^4.0.3"
|
||||
}
|
||||
},
|
||||
"react-redux": {
|
||||
"version": "7.1.1",
|
||||
"resolved": "https://registry.npmjs.org/react-redux/-/react-redux-7.1.1.tgz",
|
||||
@@ -9991,6 +10017,14 @@
|
||||
"makeerror": "1.0.x"
|
||||
}
|
||||
},
|
||||
"warning": {
|
||||
"version": "4.0.3",
|
||||
"resolved": "https://registry.npmjs.org/warning/-/warning-4.0.3.tgz",
|
||||
"integrity": "sha512-rpJyN222KWIvHJ/F53XSZv0Zl/accqHR8et1kpaMTD/fLCRxtV8iX8czMzY7sVZupTI3zcUTg8eycS2kNF9l6w==",
|
||||
"requires": {
|
||||
"loose-envify": "^1.0.0"
|
||||
}
|
||||
},
|
||||
"watch": {
|
||||
"version": "0.10.0",
|
||||
"resolved": "https://registry.npmjs.org/watch/-/watch-0.10.0.tgz",
|
||||
|
||||
20
twistter-frontend/public/global.js
Normal file
20
twistter-frontend/public/global.js
Normal file
@@ -0,0 +1,20 @@
|
||||
import { createGlobalStyle } from 'styled-components';
|
||||
|
||||
export const GlobalStyles = createGlobalStyle`
|
||||
*,
|
||||
*::after,
|
||||
*::before {
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
body {
|
||||
align-items: center;
|
||||
background: ${({ theme }) => theme.body};
|
||||
color: ${({ theme }) => theme.text};
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
height: 100vh;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
14
twistter-frontend/public/theme.js
Normal file
14
twistter-frontend/public/theme.js
Normal file
@@ -0,0 +1,14 @@
|
||||
export const lightTheme = {
|
||||
body: '#E2E2E2',
|
||||
text: '#363537',
|
||||
toggleBorder: '#FFF',
|
||||
gradient: 'linear-gradient(#39598A, #79D7ED)',
|
||||
}
|
||||
|
||||
export const darkTheme = {
|
||||
body: '#363537',
|
||||
text: '#FAFAFA',
|
||||
toggleBorder: '#6B8096',
|
||||
gradient: 'linear-gradient(#091236, #1E215D)',
|
||||
}
|
||||
|
||||
23
twistter-frontend/src/components/toggle/toggle.js
Normal file
23
twistter-frontend/src/components/toggle/toggle.js
Normal file
@@ -0,0 +1,23 @@
|
||||
import React from 'react'
|
||||
import { func, string } from 'prop-types';
|
||||
import styled from 'styled-components';
|
||||
// Import a couple of SVG files we'll use in the design: https://www.flaticon.com
|
||||
import { ReactComponent as MoonIcon } from 'icons/moon.svg';
|
||||
import { ReactComponent as SunIcon } from 'icons/sun.svg';
|
||||
|
||||
const Toggle = ({ theme, toggleTheme }) => {
|
||||
const isLight = theme === 'light';
|
||||
return (
|
||||
<button onClick={toggleTheme} >
|
||||
<SunIcon />
|
||||
<MoonIcon />
|
||||
</button>
|
||||
);
|
||||
};
|
||||
|
||||
Toggle.propTypes = {
|
||||
theme: string.isRequired,
|
||||
toggleTheme: func.isRequired,
|
||||
}
|
||||
|
||||
export default Toggle;
|
||||
Reference in New Issue
Block a user