Skip to content

Commit baf19cb

Browse files
committed
base design
1 parent 66ec74b commit baf19cb

File tree

10 files changed

+101
-3
lines changed

10 files changed

+101
-3
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import Component from "@glimmer/component";
2+
3+
export default class Reactions extends Component {
4+
<template>
5+
<div class="rewind-report-page">
6+
Let's take a look at the reactions you've used this year!
7+
</div>
8+
9+
<div class="rewind-report-page">
10+
page 2
11+
</div>
12+
</template>
13+
}

assets/javascripts/discourse/components/rewind.gjs

+32-2
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,18 @@ import Component from "@glimmer/component";
22
import { tracked } from "@glimmer/tracking";
33
import { action } from "@ember/object";
44
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";
58
import { ajax } from "discourse/lib/ajax";
69
import { popupAjaxError } from "discourse/lib/ajax-error";
10+
import Reactions from "discourse/plugins/discourse-rewind/discourse/components/reports/reactions";
711

812
export default class Rewind extends Component {
913
@tracked rewind = [];
1014

15+
@tracked fullScreen = true;
16+
1117
@action
1218
async loadRewind() {
1319
try {
@@ -17,10 +23,34 @@ export default class Rewind extends Component {
1723
}
1824
}
1925

26+
@action
27+
toggleFullScreen() {
28+
this.fullScreen = !this.fullScreen;
29+
}
30+
31+
reportComponentForIdentifier(identifier) {
32+
if (identifier === "reactions") {
33+
return Reactions;
34+
}
35+
}
36+
2037
<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+
/>
2248
{{#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}}
2454
{{/each}}
2555
</div>
2656
</template>

assets/stylesheets/common/card.scss

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
.rewind-card {
2+
}

assets/stylesheets/common/index.scss

+2
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
11
@import "rewind";
2+
@import "report";
3+
@import "card";

assets/stylesheets/common/report.scss

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
.rewind-report {
2+
}
3+
4+
.rewind-report-page {
5+
display: flex;
6+
align-items: center;
7+
justify-content: center;
8+
padding: 1em;
9+
box-sizing: border-box;
10+
font-weight: 700;
11+
font-size: var(--font-up-2);
12+
height: 100cqh;
13+
width: 100cqw;
14+
}

assets/stylesheets/common/rewind.scss

+24-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,29 @@
11
.rewind {
22
width: 280px;
33
height: 400px;
4-
background-color: var(--secondary-high);
4+
background-color: var(--secondary);
55
border-radius: var(--d-border-radius);
6+
overflow-y: auto;
7+
overflow-x: hidden;
8+
border: 1px solid var(--primary-very-low);
9+
box-sizing: border-box;
10+
position: relative;
11+
container-type: size;
12+
13+
&.-fullscreen {
14+
top: 0;
15+
left: 0;
16+
right: 0;
17+
bottom: 0;
18+
z-index: 9999;
19+
width: 100vw;
20+
height: 100vh;
21+
position: fixed;
22+
}
23+
}
24+
25+
.rewind__exit-fullscreen-btn {
26+
position: sticky;
27+
top: 5px;
28+
left: calc(100% - 45px);
629
}

assets/stylesheets/mobile/card.scss

Whitespace-only changes.

assets/stylesheets/mobile/index.scss

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
@import "rewind";
2+
@import "report";
3+
@import "card";

assets/stylesheets/mobile/report.scss

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
.report-page {
2+
width: 100vw;
3+
height: 100vh;
4+
}

assets/stylesheets/mobile/rewind.scss

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
.rewind {
2+
background-color: var(--secondary);
3+
border-radius: var(--d-border-radius);
4+
overflow-y: auto;
5+
overflow-x: hidden;
6+
border: 1px solid var(--primary-very-low);
7+
}

0 commit comments

Comments
 (0)