-
-
Notifications
You must be signed in to change notification settings - Fork 82
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
refs #251 Show toot design sample in appearance setting page #620
Merged
Changes from 1 commit
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
78605f1
refs #251 Move appearance settings to separate page
h3poteto 4608418
refs #251 Fix design of language setting
h3poteto c58a5a7
refs #251 Fix design of notification setting
h3poteto 72e6073
refs #251 Fix design of general setting
h3poteto 9410b44
refs #251 Update i18n keys in toot visibility
h3poteto 2c76e89
refs #251 Update translation files for preferences
h3poteto a2d49ac
refs #251 Fix float setting
h3poteto 4890709
refs #251 [stylelint] Fix style formats
h3poteto File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,14 @@ | ||
export default { | ||
DisplayNameAndUsername: { | ||
name: 'preferences.general.display_style.display_name_and_username', | ||
name: 'preferences.appearance.display_style.display_name_and_username', | ||
value: 0 | ||
}, | ||
DisplayName: { | ||
name: 'preferences.general.display_style.display_name', | ||
name: 'preferences.appearance.display_style.display_name', | ||
value: 1 | ||
}, | ||
Username: { | ||
name: 'preferences.general.display_style.username', | ||
name: 'preferences.appearance.display_style.username', | ||
value: 2 | ||
} | ||
} |
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 |
---|---|---|
@@ -1,10 +1,10 @@ | ||
export default { | ||
Light: { | ||
name: 'preferences.general.theme.light', | ||
name: 'preferences.appearance.theme.light', | ||
key: 'light' | ||
}, | ||
Dark: { | ||
name: 'preferences.general.theme.dark', | ||
name: 'preferences.appearance.theme.dark', | ||
key: 'dark' | ||
} | ||
} |
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 |
---|---|---|
@@ -1,10 +1,10 @@ | ||
export default { | ||
Absolute: { | ||
name: 'preferences.general.time_format.absolute', | ||
name: 'preferences.appearance.time_format.absolute', | ||
value: 0 | ||
}, | ||
Relative: { | ||
name: 'preferences.general.time_format.relative', | ||
name: 'preferences.appearance.time_format.relative', | ||
value: 1 | ||
} | ||
} |
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,150 @@ | ||
<template> | ||
<div id="appearance"> | ||
<h2>{{ $t('preferences.appearance.title') }}</h2> | ||
<div class="theme section"> | ||
<div class="left"> | ||
<h4>{{ $t('preferences.appearance.theme_color') }}</h4> | ||
<span class="status"> | ||
<el-select v-model="theme" placeholder="theme"> | ||
<el-option | ||
v-for="t in themes" | ||
:key="t.key" | ||
:label="$t(t.name)" | ||
:value="t.key"> | ||
</el-option> | ||
</el-select> | ||
</span> | ||
</div> | ||
<div class="right"> | ||
<Toot | ||
:displayNameStyle="displayNameStyle" | ||
:timeFormat="timeFormat" | ||
></Toot> | ||
</div> | ||
</div> | ||
<div class="font section"> | ||
<h4>{{ $t('preferences.appearance.font_size') }}</h4> | ||
<span class="status"> | ||
<el-input-number :value="fontSize" :min="9" :max="18" @change="updateFontSize"></el-input-number> | ||
</span> | ||
</div> | ||
<div class="display-style section"> | ||
<h4>{{ $t('preferences.appearance.display_style.title') }}</h4> | ||
<span class="status"> | ||
<el-select v-model="displayNameStyle" placeholder="style"> | ||
<el-option | ||
v-for="style in nameStyles" | ||
:key="style.value" | ||
:label="$t(style.name)" | ||
:value="style.value"> | ||
</el-option> | ||
</el-select> | ||
</span> | ||
</div> | ||
<div class="time-format section"> | ||
<h4>{{ $t('preferences.appearance.time_format.title') }}</h4> | ||
<span class="status"> | ||
<el-select v-model="timeFormat" placeholder="format"> | ||
<el-option | ||
v-for="format in timeFormats" | ||
:key="format.value" | ||
:label="$t(format.name)" | ||
:value="format.value"> | ||
</el-option> | ||
</el-select> | ||
</span> | ||
</div> | ||
</div> | ||
</template> | ||
|
||
<script> | ||
import { mapState } from 'vuex' | ||
import Toot from './Appearance/Toot' | ||
import DisplayStyle from '~/src/constants/displayStyle' | ||
import Theme from '~/src/constants/theme' | ||
import TimeFormat from '~/src/constants/timeFormat' | ||
|
||
export default { | ||
name: 'appearance', | ||
components: { | ||
Toot | ||
}, | ||
data () { | ||
return { | ||
nameStyles: [ | ||
DisplayStyle.DisplayNameAndUsername, | ||
DisplayStyle.DisplayName, | ||
DisplayStyle.Username | ||
], | ||
themes: [ | ||
Theme.Light, | ||
Theme.Dark | ||
], | ||
timeFormats: [ | ||
TimeFormat.Absolute, | ||
TimeFormat.Relative | ||
] | ||
} | ||
}, | ||
computed: { | ||
...mapState('Preferences/Appearance', { | ||
fontSize: state => state.appearance.fontSize | ||
}), | ||
theme: { | ||
get () { | ||
return this.$store.state.Preferences.Appearance.appearance.theme | ||
}, | ||
set (value) { | ||
this.$store.dispatch('Preferences/Appearance/updateTheme', value) | ||
} | ||
}, | ||
displayNameStyle: { | ||
get () { | ||
return this.$store.state.Preferences.Appearance.appearance.displayNameStyle | ||
}, | ||
set (value) { | ||
this.$store.dispatch('Preferences/Appearance/updateDisplayNameStyle', value) | ||
} | ||
}, | ||
timeFormat: { | ||
get () { | ||
return this.$store.state.Preferences.Appearance.appearance.timeFormat | ||
}, | ||
set (value) { | ||
this.$store.dispatch('Preferences/Appearance/updateTimeFormat', value) | ||
} | ||
} | ||
}, | ||
created () { | ||
this.$store.dispatch('Preferences/Appearance/loadAppearance') | ||
}, | ||
methods: { | ||
updateFontSize (value) { | ||
this.$store.dispatch('Preferences/Appearance/updateFontSize', value) | ||
} | ||
} | ||
} | ||
</script> | ||
|
||
<style lang="scss" scoped> | ||
#appearance { | ||
color: var(--theme-secondary-color); | ||
box-sizing: border-box; | ||
|
||
.theme { | ||
display: flex; | ||
align-items: flex-start; | ||
|
||
.left { | ||
} | ||
|
||
.right { | ||
margin-left: 40px; | ||
} | ||
} | ||
|
||
.section { | ||
margin-bottom: 48px; | ||
} | ||
} | ||
</style> |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[stylelint]
Unexpected empty block (block-no-empty)