@@ -2,13 +2,16 @@ import { createRoot } from 'react-dom/client';
22import { Route , Switch } from 'wouter' ;
33import type { ClientConfig } from '../shared/api-entities' ;
44import { ConfigProvider } from '../hooks/data/useConfig' ;
5- import {
6- moodline ,
7- Preview ,
8- type PreviewContent ,
9- } from '../components/guidance/Preview' ;
5+ import { Preview , type PreviewContent } from '../components/guidance/Preview' ;
106import { RetroPreviewPage } from '../components/retro-formats/RetroPreviewPage' ;
117import { Footer } from '../components/Footer' ;
8+ import {
9+ HEALTH_PREVIEW ,
10+ MOOD_PREVIEW ,
11+ SAMPLE_RETRO ,
12+ SAMPLE_RETRO_PHONE ,
13+ TIMELINE_PREVIEW ,
14+ } from './samples' ;
1215
1316import '../index.css' ;
1417import '../preload.css' ;
@@ -18,40 +21,9 @@ import './Gallery.css';
1821// This code is not part of the build - run it with
1922// MODE=GALLERY npm start
2023
21- const now = Date . parse ( '2026-01-27T17:08:12Z' ) ;
22-
23- const SAMPLE_RETRO : PreviewContent = {
24- format : 'mood' ,
25- simulatedTime : now ,
26- state : { focusedItemId : 'cur' , focusedItemTimeout : now + 282000 } ,
27- items : [
28- { category : 'happy' , message : 'We can run retros remotely 😃' } ,
29- { category : 'meh' , message : 'other retro formats' , votes : 2 } ,
30- { category : 'happy' , message : 'Everything is awesome!' , votes : 7 } ,
31- { category : 'sad' , message : 'It rained' } ,
32- {
33- id : 'cur' ,
34- category : 'sad' ,
35- message : 'That thing happened' ,
36- attachment : {
37- type : 'giphy' ,
38- url : 'https://media3.giphy.com/media/Y4z9olnoVl5QI/200.gif' ,
39- alt : '' ,
40- } ,
41- } ,
42- { category : 'happy' , message : 'That TV show' } ,
43- { category : 'action' , message : 'do a thing' , doneTime : 1 } ,
44- ] ,
45- } ;
46-
47- const SAMPLE_RETRO_PHONE : PreviewContent = {
48- ...SAMPLE_RETRO ,
49- localState : { 'new-item-happy:value' : 'I can add stuff from my phone' } ,
50- } ;
51-
5224const GalleryPage = ( ) => (
5325 < div className = "page-gallery" >
54- < div className = "gallery-item" >
26+ < div className = "light gallery-item" >
5527 < div className = "docs" >
5628 < Preview
5729 content = { SAMPLE_RETRO }
@@ -69,52 +41,52 @@ const GalleryPage = () => (
6941 </ div >
7042 </ div >
7143 </ div >
72- < div className = "gallery-item" >
73- < Preview
74- content = { {
75- format : 'mood' ,
76- name : '3 Column' ,
77- simulatedTime : now ,
78- items : [
79- { category : 'happy' , message : 'We can run retros remotely 😃' } ,
80- { category : 'meh' , message : 'other retro formats' , votes : 2 } ,
81- { category : 'happy' , message : 'Everything is awesome!' , votes : 7 } ,
82- { category : 'sad' , message : 'It rained' } ,
83- { category : 'sad' , message : 'That thing happened' } ,
84- { category : 'happy' , message : 'That TV show' } ,
85- { category : 'action' , message : 'do a thing' , doneTime : 1 } ,
86- ] ,
87- } }
88- width = { 900 }
89- height = { 600 }
90- className = "thumb"
91- />
92- </ div >
93- < div className = "gallery-item" >
94- < Preview
95- content = { {
96- format : 'health' ,
97- name : 'Health Check' ,
98- simulatedTime : now ,
99- items : [ ] ,
100- localState : {
101- 'health:own-state' : { stage : 'answer' , user : 'me' } ,
102- 'health-progress:me' : 'learning' ,
103- } ,
104- } }
105- width = { 900 }
106- height = { 600 }
107- className = "thumb"
108- />
109- </ div >
110- < div className = "gallery-item" >
111- < Preview
112- content = { TIMELINE_PREVIEW }
113- width = { 900 }
114- height = { 600 }
115- className = "thumb"
116- />
117- </ div >
44+ < DesktopThumb theme = "light" content = { MOOD_PREVIEW } / >
45+ < DesktopThumb theme = "dark" content = { MOOD_PREVIEW } />
46+ < DesktopThumb theme = "light" content = { HEALTH_PREVIEW } />
47+ < DesktopThumb theme = "dark" content = { HEALTH_PREVIEW } />
48+ < DesktopThumb theme = "light" content = { TIMELINE_PREVIEW } />
49+ < DesktopThumb theme = "dark" content = { TIMELINE_PREVIEW } />
50+ < PhoneThumb theme = "light" content = { MOOD_PREVIEW } />
51+ < PhoneThumb theme = "dark" content = { MOOD_PREVIEW } />
52+ < PhoneThumb theme = "light" content = { HEALTH_PREVIEW } />
53+ < PhoneThumb theme = "dark" content = { HEALTH_PREVIEW } />
54+ < PhoneThumb theme = "light" content = { TIMELINE_PREVIEW } />
55+ < PhoneThumb theme = "dark" content = { TIMELINE_PREVIEW } />
56+ </ div >
57+ ) ;
58+
59+ const DesktopThumb = ( {
60+ theme ,
61+ content ,
62+ } : {
63+ theme : string ;
64+ content : PreviewContent ;
65+ } ) => (
66+ < div className = { `gallery-item ${ theme } ` } >
67+ < Preview
68+ content = { content }
69+ width = { 960 }
70+ height = { 640 }
71+ className = "desktop-thumb"
72+ />
73+ </ div >
74+ ) ;
75+
76+ const PhoneThumb = ( {
77+ theme ,
78+ content ,
79+ } : {
80+ theme : string ;
81+ content : PreviewContent ;
82+ } ) => (
83+ < div className = { `gallery-item ${ theme } ` } >
84+ < Preview
85+ content = { content }
86+ width = { 375 }
87+ height = { 667 }
88+ className = "phone-thumb"
89+ / >
11890 </ div >
11991) ;
12092
@@ -126,99 +98,6 @@ const MOCK_CONFIG: ClientConfig = {
12698 giphy : true ,
12799} ;
128100
129- const DAY = 1000 * 60 * 60 * 24 ;
130- const day = ( n : number ) => ( Math . floor ( now / DAY ) + n ) * DAY ;
131-
132- const TIMELINE_PREVIEW : PreviewContent = {
133- format : 'timeline' ,
134- name : 'Timeline' ,
135- simulatedTime : now ,
136- localState : {
137- 'timeline:tab' : 'draw' ,
138- 'timeline:id' : '00000000-0000-0000-0000-000000000000' ,
139- } ,
140- state : { endTime : day ( 56 ) } ,
141- items : [
142- { category : 'event' , message : 'Kickoff session' , doneTime : day ( 0 ) } ,
143- { category : 'event' , message : 'Release' , doneTime : day ( 18 ) } ,
144- { category : 'event' , message : 'Angry customer' , doneTime : day ( 34 ) } ,
145- { category : 'event' , message : 'Got an office llama' , doneTime : day ( 40 ) } ,
146- { category : 'event' , message : 'Newspaper article' , doneTime : day ( 54 ) } ,
147- moodline (
148- { id : 'l0' , colour : { h : 160 } } ,
149- day ( 0 ) ,
150- 30 ,
151- 22 ,
152- 21 ,
153- 22 ,
154- 28 ,
155- 25 ,
156- 5 ,
157- 0 ,
158- - 1 ,
159- - 2 ,
160- - 2 ,
161- 5 ,
162- 80 ,
163- 50 ,
164- 35 ,
165- 26 ,
166- 20 ,
167- 14 ,
168- 8 ,
169- 6 ,
170- ) ,
171- moodline (
172- { id : 'l1' , colour : { h : 350 } } ,
173- day ( 0 ) ,
174- 60 ,
175- 20 ,
176- 10 ,
177- 5 ,
178- 4 ,
179- 6 ,
180- 8 ,
181- 20 ,
182- 5 ,
183- 20 ,
184- 5 ,
185- 10 ,
186- 50 ,
187- 90 ,
188- 70 ,
189- 50 ,
190- 40 ,
191- 35 ,
192- 15 ,
193- 5 ,
194- ) ,
195- moodline (
196- { id : 'l2' , colour : { h : 240 } } ,
197- day ( 0 ) ,
198- 40 ,
199- 41 ,
200- 42 ,
201- 42 ,
202- 40 ,
203- 40 ,
204- 39 ,
205- 38 ,
206- 38 ,
207- 39 ,
208- 40 ,
209- 44 ,
210- 45 ,
211- 5 ,
212- 10 ,
213- 40 ,
214- 51 ,
215- 52 ,
216- 46 ,
217- 41 ,
218- ) ,
219- ] ,
220- } ;
221-
222101const root = document . createElement ( 'div' ) ;
223102document . getElementById ( 'pre-load' ) ?. remove ( ) ;
224103document . body . append ( root ) ;
0 commit comments