Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent the UI from breaking on small screens #72

Merged
merged 4 commits into from
Jan 15, 2020
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
4 changes: 4 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"trailingComma": "es5",
"singleQuote": true
}
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"eslint-plugin-import": "^2.7.0",
"eslint-plugin-prettier": "^2.1.2",
"gh-pages": "^1.0.0",
"node-sass": "^4.5.3",
"node-sass": "^4.13.0",
"prettier": "^1.5.3",
"raw-loader": "^0.5.1",
"react-scripts": "1.0.10"
Expand Down Expand Up @@ -45,8 +45,8 @@
"deploy": "scripts/deploy.sh",
"start": "yarn run build-css && yarn run watch-css & NODE_PATH=./src react-scripts start",
"build": "yarn run build-css && NODE_PATH=./src node_modules/.bin/react-scripts build",
"build-css": "node-sass src/stylesheets/application.sass src/index.css",
"watch-css": "node-sass src/stylesheets/application.sass src/index.css -w",
"build-css": "node_modules/.bin/node-sass src/stylesheets/application.sass src/index.css",
"watch-css": "node_modules/.bin/node-sass src/stylesheets/application.sass src/index.css -w",
"electron": "yarn run build && node_modules/.bin/electron-packager ./ --platform=all --arch=x64 --asar --overwrite --ignore=scripts --ignore=.gitignore --ignore=yarn.lock --ignore=.travis.yml --ignore=.*.zip --ignore=public --ignore=.nvmrc --ignore=.eslintrc.js --ignore=node_modules --ignore=src",
"dev-electron": "yarn run build && electron .",
"lint": "node_modules/.bin/eslint src/",
Expand Down
13 changes: 8 additions & 5 deletions public/index.html
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
<!doctype html>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="theme-color" content="#3498db">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta charset="utf-8" />
<meta name="theme-color" content="#3498db" />
<meta
name="viewport"
content="width=device-width, initial-scale=1, user-scalable=no"
/>
<!-- <link rel="shortcut icon" href="%PUBLIC_URL%/favicon.ico"> -->
<link rel="manifest" href="%PUBLIC_URL%/manifest.json">
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
<title>Secret-in</title>
</head>
<body style="background-color: #fafafa">
Expand Down
1 change: 1 addition & 0 deletions src/components/Sidebar.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ function Sidebar() {
{currentUser.username}
</SidebarMenuLink>
<div className="sidebar-separator" />

<SidebarMenuLink to="/secrets/all/">
<Icon id="apps" size="base" />
All
Expand Down
4 changes: 1 addition & 3 deletions src/components/import/ImportContainer.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,7 @@ class ImportContainer extends Component {
<Spinner />
{this.props.importTotal !== 0 && (
<div className="import-progress-title">
{`Importing... ${this.props.importStatus} / ${
this.props.importTotal
}`}
{`Importing... ${this.props.importStatus} / ${this.props.importTotal}`}
</div>
)}
</div>
Expand Down
4 changes: 1 addition & 3 deletions src/components/options/QRCodeShow.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,7 @@ class QRCodeShow extends Component {
<div className="totp-form-qrcode">
<QRCode
className="totp-form-qrcode"
value={`otpauth://totp/Secret-in.me?secret=${
this.state.seed.b32
}`}
value={`otpauth://totp/Secret-in.me?secret=${this.state.seed.b32}`}
size={256}
/>
</div>
Expand Down
21 changes: 10 additions & 11 deletions src/components/secrets/SecretField.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,17 +87,16 @@ class SecretField extends Component {
actions={new Immutable.List(actions)}
/>
<div className="secret-field-action">
{this.props.field.type === 'password' &&
this.props.canUpdate && (
<Button
title="Generate password"
buttonStyle="icon"
onClick={this.onGenerate}
tabIndex="-1"
>
<Icon id="generate" size="small" />
</Button>
)}
{this.props.field.type === 'password' && this.props.canUpdate && (
<Button
title="Generate password"
buttonStyle="icon"
onClick={this.onGenerate}
tabIndex="-1"
>
<Icon id="generate" size="small" />
</Button>
)}
</div>
</div>
);
Expand Down
18 changes: 8 additions & 10 deletions src/stores/ShowSecretUIStore.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,16 +109,14 @@ class ShowSecretUIStore {
this.waitFor(MetadataStore);
this.setState(
this.state
.update(
'secret',
secret =>
secret
? secret.merge(
MetadataStore.getById(this.state.secret.id)
.toMap()
.remove('data')
)
: null
.update('secret', secret =>
secret
? secret.merge(
MetadataStore.getById(this.state.secret.id)
.toMap()
.remove('data')
)
: null
)
.set('isUpdating', false)
.set('errors', new Immutable.Map())
Expand Down
5 changes: 5 additions & 0 deletions src/stylesheets/_common.sass
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
/* Under this width, we start removing bits of the UI*/
$width-small: 500px

*
-webkit-font-smoothing: antialiased
box-sizing: border-box
Expand All @@ -24,6 +27,8 @@ body,
padding: 20px
flex-direction: column
align-items: stretch
@media screen and (max-width: $width-small)
padding: 5px

h1, h2, h3, h4, h5, h6
margin: 0
Expand Down
3 changes: 2 additions & 1 deletion src/stylesheets/components/Layout.sass
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@

.layout
min-width: 800px
min-width: 300px
flex: 1 1 100%
display: flex
flex-direction: row
Expand Down
26 changes: 20 additions & 6 deletions src/stylesheets/components/Sidebar.sass
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.sidebar
position: relative
flex: 0 0 240px
width: 240px
flex: 0 0 30vw
min-width: 90px
&:after
content: ''
position: absolute
Expand All @@ -19,29 +19,43 @@
height: 50px
color: rgba($color-brand, .4)
border-bottom: 1px solid rgba($color-brand, .05)
a
color: inherit
text-decoration: inherit
@media screen and (max-width: $width-small)
font-size: 12px
margin: 0 5px
height: 30px

a
color: inherit
text-decoration: inherit

.sidebar-menu
list-style: none
margin: 20px
padding: 0
@media screen and (max-width: $width-small)
margin: 5px

.sidebar-menu-item
margin: 0
padding: 0

.sidebar-menu-item--home
@media screen and (max-width: $width-small)
display: none

.sidebar-menu-link
display: flex
flex-direction: row
align-items: center
height: 44px
min-height: 44px
font-size: 15px
color: inherit
padding: 0 12px 0 8px
margin: 0 0 2px
border-radius: 3px
@media screen and (max-width: $width-small)
font-size: 12px
padding: 0 4px 0 2px

.sidebar-menu-link:hover
background-color: rgba($color-brand, .1)
Expand Down
9 changes: 8 additions & 1 deletion src/stylesheets/components/secrets/SecretListItem.sass
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@

.secret-list-item
height: 50px
min-height: 50px
background-color: transparent

.secret-list-item:hover
Expand All @@ -10,6 +11,8 @@
padding: 0 0 0 10px
border-bottom: 1px solid rgba($color-brand, .05)
vertical-align: middle
@media screen and (max-width: $width-small)
padding: 0 0 0 2px

.secret-list-content-table--is-dragging
.secret-list-item
Expand Down Expand Up @@ -50,9 +53,13 @@

.secret-list-item-column--last-modified
width: 200px
@media screen and (max-width: $width-small)
display: none

.secret-list-item-column--shared-with
width: 80px
@media screen and (max-width: $width-small)
display: none

.secret-list-item-column--actions
width: 36px
Expand Down
2 changes: 2 additions & 0 deletions src/stylesheets/components/utilities/Breadcrumb.sass
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
align-items: center
height: 24px
font-size: 18px
@media screen and (max-width: $width-small)
font-size: 1rem

.breadcrumb-item-separator
display: block
Expand Down
3 changes: 3 additions & 0 deletions src/stylesheets/components/utilities/Button.sass
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@
font-size: 11px
padding: 0 16px 1px
border-radius: 3px
@media screen and (max-width: $width-small)
height: 44px
padding: 5px 16px

.dropdown button,
.button--size-base
Expand Down
2 changes: 1 addition & 1 deletion src/stylesheets/components/utilities/Input.sass
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@

&.input--size-small input,
&.input--size-small select
height: 28px
height: 25px
font-size: 12px
padding: 0 8px
border-radius: 2px
Expand Down
3 changes: 2 additions & 1 deletion src/stylesheets/components/utilities/Modal.sass
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@
.modal-dialog
position: relative
background-color: #FFF
width: 480px
max-width: 480px
width: 100%
border-radius: 3px

.modal-dialog:focus
Expand Down
7 changes: 7 additions & 0 deletions src/stylesheets/components/utilities/Page.sass
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@
margin: 0 20px 0px
height: 50px
border-bottom: 1px solid rgba($color-brand, .05)
@media screen and (max-width: $width-small)
flex: 0 0 30px
height: 30px
margin: 0 5px 0px

.secret-list-refresh
margin-right: 10px
Expand All @@ -28,6 +32,9 @@
overflow: auto
margin-top: 20px
padding: 0 0px 20px 20px
@media screen and (max-width: $width-small)
padding: 0 5px
margin-top: 5px

.page-content-actions
display: inherit
Expand Down
Loading