git ssb

2+

mixmix / ticktack



Commit ee8e72469e3082880b91e42e3ed64747ad35033f

settings page includes profile

mix irving committed on 8/27/2017, 11:11:32 PM
Parent: 0052f2414e13f7d307466526f1eeceabc0d27695

Files changed

app/page/groupFind.mcsschanged
app/page/settings.jschanged
app/page/settings.mcsschanged
app/page/userEdit.mcsschanged
app/page/userFind.mcsschanged
styles/mixins.jschanged
translations/en.jschanged
translations/zh.jschanged
app/page/groupFind.mcssView
@@ -1,7 +1,7 @@
11 Page -groupFind {
22 div.container {
3- max-width: 40rem
3+ $maxWidthSmaller
44 div.search {
55 background-color: #fff
66
77 margin-bottom: 1rem
@@ -25,9 +25,9 @@
2525 }
2626
2727
2828 div.results {
29- max-width: 40rem
29+ $maxWidthSmaller
3030
3131 div.Link {
3232 div.result {
3333 background-color: #fff
app/page/settings.jsView
@@ -3,8 +3,12 @@
33
44 exports.gives = nest('app.page.settings')
55
66 exports.needs = nest({
7+ 'about.html.image': 'first',
8+ 'about.obs.name': 'first',
9+ 'history.sync.push': 'first',
10+ 'keys.sync.id': 'first',
711 'settings.sync.get': 'first',
812 'settings.sync.set': 'first',
913 'settings.obs.get': 'first',
1014 'translations.sync.strings': 'first',
@@ -23,11 +27,35 @@
2327 api.settings.obs.get()(() => {
2428 window.location.reload()
2529 })
2630
31+ const feed = api.keys.sync.id()
2732 const strings = api.translations.sync.strings()
2833 const currentLanguage = api.settings.sync.get('language')
2934
35+ return h('Page -settings', [
36+ h('div.container', [
37+ h('h1', strings.settingsPage.title),
38+ h('section -profile', [
39+ h('header', strings.settingsPage.section.profile),
40+ h('div.profile', [
41+ h('div.name', api.about.obs.name(feed)),
42+ api.about.html.image(feed),
43+ ]),
44+ h('div.actions', [
45+ h('Button', { 'ev-click': () => api.history.sync.push({page:'userEdit', feed}) }, [
46+ strings.settingsPage.action.edit,
47+ h('i.fa.fa-pencil')
48+ ])
49+ ])
50+ ]),
51+ h('section -language', [
52+ h('header', strings.settingsPage.section.language),
53+ h('div.languages', LANGUAGES.map(Language))
54+ ])
55+ ])
56+ ])
57+
3058 function Language (lang) {
3159 const selectLang = () => api.settings.sync.set({ language: lang })
3260 const className = currentLanguage === lang ? '-primary' : ''
3361
@@ -39,13 +67,7 @@
3967 lang
4068 )
4169 }
4270
43- return h('Page -settings', [
44- h('div.container', [
45- h('h1', strings.settings),
46- h('div.languages', LANGUAGES.map(Language))
47- ])
48- ])
4971 }
5072 }
5173
app/page/settings.mcssView
@@ -1,15 +1,54 @@
11 Page -settings {
2+ padding-top: 1rem
3+
24 div.container {
3- div.languages {
4- background: #fff
5- padding: 1rem
6- padding-bottom: 14rem
5+ background: #fff
6+ padding: 1rem
7+ $maxWidthSmaller
78
8- display: flex
9+ section {
10+ padding-bottom: 2rem
11+ margin-bottom: 2rem
12+
13+ header {
14+ font-size: 1.4rem
15+ margin-bottom: 1rem
16+ }
17+
18+ -profile {
19+ div.profile {
20+ display: flex
21+ flex-direction: column
22+
23+ div.name {
24+ margin-bottom: .5rem
25+ }
26+ img.Avatar {
27+ width: 8rem
28+ height: 8rem
29+ }
30+ margin-bottom: .5rem
31+ }
32+
33+ div.actions {
34+ display:flex
35+
36+ div.Button {
37+ i.fa { margin-left: .4rem }
38+ }
39+ }
40+ }
41+
42+ -language {
43+ div.languages {
44+ display: flex
45+ }
46+ }
947 }
1048 }
1149 }
1250
1351 Button -language {
1452 margin-right: 1rem
1553 }
54+
app/page/userEdit.mcssView
@@ -1,7 +1,7 @@
11 Page -userEdit {
22 div.container {
3- max-width: 40rem
3+ $maxWidthSmaller
44
55 }
66 }
77
app/page/userFind.mcssView
@@ -1,7 +1,7 @@
11 Page -userFind {
22 div.container {
3- max-width: 40rem
3+ $maxWidthSmaller
44 div.search {
55 background-color: #fff
66
77 margin-bottom: 1rem
@@ -25,9 +25,9 @@
2525 }
2626
2727
2828 div.results {
29- max-width: 40rem
29+ $maxWidthSmaller
3030
3131 div.Link {
3232 div.result {
3333 background-color: #fff
styles/mixins.jsView
@@ -19,8 +19,12 @@
1919 $maxWidth {
2020 max-width: 1200px
2121 }
2222
23+$maxWidthSmaller {
24+ max-width: 40rem
25+}
26+
2327 $colorPrimary {
2428 color: white
2529 background-color: #3dc8c3
2630
translations/en.jsView
@@ -25,9 +25,18 @@
2525 createFirstThread: 'Start this group by posting the first thread.'
2626 }
2727 },
2828 groupIndex: "Group Index",
29- settings: "Settings",
29+ settingsPage: {
30+ title: "Settings",
31+ action: {
32+ edit: 'Edit',
33+ },
34+ section: {
35+ language: 'Language',
36+ profile: 'Profile',
37+ }
38+ },
3039 threadNew: {
3140 pageTitle: 'New Thread',
3241 field: {
3342 to: 'To',
translations/zh.jsView
@@ -25,9 +25,11 @@
2525 createFirstThread: '发布第一个话题来开始群组讨论'
2626 }
2727 },
2828 groupIndex: '群组列表',
29- settings: '设置',
29+ settingsPage: {
30+ title: '设置',
31+ },
3032 threadNew: {
3133 pageTitle: '新建话题',
3234 field: {
3335 to: '发送给',

Built with git-ssb-web