mobile toggle
This commit is contained in:
parent
28d647861a
commit
3086eb0469
4 changed files with 52 additions and 6 deletions
20
src/App.css
20
src/App.css
|
|
@ -60,13 +60,32 @@
|
||||||
color: #adadad;
|
color: #adadad;
|
||||||
letter-spacing: 1px;
|
letter-spacing: 1px;
|
||||||
}
|
}
|
||||||
|
.mobile-toggle {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
.desktop-toggle {
|
||||||
|
margin-left: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
@media (max-width: 768px) {
|
@media (max-width: 768px) {
|
||||||
|
.mobile-toggle {
|
||||||
|
display: inline-flex;
|
||||||
|
}
|
||||||
|
.desktop-toggle {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
.todo-list {
|
.todo-list {
|
||||||
padding: 15px;
|
padding: 15px;
|
||||||
padding-top: 10px;
|
padding-top: 10px;
|
||||||
width: auto;
|
width: auto;
|
||||||
}
|
}
|
||||||
|
.todo-list h2 {
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: center;
|
||||||
|
margin-bottom: 15px;
|
||||||
|
max-width: 95%;
|
||||||
|
}
|
||||||
.todo-list-title {
|
.todo-list-title {
|
||||||
/* Disable Auto Zoom in Input “Text” tag - Safari on iPhone */
|
/* Disable Auto Zoom in Input “Text” tag - Safari on iPhone */
|
||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
|
|
@ -76,6 +95,7 @@
|
||||||
.todo-create-wrapper {
|
.todo-create-wrapper {
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
align-items: flex-start;
|
align-items: flex-start;
|
||||||
|
margin-bottom: 15px;
|
||||||
}
|
}
|
||||||
.todo-create-input {
|
.todo-create-input {
|
||||||
appearance: none;
|
appearance: none;
|
||||||
|
|
|
||||||
12
src/App.js
12
src/App.js
|
|
@ -2,6 +2,7 @@ import React, { Component } from 'react'
|
||||||
import ContentEditable from './components/ContentEditable'
|
import ContentEditable from './components/ContentEditable'
|
||||||
import AppHeader from './components/AppHeader'
|
import AppHeader from './components/AppHeader'
|
||||||
import SettingsMenu from './components/SettingsMenu'
|
import SettingsMenu from './components/SettingsMenu'
|
||||||
|
import SettingsIcon from './components/SettingsIcon'
|
||||||
import api from './utils/api'
|
import api from './utils/api'
|
||||||
import sortByDate from './utils/sortByDate'
|
import sortByDate from './utils/sortByDate'
|
||||||
import './App.css'
|
import './App.css'
|
||||||
|
|
@ -230,7 +231,10 @@ export default class App extends Component {
|
||||||
<AppHeader />
|
<AppHeader />
|
||||||
|
|
||||||
<div className='todo-list'>
|
<div className='todo-list'>
|
||||||
<h2>Create todo</h2>
|
<h2>
|
||||||
|
Create todo
|
||||||
|
<SettingsIcon onClick={this.openModal} className='mobile-toggle' />
|
||||||
|
</h2>
|
||||||
<form className='todo-create-wrapper' onSubmit={this.saveTodo}>
|
<form className='todo-create-wrapper' onSubmit={this.saveTodo}>
|
||||||
<input
|
<input
|
||||||
className='todo-create-input'
|
className='todo-create-input'
|
||||||
|
|
@ -244,11 +248,7 @@ export default class App extends Component {
|
||||||
<button className='todo-create-button'>
|
<button className='todo-create-button'>
|
||||||
Create todo
|
Create todo
|
||||||
</button>
|
</button>
|
||||||
<span onClick={this.openModal}>
|
<SettingsIcon onClick={this.openModal} className='desktop-toggle' />
|
||||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 125" className="todo-settings-toggle">
|
|
||||||
<use xlinkHref="#settings" className="settings-gear"></use>
|
|
||||||
</svg>
|
|
||||||
</span>
|
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
|
|
|
||||||
11
src/components/SettingsIcon/SettingIcon.css
Normal file
11
src/components/SettingsIcon/SettingIcon.css
Normal file
|
|
@ -0,0 +1,11 @@
|
||||||
|
.setting-toggle-wrapper {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
.settings-toggle {
|
||||||
|
fill: #b7b9bd;
|
||||||
|
width: 35px;
|
||||||
|
height: 35px;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
15
src/components/SettingsIcon/index.js
Normal file
15
src/components/SettingsIcon/index.js
Normal file
|
|
@ -0,0 +1,15 @@
|
||||||
|
import React from 'react'
|
||||||
|
import styles from './SettingIcon.css' // eslint-disable-line
|
||||||
|
|
||||||
|
const SettingIcon = (props) => {
|
||||||
|
const className = props.className || ''
|
||||||
|
return (
|
||||||
|
<span onClick={props.onClick} class={`setting-toggle-wrapper ${className}`}>
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 125" className="settings-toggle">
|
||||||
|
<use xlinkHref="#settings" className="settings-gear"></use>
|
||||||
|
</svg>
|
||||||
|
</span>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
export default SettingIcon
|
||||||
Loading…
Add table
Add a link
Reference in a new issue