-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add experimental Dark Theme with funny toggle
- Loading branch information
Showing
7 changed files
with
174 additions
and
100 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,39 @@ | ||
import PropTypes from 'prop-types'; | ||
import React from 'react'; | ||
import { connect } from 'react-redux'; | ||
import './header.css'; | ||
import IonicLogo from '../images/ionic-icon.png'; | ||
|
||
const Header = ({ siteTitle, siteSubtitle }) => ( | ||
<header> | ||
<div className="header-container"> | ||
<img src={IonicLogo} className="ionic-logo" alt="ionic logo" /> | ||
<div className="header-title-text"> | ||
<h1>{siteTitle}</h1> | ||
<h5>{siteSubtitle}</h5> | ||
</div> | ||
</div> | ||
</header> | ||
); | ||
class Header extends React.Component { | ||
constructor(props) { | ||
super(props); | ||
this.toggleDarkTheme = this.toggleDarkTheme.bind(this); | ||
} | ||
|
||
Header.propTypes = { | ||
siteTitle: PropTypes.string, | ||
siteSubtitle: PropTypes.string, | ||
}; | ||
toggleDarkTheme() { | ||
const { toggleDarkTheme, darkTheme } = this.props; | ||
toggleDarkTheme(!darkTheme); | ||
} | ||
|
||
Header.defaultProps = { | ||
siteTitle: '', | ||
siteSubtitle: '', | ||
}; | ||
render() { | ||
const { siteTitle, siteSubtitle } = this.props; | ||
return ( | ||
<header> | ||
<div className="header-container"> | ||
<div className="header-title-logo"> | ||
<img src={IonicLogo} className="ionic-logo" alt="ionic logo" /> | ||
<div className="header-title-text"> | ||
<h1>{siteTitle}</h1> | ||
<h5>{siteSubtitle}</h5> | ||
</div> | ||
</div> | ||
<button type="button" onClick={this.toggleDarkTheme}>?</button> | ||
</div> | ||
</header> | ||
); | ||
} | ||
} | ||
|
||
export default Header; | ||
export default connect( | ||
({ darkTheme }) => ({ darkTheme }), | ||
dispatch => ({ toggleDarkTheme: value => dispatch({ type: 'DARK_THEME', data: value }) }), | ||
)(Header); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
.list-item { | ||
width: 100%; | ||
margin-bottom: 50px; | ||
} | ||
|
||
.list-item-title{ | ||
display: flex; | ||
flex-direction: row; | ||
justify-content: space-between; | ||
|
||
span { | ||
position: absolute; | ||
right: 0; | ||
width: 32px; | ||
height: 32px; | ||
background-color: var(--ionic-link-icon-color); | ||
mask-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 512'%3E%3Cpath d='M256 161.2c-52.3 0-94.8 42.5-94.8 94.8s42.5 94.8 94.8 94.8 94.8-42.5 94.8-94.8-42.5-94.8-94.8-94.8z'/%3E%3Ccircle cx='392.1' cy='126.4' r='43.2'/%3E%3Cpath d='M445.3 169.8l-1.8-4-2.9 3.3c-7.1 8-16.1 14.2-26.1 17.9l-2.8 1 1.1 2.7c8.6 20.7 13 42.7 13 65.2 0 93.7-76.2 169.9-169.9 169.9S86.1 349.7 86.1 256 162.3 86.1 256 86.1c25.4 0 49.9 5.5 72.8 16.4l2.7 1.3 1.2-2.7c4.2-9.8 10.8-18.5 19.2-25.2l3.4-2.7-3.9-2C321.6 55.8 289.5 48 256 48 141.3 48 48 141.3 48 256s93.3 208 208 208 208-93.3 208-208c0-30-6.3-59-18.7-86.2z'/%3E%3C/svg%3E"); | ||
} | ||
|
||
span:hover { | ||
background-color: var(--ionic-link-icon-color-hover); | ||
} | ||
|
||
a { | ||
text-decoration: none; | ||
position: relative; | ||
} | ||
} | ||
|
||
.table-row{ | ||
border-bottom: solid 1px var(--table-border-bottom-color); | ||
display: flex; | ||
flex-direction: row; | ||
justify-content: space-between; | ||
align-items: center; | ||
min-height: 50px; | ||
} | ||
|
||
.row-name, | ||
.row-desc { | ||
width: 45%; | ||
padding-top: 10px; | ||
padding-bottom: 10px; | ||
} | ||
|
||
.row-name span{ | ||
background: var(--variable-highlight-color); | ||
font-weight: 500; | ||
} | ||
|
||
.row-name span:hover{ | ||
background: var(--variable-highlight-color-hover); | ||
cursor: pointer; | ||
} | ||
|
||
.row-name span::after{ | ||
content: ''; | ||
position: absolute; | ||
margin-left: 10px; | ||
margin-top: 5px; | ||
width: 16px; | ||
height: 16px; | ||
mask-position: center; | ||
mask-repeat: no-repeat; | ||
background-color: var(--font-color); | ||
mask-image: url("data:image/svg+xml;charset=utf8,%3Csvg baseProfile='tiny' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' %3E%3Cpath d='M15.979 7.62H1.021a.4.4 0 0 0-.4.4v14.959a.4.4 0 0 0 .4.4H15.98a.4.4 0 0 0 .4-.4V8.021a.402.402 0 0 0-.401-.401zm-.399 14.959H1.42V8.421h14.16v14.158z'/%3E%3Cpath d='M22.979.62H8.021a.4.4 0 0 0-.4.4v4.959a.4.4 0 1 0 .8 0V1.421H22.58v14.158h-4.559a.4.4 0 0 0 0 .8h4.959a.4.4 0 0 0 .4-.4V1.021a.402.402 0 0 0-.401-.401z'/%3E%3C/svg%3E"); | ||
opacity: 0.7; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters