-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9685457
commit 28d6478
Showing
10 changed files
with
253 additions
and
33 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,6 +10,9 @@ | |
/build | ||
/functions-build | ||
|
||
# netlify | ||
.netlify | ||
|
||
# misc | ||
.DS_Store | ||
.env.local | ||
|
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
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,14 +1,33 @@ | ||
const chalk = require('chalk') | ||
if (!process.env.FAUNADB_SECRET) { | ||
console.log('Please set supply a faunaDB server key') | ||
console.log(` | ||
var util = require('util'); | ||
var exec = require('child_process').exec; | ||
|
||
function clear(){ | ||
exec('clear', function(error, stdout, stderr){ | ||
util.puts(stdout); | ||
}); | ||
} | ||
function checkForFaunaKey() { | ||
if (!process.env.FAUNADB_SECRET) { | ||
console.log(chalk.yellow('Required FAUNADB_SECRET enviroment variable not found.')) | ||
console.log(` | ||
========================= | ||
In your terminal run the following command | ||
export FAUNADB_SECRET=abcYourKeyHere | ||
export FAUNADB_SECRET=YourFaunaDBKeyHere | ||
========================= | ||
`) | ||
process.exit(1) | ||
|
||
process.exit(1) | ||
process.stdout.write('\u001b[2J') | ||
process.stdout.write('\u001b[1;1H') | ||
} | ||
} | ||
|
||
process.on('exit', (err) => { | ||
console.log('errr') | ||
}); | ||
|
||
checkForFaunaKey() |
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
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,56 @@ | ||
|
||
.settings-wrapper { | ||
position: fixed; | ||
left: 0; | ||
top: 0; | ||
background: rgba(95, 95, 95, 0.50); | ||
font-size: 13px; | ||
width: 100%; | ||
height: 100%; | ||
z-index: 9; | ||
display: flex; | ||
align-items: center; | ||
justify-content: center; | ||
} | ||
.settings-content { | ||
margin-top: 3em; | ||
margin-bottom: 3em; | ||
padding: 1.5em 3em; | ||
padding-bottom: 3em; | ||
background: #fff; | ||
color: rgba(14,30,37,0.54); | ||
border-radius: 8px; | ||
box-shadow: 0 1px 6px 0 rgba(14,30,37,0.12); | ||
position: relative; | ||
} | ||
.settings-close { | ||
position: absolute; | ||
right: 15px; | ||
top: 10px; | ||
cursor: pointer; | ||
} | ||
.settings-content h2 { | ||
color: #000; | ||
} | ||
.settings-section { | ||
margin-top: 20px; | ||
} | ||
.settings-header { | ||
font-size: 16px; | ||
font-weight: 600; | ||
} | ||
.settings-options-wrapper { | ||
display: flex; | ||
align-items: center; | ||
flex-wrap: wrap; | ||
} | ||
.settings-option { | ||
padding: 3px 8px; | ||
margin: 5px; | ||
border: 1px solid; | ||
font-size: 12px; | ||
cursor: pointer; | ||
&:hover, &.activeClass { | ||
color: #fff; | ||
} | ||
} |
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,59 @@ | ||
import React, { Component } from 'react' | ||
import styles from './SettingsMenu.css' // eslint-disable-line | ||
|
||
export default class Menu extends Component { | ||
componentDidMount() { | ||
// attach event listeners | ||
document.body.addEventListener('keydown', this.handleEscKey) | ||
} | ||
componentWillUnmount() { | ||
// remove event listeners | ||
document.body.removeEventListener('keydown', this.handleEscKey) | ||
} | ||
handleEscKey = (e) => { | ||
if (this.props.showMenu && e.which === 27) { | ||
this.props.handleModalClose() | ||
} | ||
} | ||
handleDelete = (e) => { | ||
e.preventDefault() | ||
const deleteConfirm = window.confirm("Are you sure you want to clear all completed todos?"); | ||
if (deleteConfirm) { | ||
console.log('delete') | ||
} | ||
} | ||
render() { | ||
const { showMenu } = this.props | ||
const showOrHide = (showMenu) ? 'flex' : 'none' | ||
return ( | ||
<div className='settings-wrapper' style={{display: showOrHide}}> | ||
<div className='settings-content'> | ||
<span className='settings-close' onClick={this.props.handleModalClose}>❌</span> | ||
<h2>Settings</h2> | ||
<div className='settings-section' onClick={this.handleDelete}> | ||
<button className='btn-danger'> | ||
Clear All Completed Todos | ||
</button> | ||
</div> | ||
<div className='settings-section' style={{display: 'none'}}> | ||
<div className='settings-header'>Sort Todos:</div> | ||
<div className='settings-options-wrapper' data-setting='sortOrder'> | ||
<div | ||
className='settings-option' | ||
onClick={this.changeSetting} | ||
data-value='desc'> | ||
Oldest First ▼ | ||
</div> | ||
<div | ||
className='settings-option' | ||
onClick={this.changeSetting} | ||
data-value='asc'> | ||
Most Recent First ▲ | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
) | ||
} | ||
} |
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