mirror of
https://github.com/discourse/discourse-rewind.git
synced 2025-07-07 22:32:11 +00:00
base design
This commit is contained in:
parent
66ec74bf2b
commit
baf19cbe9f
@ -0,0 +1,13 @@
|
|||||||
|
import Component from "@glimmer/component";
|
||||||
|
|
||||||
|
export default class Reactions extends Component {
|
||||||
|
<template>
|
||||||
|
<div class="rewind-report-page">
|
||||||
|
Let's take a look at the reactions you've used this year!
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="rewind-report-page">
|
||||||
|
page 2
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
}
|
@ -2,12 +2,18 @@ import Component from "@glimmer/component";
|
|||||||
import { tracked } from "@glimmer/tracking";
|
import { tracked } from "@glimmer/tracking";
|
||||||
import { action } from "@ember/object";
|
import { action } from "@ember/object";
|
||||||
import didInsert from "@ember/render-modifiers/modifiers/did-insert";
|
import didInsert from "@ember/render-modifiers/modifiers/did-insert";
|
||||||
|
import { eq } from "truth-helpers";
|
||||||
|
import DButton from "discourse/components/d-button";
|
||||||
|
import concatClass from "discourse/helpers/concat-class";
|
||||||
import { ajax } from "discourse/lib/ajax";
|
import { ajax } from "discourse/lib/ajax";
|
||||||
import { popupAjaxError } from "discourse/lib/ajax-error";
|
import { popupAjaxError } from "discourse/lib/ajax-error";
|
||||||
|
import Reactions from "discourse/plugins/discourse-rewind/discourse/components/reports/reactions";
|
||||||
|
|
||||||
export default class Rewind extends Component {
|
export default class Rewind extends Component {
|
||||||
@tracked rewind = [];
|
@tracked rewind = [];
|
||||||
|
|
||||||
|
@tracked fullScreen = true;
|
||||||
|
|
||||||
@action
|
@action
|
||||||
async loadRewind() {
|
async loadRewind() {
|
||||||
try {
|
try {
|
||||||
@ -17,10 +23,34 @@ export default class Rewind extends Component {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@action
|
||||||
|
toggleFullScreen() {
|
||||||
|
this.fullScreen = !this.fullScreen;
|
||||||
|
}
|
||||||
|
|
||||||
|
reportComponentForIdentifier(identifier) {
|
||||||
|
if (identifier === "reactions") {
|
||||||
|
return Reactions;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div class="rewind" {{didInsert this.loadRewind}}>
|
<div
|
||||||
|
class={{concatClass "rewind" (if this.fullScreen "-fullscreen")}}
|
||||||
|
{{didInsert this.loadRewind}}
|
||||||
|
>
|
||||||
|
<DButton
|
||||||
|
class="rewind__exit-fullscreen-btn"
|
||||||
|
@icon={{if this.fullScreen "discourse-compress" "discourse-expand"}}
|
||||||
|
title="Toggle fullscreen"
|
||||||
|
@action={{this.toggleFullScreen}}
|
||||||
|
/>
|
||||||
{{#each this.rewind as |report|}}
|
{{#each this.rewind as |report|}}
|
||||||
<p>{{report.identifier}}</p>
|
{{#if (eq report.identifier "reactions")}}
|
||||||
|
<div class="rewind-report">
|
||||||
|
<Reactions @report={{report}} />
|
||||||
|
</div>
|
||||||
|
{{/if}}
|
||||||
{{/each}}
|
{{/each}}
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
2
assets/stylesheets/common/card.scss
Normal file
2
assets/stylesheets/common/card.scss
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
.rewind-card {
|
||||||
|
}
|
@ -1 +1,3 @@
|
|||||||
@import "rewind";
|
@import "rewind";
|
||||||
|
@import "report";
|
||||||
|
@import "card";
|
||||||
|
14
assets/stylesheets/common/report.scss
Normal file
14
assets/stylesheets/common/report.scss
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
.rewind-report {
|
||||||
|
}
|
||||||
|
|
||||||
|
.rewind-report-page {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
padding: 1em;
|
||||||
|
box-sizing: border-box;
|
||||||
|
font-weight: 700;
|
||||||
|
font-size: var(--font-up-2);
|
||||||
|
height: 100cqh;
|
||||||
|
width: 100cqw;
|
||||||
|
}
|
@ -1,6 +1,29 @@
|
|||||||
.rewind {
|
.rewind {
|
||||||
width: 280px;
|
width: 280px;
|
||||||
height: 400px;
|
height: 400px;
|
||||||
background-color: var(--secondary-high);
|
background-color: var(--secondary);
|
||||||
border-radius: var(--d-border-radius);
|
border-radius: var(--d-border-radius);
|
||||||
|
overflow-y: auto;
|
||||||
|
overflow-x: hidden;
|
||||||
|
border: 1px solid var(--primary-very-low);
|
||||||
|
box-sizing: border-box;
|
||||||
|
position: relative;
|
||||||
|
container-type: size;
|
||||||
|
|
||||||
|
&.-fullscreen {
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
bottom: 0;
|
||||||
|
z-index: 9999;
|
||||||
|
width: 100vw;
|
||||||
|
height: 100vh;
|
||||||
|
position: fixed;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.rewind__exit-fullscreen-btn {
|
||||||
|
position: sticky;
|
||||||
|
top: 5px;
|
||||||
|
left: calc(100% - 45px);
|
||||||
}
|
}
|
||||||
|
0
assets/stylesheets/mobile/card.scss
Normal file
0
assets/stylesheets/mobile/card.scss
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
@import "rewind";
|
||||||
|
@import "report";
|
||||||
|
@import "card";
|
4
assets/stylesheets/mobile/report.scss
Normal file
4
assets/stylesheets/mobile/report.scss
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
.report-page {
|
||||||
|
width: 100vw;
|
||||||
|
height: 100vh;
|
||||||
|
}
|
7
assets/stylesheets/mobile/rewind.scss
Normal file
7
assets/stylesheets/mobile/rewind.scss
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
.rewind {
|
||||||
|
background-color: var(--secondary);
|
||||||
|
border-radius: var(--d-border-radius);
|
||||||
|
overflow-y: auto;
|
||||||
|
overflow-x: hidden;
|
||||||
|
border: 1px solid var(--primary-very-low);
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user