@@ -2,12 +2,18 @@ import Component from "@glimmer/component";
2
2
import { tracked } from " @glimmer/tracking" ;
3
3
import { action } from " @ember/object" ;
4
4
import didInsert from " @ember/render-modifiers/modifiers/did-insert" ;
5
+ import { eq } from " truth-helpers" ;
6
+ import DButton from " discourse/components/d-button" ;
7
+ import concatClass from " discourse/helpers/concat-class" ;
5
8
import { ajax } from " discourse/lib/ajax" ;
6
9
import { popupAjaxError } from " discourse/lib/ajax-error" ;
10
+ import Reactions from " discourse/plugins/discourse-rewind/discourse/components/reports/reactions" ;
7
11
8
12
export default class Rewind extends Component {
9
13
@tracked rewind = [];
10
14
15
+ @tracked fullScreen = true ;
16
+
11
17
@action
12
18
async loadRewind () {
13
19
try {
@@ -17,10 +23,34 @@ export default class Rewind extends Component {
17
23
}
18
24
}
19
25
26
+ @action
27
+ toggleFullScreen () {
28
+ this .fullScreen = ! this .fullScreen ;
29
+ }
30
+
31
+ reportComponentForIdentifier (identifier ) {
32
+ if (identifier === " reactions" ) {
33
+ return Reactions;
34
+ }
35
+ }
36
+
20
37
<template >
21
- <div class =" rewind" {{didInsert this . loadRewind}} >
38
+ <div
39
+ class ={{concatClass " rewind" ( if this . fullScreen " -fullscreen" ) }}
40
+ {{didInsert this . loadRewind}}
41
+ >
42
+ <DButton
43
+ class =" rewind__exit-fullscreen-btn"
44
+ @ icon ={{if this . fullScreen " discourse-compress" " discourse-expand" }}
45
+ title =" Toggle fullscreen"
46
+ @ action ={{this .toggleFullScreen }}
47
+ />
22
48
{{#each this . rewind as | report | }}
23
- <p >{{report.identifier }} </p >
49
+ {{#if ( eq report.identifier " reactions" ) }}
50
+ <div class =" rewind-report" >
51
+ <Reactions @ report ={{report }} />
52
+ </div >
53
+ {{/if }}
24
54
{{/each }}
25
55
</div >
26
56
</template >
0 commit comments