blob: 81456aed8d709b2142afd3e7055d94583d9da7e9 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
|
<script>
import { GlButton } from '@gitlab/ui';
import { __ } from '~/locale';
export default {
components: {
GlButton,
},
props: {
value: {
type: String,
required: true,
},
},
computed: {
markdownEditorSelected() {
return this.value === 'markdown';
},
text() {
return this.markdownEditorSelected
? __('Switch to rich text editing')
: __('Switch to plain text editing');
},
},
};
</script>
<template>
<div class="content-editor-switcher gl-display-inline-flex gl-align-items-center">
<gl-button
class="btn btn-default btn-sm gl-button btn-default-tertiary gl-font-sm! gl-text-secondary! gl-px-4!"
data-qa-selector="editing_mode_switcher"
@click="$emit('input')"
>{{ text }}</gl-button
>
</div>
</template>
|