Skip to content

Commit

Permalink
Merge branch 'master' into 1936-migrate-font-loader
Browse files Browse the repository at this point in the history
  • Loading branch information
chan-j-d committed Sep 30, 2023
2 parents b22af0e + 46409aa commit e1a49a7
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions frontend/src/components/c-segment.vue
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,13 @@
)
</template>

<script>
<script lang='ts'>
import { defineComponent } from 'vue';
import { mapState } from 'vuex';
import Segment from '../utils/segment';
import { StoreState } from '../types/vuex.d';
export default {
export default defineComponent({
name: 'c-segment',
props: {
segment: {
Expand All @@ -49,22 +51,22 @@ export default {
},
data() {
return {
isOpen: this.segment.knownAuthor || this.segment.lines.length < 5,
canOpen: !this.segment.knownAuthor && this.segment.lines.length > 4,
transparencyValue: '30',
isOpen: (this.segment.knownAuthor !== null) || this.segment.lines.length < 5 as boolean,
canOpen: (this.segment.knownAuthor === null) && this.segment.lines.length > 4 as boolean,
transparencyValue: '30' as string,
};
},
computed: {
...mapState({
authorColors: ['tabAuthorColors'],
authorColors: (state: unknown) => (state as StoreState).tabAuthorColors,
}),
},
methods: {
toggleCode() {
this.isOpen = !this.isOpen;
},
},
};
});
</script>

<style lang="css">
Expand Down

0 comments on commit e1a49a7

Please sign in to comment.