diff options
| author | syuilo <syuilotan@yahoo.co.jp> | 2018-09-13 18:01:50 +0900 |
|---|---|---|
| committer | syuilo <syuilotan@yahoo.co.jp> | 2018-09-13 18:01:50 +0900 |
| commit | 03e1d3fbc45252b05bf5abdb8ffee28297400acc (patch) | |
| tree | 179cb4e67fc8c4434748346c7d36dd243e46501a /src/client/app/common | |
| parent | CWが適用されない箇所を修正 (diff) | |
| download | misskey-03e1d3fbc45252b05bf5abdb8ffee28297400acc.tar.gz misskey-03e1d3fbc45252b05bf5abdb8ffee28297400acc.tar.bz2 misskey-03e1d3fbc45252b05bf5abdb8ffee28297400acc.zip | |
Refactor
Diffstat (limited to 'src/client/app/common')
| -rw-r--r-- | src/client/app/common/views/components/cw-button.vue | 44 | ||||
| -rw-r--r-- | src/client/app/common/views/components/index.ts | 2 |
2 files changed, 46 insertions, 0 deletions
diff --git a/src/client/app/common/views/components/cw-button.vue b/src/client/app/common/views/components/cw-button.vue new file mode 100644 index 0000000000..06087edc93 --- /dev/null +++ b/src/client/app/common/views/components/cw-button.vue @@ -0,0 +1,44 @@ +<template> +<button class="nrvgflfuaxwgkxoynpnumyookecqrrvh" @click="toggle">{{ value ? '%i18n:@hide%' : '%i18n:@show%' }}</button> +</template> + +<script lang="ts"> +import Vue from 'vue'; + +export default Vue.extend({ + props: { + value: { + type: Boolean, + required: true + } + }, + + methods: { + toggle() { + this.$emit('input', !this.value); + } + } +}); +</script> + +<style lang="stylus" scoped> +root(isDark) + display inline-block + padding 4px 8px + font-size 0.7em + color isDark ? #393f4f : #fff + background isDark ? #687390 : #b1b9c1 + border-radius 2px + cursor pointer + user-select none + + &:hover + background isDark ? #707b97 : #bbc4ce + +.nrvgflfuaxwgkxoynpnumyookecqrrvh[data-darkmode] + root(true) + +.nrvgflfuaxwgkxoynpnumyookecqrrvh:not([data-darkmode]) + root(false) + +</style> diff --git a/src/client/app/common/views/components/index.ts b/src/client/app/common/views/components/index.ts index 75c6086d7c..6f8152cea2 100644 --- a/src/client/app/common/views/components/index.ts +++ b/src/client/app/common/views/components/index.ts @@ -1,5 +1,6 @@ import Vue from 'vue'; +import cwButton from './cw-button.vue'; import tagCloud from './tag-cloud.vue'; import trends from './trends.vue'; import analogClock from './analog-clock.vue'; @@ -42,6 +43,7 @@ import uiSelect from './ui/select.vue'; import formButton from './ui/form/button.vue'; import formRadio from './ui/form/radio.vue'; +Vue.component('mk-cw-button', cwButton); Vue.component('mk-tag-cloud', tagCloud); Vue.component('mk-trends', trends); Vue.component('mk-analog-clock', analogClock); |