-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* (wip) Add Settings page * (wip) Add Settings page Fix error using <Pager/> component * Translation i18n of the Settings item * Fix indentation * Update Settings list view style
- Loading branch information
1 parent
51e0ff8
commit 71200a9
Showing
13 changed files
with
122 additions
and
9 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
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 |
---|---|---|
@@ -0,0 +1,43 @@ | ||
import { h } from 'preact' | ||
import { useRef, useEffect } from 'preact/hooks' | ||
import { useNavigation, useI18n, useLanguage, useSoftkey } from 'hooks' | ||
import { ListView } from 'components' | ||
|
||
export const Settings = () => { | ||
const containerRef = useRef() | ||
const i18n = useI18n() | ||
const lang = useLanguage() | ||
const softkey = useSoftkey() | ||
|
||
const [, setNavigation] = useNavigation(containerRef, 'y') | ||
|
||
useEffect(() => { | ||
setNavigation(0) | ||
softkey.dispatch({ type: 'setLeftText', value: '' }) | ||
softkey.dispatch({ type: 'setRightText', value: i18n.i18n('close') }) | ||
softkey.dispatch({ type: 'setOnKeyRight', event: () => history.back() }) | ||
softkey.dispatch({ type: 'setCenterText', value: i18n.i18n('centerkey-select') }) | ||
softkey.dispatch({ type: 'setOnKeyCenter', event: onKeyCenter }) | ||
}, []) | ||
|
||
const onKeyCenter = () => { | ||
// @todo different action depending on the selected item | ||
} | ||
|
||
const items = [ | ||
{ title: i18n.i18n('settings-language') }, | ||
{ title: i18n.i18n('settings-textsize') }, | ||
{ title: i18n.i18n('settings-about-wikipedia') }, | ||
{ title: i18n.i18n('settings-privacy'), link: 'https://foundation.m.wikimedia.org/wiki/Privacy_policy' }, | ||
{ title: i18n.i18n('settings-term'), link: `https://foundation.m.wikimedia.org/wiki/Terms_of_Use/${lang}` }, | ||
{ title: i18n.i18n('settings-rate') }, | ||
{ title: i18n.i18n('settings-help-feedback') }, | ||
{ title: i18n.i18n('settings-about-app') } | ||
] | ||
|
||
return <div class='page settings'> | ||
{/* @todo thinking of <Header name='settings'/> */} | ||
<div class='header'>Settings</div> | ||
<ListView items={items} containerRef={containerRef} /> | ||
</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
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 |
---|---|---|
|
@@ -28,4 +28,9 @@ | |
.searchmatch { | ||
font-weight: bold; | ||
} | ||
|
||
.list { | ||
top: 66px; | ||
bottom: @softkeysHeight; | ||
} | ||
} |
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,27 @@ | ||
.settings { | ||
|
||
.header { | ||
height: @pageHeaderHeight; | ||
max-height: @pageHeaderHeight; | ||
background-color: #d8d8d8; | ||
box-sizing: border-box; | ||
padding: 3px 0; | ||
font-family: @textFont regular; | ||
font-size: 17px; | ||
text-align: center; | ||
} | ||
|
||
.list { | ||
top: @pageHeaderHeight; | ||
bottom: @softkeysHeight; | ||
|
||
.info .title { | ||
font-family: @textFont; | ||
font-size: 17px; | ||
} | ||
|
||
.item[nav-selected="true"] { | ||
background-color: #eaecf0; | ||
} | ||
} | ||
} |
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 |
---|---|---|
|
@@ -5,4 +5,5 @@ | |
@import './article'; | ||
@import './softkey'; | ||
@import './search'; | ||
@import './settings'; | ||
@import './listview'; |
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