Skip to content
This repository has been archived by the owner on Jan 6, 2022. It is now read-only.

Readded info-screen #523

Merged
merged 17 commits into from
Apr 15, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 0 additions & 9 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,3 @@ deploy:
on:
branch: master
skip_cleanup: true
notifications:
irc:
channels:
- "chat.freenode.net#datbots"
template:
- "%{repository_slug} - %{commit_subject} - %{result} - %{build_url}"
skip_join: true
on_success: change
on_failure: always
6 changes: 5 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,8 @@ If there is no issue that describes your poblem, go ahead and [open a new issue]
2. What operating system and processor architecture are you using?
3. What did you do?
4. What did you expect to see?
5. What did you see instead?
5. What did you see instead?

## Pull Requests

Please give 2 week days of time for reviews on each Pull Request, as we are a distributed team of non-fulltime contributors.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
alt="Build Status" />
</a>
<!-- Standard -->
<a href="https://codecov.io/github/yoshuawuyts/choo">
<a href="https://standardjs.com">
<img src="https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat-square"
alt="Standard" />
</a>
Expand Down
4 changes: 4 additions & 0 deletions app/actions/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -328,3 +328,7 @@ const storeOnDisk = async () => {
await writeFile(`${dir}/dats.json`, JSON.stringify(datsState))
await writeFile(`${dir}/paused.json`, JSON.stringify(pausedState))
}

export const toggleMenu = visible => dispatch => {
dispatch({ type: 'TOGGLE_MENU', visible })
}
1 change: 1 addition & 0 deletions app/components/button.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ const BaseButton = styled.button`

const HeaderButton = BaseButton.extend`
color: var(--color-neutral-30);
height:2rem;
:hover,
:focus {
color: var(--color-white);
Expand Down
3 changes: 2 additions & 1 deletion app/components/dat-import.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,10 @@ const Label = styled.label`
}
input {
height: 2rem;
width: 7.25rem;
width: 7.5rem;
padding-right: 0.5rem;
padding-left: 2rem;
border-radius:2px;
border: 1px solid transparent;
background-color: transparent;
color: var(--color-neutral-30);
Expand Down
42 changes: 38 additions & 4 deletions app/components/header.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

import React from 'react'
import styled from 'styled-components'
import { transparentize } from 'polished'
import { neutral } from 'dat-colors'
import { default as DatImport } from '../containers/dat-import'
import * as Button from './button'
import Icon from './icon'
Expand All @@ -12,21 +14,53 @@ const Container = styled.header`
-webkit-app-region: drag;
background-color: var(--color-neutral);
color: var(--color-white);
z-index: 4;
`

const Header = ({ onShare }) => (
<Container>
const HideLayer = styled.div`
position: absolute;
background: ${transparentize(0.85, neutral)};
width: 100%;
height: 100%;
left: 0;
top: 0;
z-index: 5;
`

const Header = ({ onShare, onMenu, onReport, menuVisible, version }) => {
const toggleMenu = () => onMenu(!menuVisible)
return <Container>
{ menuVisible && <HideLayer onClick={toggleMenu} /> }
<div className='fr relative'>
<DatImport />
<Button.Header
icon={<Icon name='create-new-dat' style={{ width: '1.2em' }} />}
className='ml2 ml3-l b--transparent v-mid color-neutral-30 hover-color-white f7 f6-l'
className='b--transparent v-mid color-neutral-30 hover-color-white f7 f6-l'
onClick={onShare}
>
Share Folder
</Button.Header>
<Button.Header
icon={<Icon name='menu' style={{ width: '1.2em' }} />}
className='ml2 v-mid color-neutral-20 hover-color-white pointer'
onClick={toggleMenu}
>
</Button.Header>
{ menuVisible &&
<div className="absolute right-0 br1 w5 pa3 bg-neutral" style={{ top: '3rem', zIndex: 6 }}>
<h3 className="f6 f5-l mb2">
Dat Desktop {version}
</h3>
<p className="f6 f5-l mb3">
Dat Desktop is a peer to peer sharing app built for humans by humans.
</p>
<p className="f6 f5-l">
<a onClick={onReport} href="#" className="color-neutral-50 hover-color-neutral-70">Report Bug</a>
</p>
</div>
}
</div>
</Container>
)
}

export default Header
2 changes: 1 addition & 1 deletion app/components/status-bar.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const Bar = styled.div`
position: absolute;
bottom: 0;
width: 100%;
padding: 0.5rem 1rem;
padding: .5rem 1rem .75rem;
background-color: var(--color-neutral-04);
color: var(--color-neutral-60);
`
Expand Down
2 changes: 1 addition & 1 deletion app/components/status.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import bytes from 'prettier-bytes'
const ProgressBar = styled.div`
--progress-height: 0.5rem;
--bar-height: var(--progress-height);
--counter-width: 2.5rem;
--counter-width: 3.0rem;
--tile-width: 28px;
--stripe-width: 5px;
min-width: 8rem;
Expand Down
6 changes: 4 additions & 2 deletions app/components/table-row.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,10 @@ const IconContainer = styled.div`
color: var(--color-neutral-20);
svg {
vertical-align: middle;
width: 1.1em;
width: 0.75em;
max-height: 1.6em;
margin-top: -0.05em;
margin-right: 5px;
@media (min-width: 960px) {
width: 1.4em;
}
Expand Down Expand Up @@ -124,7 +126,7 @@ const LinkButton = ({ ...props }) => (
const DeleteButton = ({ ...props }) => (
<Button.Icon
icon={<Icon name='delete' />}
className='row-action'
className='row-action mr2'
{...props}
/>
)
Expand Down
12 changes: 9 additions & 3 deletions app/containers/header.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
import Header from '../components/header'
import { createDat } from '../actions'
import { createDat, toggleMenu } from '../actions'
import { connect } from 'react-redux'
import { shell } from 'electron'

const mapStateToProps = state => ({})
const mapStateToProps = state => ({
menuVisible: state.menu.visible,
version: state.version
})

const mapDispatchToProps = dispatch => ({
onShare: () => dispatch(createDat())
onShare: () => dispatch(createDat()),
onMenu: (visible) => dispatch(toggleMenu(visible)),
onReport: () => shell.openExternal('https://github.com/dat-land/dat-desktop/issues/')
})

const HeaderContainer = connect(mapStateToProps, mapDispatchToProps)(Header)
Expand Down
12 changes: 12 additions & 0 deletions app/reducers/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ const defaultState = {
intro: {
screen: 1
},
version: require('../../package.json').version,
menu: {
visible: false
},
titleEditInPlace: {
isEditing: false,
editValue: null
Expand Down Expand Up @@ -314,6 +318,14 @@ const redatApp = (state = defaultState, action) => {
}
}
}
case 'TOGGLE_MENU':
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do you think it would make more sense to call it TOGGLE_BUG_MENU instead?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right now it only shows the debug information but I believe it was added to hold more information.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

aha i see. looks good, i think we can merge it then

return {
...state,
menu: {
...state.menu,
visible: action.visible
}
}
default:
return state
}
Expand Down
2 changes: 2 additions & 0 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
environment:
ELECTRON_ENABLE_STACK_DUMPING: 'true'
DEBUG: '*,-nugget*,-eslint*,-extract-zip*,-sumchecker*,-electron-download*,-dependency-check*'
matrix:
- nodejs_version: "8"

Expand Down
5 changes: 5 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
"electron-default-menu": "^1.0.1",
"mirror-folder": "^2.1.1",
"ms": "^2.1.1",
"polished": "^1.9.2",
"prettier-bytes": "^1.0.4",
"react": "^16.2.0",
"react-dom": "^16.2.0",
Expand Down