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

Feature/settings #27

Open
wants to merge 21 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
tidy up layout
  • Loading branch information
Kieran Gibb committed Feb 14, 2019
commit 608c122fb41d01739ac09eec33dc12159240f36c
3 changes: 0 additions & 3 deletions views/lib/cropper.mcss
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
Cropper {
input[type="file"] {
width: 14rem
}
div.lightbox {
div.lightbox__content {
div.canvas {
Expand Down
41 changes: 22 additions & 19 deletions views/settings/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,20 +29,24 @@ module.exports = function SettingsEdit (opts) {
return h('Settings', [
h('h1', 'Settings'),
h('section.inputs', [
h('div.avatar', [
h('label.avatar', 'Avatar'),
Cropper({ addBlob, image: state.avatar }),
computed(state.avatar, img => (img ? h('img.avatar', { src: blobUrl(img.link) }) : avatar(feedId, 10)))
]),
h('div.name', [
h('label.name', 'Name'),
computed(name(feedId), name => (
h('input.name', {
value: name,
'ev-input': (e) => state.name.set(e.target.value)
})
))
h('div.inputs', [
h('div.avatar', [
h('label.avatar', 'Avatar'),
Cropper({ addBlob, image: state.avatar }),
]),
h('div.name', [
h('label.name', 'Name'),
computed(name(feedId), name => (
h('input.name', {
value: name,
'ev-input': (e) => state.name.set(e.target.value)
})
))
])
]),
h('div.current', [
computed(state.avatar, img => (img ? h('img.avatar', { src: blobUrl(img.link) }) : avatar(feedId, 10)))
])
]),
h('section.actions', when(state.isSaving,
h('i.fa.fa-spinner.fa-pulse'),
Expand All @@ -52,12 +56,11 @@ module.exports = function SettingsEdit (opts) {
state.isSaving.set(false)
const name = resolve(state.name)
const image = resolve(state.avatar)
console.log("IS PUBLISHING")
// publish(Object.assign(about, { name, image }), (err, about) => {
// canSave.set(true)
// if (err) throw err
// console.log(about)
// })
publish(Object.assign(about, { name, image }), (err, about) => {
canSave.set(true)
if (err) throw err
else onCancel()
})
} }, 'Save')
]
))
Expand Down
39 changes: 23 additions & 16 deletions views/settings/edit.mcss
Original file line number Diff line number Diff line change
Expand Up @@ -25,29 +25,36 @@ Settings {
}

section.inputs {
display: grid
grid-gap: 1rem
display: grid;
grid-gap: 1rem;
grid-template-columns: 70% auto;

div {
div.Cropper {}
div.inputs {
display: grid
grid-template-columns: 7.5rem 15rem auto;
align-items: center
div {
display: grid;
grid-template-columns: 9rem auto;

label {
font-size: .8rem
text-transform: uppercase
letter-spacing: .1rem
}
div.Cropper {
input[type='file'] {
width: 14rem
}
}
align-items: center

label {
font-size: .8rem
text-transform: uppercase
letter-spacing: .1rem
}

input { }
input.quorum {
max-width: 18rem
input {
width: 14rem
}
}
textarea { min-height: 8rem }
}

div.avatar {
div.current {
a.Avatar {
justify-self: center
}
Expand Down