5htp 0.3.6 → 0.3.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (102) hide show
  1. package/package.json +1 -1
  2. package/skeleton/docker-compose.yml +7 -15
  3. package/skeleton/identity.yaml +12 -8
  4. package/skeleton/package.json +25 -7
  5. package/skeleton/src/client/assets/identity/logo.svg +13 -63
  6. package/skeleton/src/client/assets/identity/logoAndText.svg +9 -104
  7. package/skeleton/src/client/assets/identity/logoAndTextBlack.svg +11 -0
  8. package/skeleton/src/client/assets/illustration/landing/banner.webp +0 -0
  9. package/skeleton/src/client/assets/illustration/landing/candidate/employers.webp +0 -0
  10. package/skeleton/src/client/assets/illustration/landing/candidate/hero.webp +0 -0
  11. package/skeleton/src/client/assets/illustration/landing/candidate/mentors.webp +0 -0
  12. package/skeleton/src/client/assets/illustration/landing/headhunter/hero.webp +0 -0
  13. package/skeleton/src/client/assets/illustration/landing/hero.jpeg +0 -0
  14. package/skeleton/src/client/assets/illustration/landing/hero.webp +0 -0
  15. package/skeleton/src/client/assets/illustration/landing/hero.xcf +0 -0
  16. package/skeleton/src/client/assets/illustration/landing/recruiter/onboarding.webp +0 -0
  17. package/skeleton/src/client/assets/illustration/landing/team/andre.png +0 -0
  18. package/skeleton/src/client/assets/illustration/landing/team/emma.png +0 -0
  19. package/skeleton/src/client/assets/illustration/landing/team/fei.png +0 -0
  20. package/skeleton/src/client/assets/illustration/landing/team/gaetan.png +0 -0
  21. package/skeleton/src/client/assets/illustration/landing/team/jordan.png +0 -0
  22. package/skeleton/src/client/assets/illustration/landing/team/lery.png +0 -0
  23. package/skeleton/src/client/assets/illustration/landing/team/mehdi.png +0 -0
  24. package/skeleton/src/client/assets/illustration/landing/team/omkar.png +0 -0
  25. package/skeleton/src/client/assets/illustration/landing/team/thibaut.png +0 -0
  26. package/skeleton/src/client/assets/img/background/header-blur.png +0 -0
  27. package/skeleton/src/client/assets/img/partners/citron.svg +987 -0
  28. package/skeleton/src/client/assets/patterns/dots.png +0 -0
  29. package/skeleton/src/client/assets/theme.less +179 -226
  30. package/skeleton/src/client/assets/vars.less +54 -0
  31. package/skeleton/src/client/context.ts +23 -0
  32. package/skeleton/src/client/index.ts +59 -0
  33. package/skeleton/src/client/pages/_messages/400.tsx +45 -0
  34. package/skeleton/src/client/pages/_messages/401.tsx +39 -0
  35. package/skeleton/src/client/pages/_messages/403.tsx +43 -0
  36. package/skeleton/src/client/pages/_messages/404.tsx +42 -0
  37. package/skeleton/src/client/pages/_messages/500.tsx +42 -0
  38. package/skeleton/src/client/pages/platform/Header.less +12 -0
  39. package/skeleton/src/client/pages/platform/Header.tsx +119 -0
  40. package/skeleton/src/client/pages/platform/_layout/index.less +118 -0
  41. package/skeleton/src/client/pages/platform/_layout/index.tsx +131 -0
  42. package/skeleton/src/client/pages/platform/_layout/mobile.less +114 -0
  43. package/skeleton/src/client/pages/platform/_page.tsx +54 -0
  44. package/skeleton/src/client/pages/platform/headhunters/index.tsx +88 -0
  45. package/skeleton/src/client/pages/platform/index.tsx +58 -0
  46. package/skeleton/src/client/pages/platform/missions/index.tsx +149 -0
  47. package/skeleton/src/client/services/metrics/index.ts +59 -0
  48. package/skeleton/src/client/tsconfig.json +4 -1
  49. package/skeleton/src/common/config/router.ts +16 -0
  50. package/skeleton/src/common/forms/company/bookCall.ts +25 -0
  51. package/skeleton/src/common/forms/company/importJob.ts +26 -0
  52. package/skeleton/src/common/forms/company/signup.ts +31 -0
  53. package/skeleton/src/common/forms/headhunter/feedback.ts +31 -0
  54. package/skeleton/src/common/forms/headhunter/mission/cancel.ts +26 -0
  55. package/skeleton/src/common/forms/headhunter/mission/candidate/availability.ts +31 -0
  56. package/skeleton/src/common/forms/headhunter/mission/candidate/education.ts +19 -0
  57. package/skeleton/src/common/forms/headhunter/mission/candidate/identity.ts +31 -0
  58. package/skeleton/src/common/forms/headhunter/mission/candidate/others.ts +19 -0
  59. package/skeleton/src/common/forms/headhunter/mission/candidate/skills.ts +21 -0
  60. package/skeleton/src/common/forms/headhunter/mission/reject.ts +23 -0
  61. package/skeleton/src/common/forms/headhunter/mission/search.ts +78 -0
  62. package/skeleton/src/common/forms/headhunter/signup.ts +34 -0
  63. package/skeleton/src/common/libs/headhunter/candidate/index.ts +155 -0
  64. package/skeleton/src/common/libs/headhunter/mission/index.ts +30 -0
  65. package/skeleton/src/common/libs/hub/index.ts +41 -0
  66. package/skeleton/src/server/config/communication.ts +48 -0
  67. package/skeleton/src/server/config/crosspath.ts +9 -0
  68. package/skeleton/src/server/config/data.ts +34 -0
  69. package/skeleton/src/server/config/database.ts +26 -0
  70. package/skeleton/src/server/config/internal.ts +21 -0
  71. package/skeleton/src/server/config/user.ts +90 -0
  72. package/skeleton/src/server/index.ts +111 -23
  73. package/skeleton/src/server/libs/utils/slug.ts +11 -0
  74. package/skeleton/src/server/routes/global.ts +33 -0
  75. package/skeleton/src/server/routes/headhunters.ts +24 -0
  76. package/skeleton/src/server/routes/missions.ts +50 -0
  77. package/skeleton/src/server/services/Headhunter/index.ts +127 -0
  78. package/skeleton/src/server/services/Headhunter/service.json +6 -0
  79. package/skeleton/src/server/services/Mission/index.ts +174 -0
  80. package/skeleton/src/server/services/Mission/service.json +6 -0
  81. package/skeleton/src/server/services/email/sendgrid/index.ts +97 -0
  82. package/skeleton/src/server/services/email/sendgrid/service.json +6 -0
  83. package/skeleton/src/server/services/slack/index.ts +105 -0
  84. package/skeleton/src/server/services/slack/service.json +6 -0
  85. package/skeleton/src/server/services/users/index.ts +133 -0
  86. package/skeleton/src/server/services/users/service.json +6 -0
  87. package/skeleton/src/server/tsconfig.json +6 -8
  88. package/skeleton/var/typings/routes.d.ts +541 -0
  89. package/src/compiler/index.ts +34 -12
  90. package/src/index.ts +1 -1
  91. package/src/utils/keyboard.ts +1 -1
  92. package/skeleton/package-lock.json +0 -6139
  93. package/skeleton/src/client/components/LoginModal.tsx +0 -45
  94. package/skeleton/src/client/pages/app/_layout/index.less +0 -20
  95. package/skeleton/src/client/pages/app/_layout/index.tsx +0 -33
  96. package/skeleton/src/client/pages/app/index.tsx +0 -57
  97. package/skeleton/src/client/pages/landing/_layout/index.less +0 -145
  98. package/skeleton/src/client/pages/landing/_layout/index.tsx +0 -63
  99. package/skeleton/src/client/pages/landing/index.tsx +0 -73
  100. package/skeleton/src/server/models.ts +0 -117
  101. package/skeleton/src/server/routes/general.ts +0 -66
  102. package/skeleton/src/server/services/auth/index.ts +0 -80
@@ -1,278 +1,231 @@
1
1
  /*----------------------------------
2
- - SIZES
2
+ - GLOBAL THEMES
3
3
  ----------------------------------*/
4
4
 
5
- @import (reference) "@client/assets/css/theme.less";
6
-
7
- /*
8
- WARN: ALL MEASURES SHOULD BE IN EM
9
- */
5
+ :root {
10
6
 
11
- // Text
12
- @sTxtPage: calc(16px + 0.10vw);
13
- @sIcon: 1.3em;
7
+ --bgOverlay: fade(@c1 + #666, 70%);
14
8
 
15
- // Components
16
- @radius: 0.75rem;
17
- @layoutRadius: @radius * 2rem;
18
- @sizeComponent: 3.8em;
19
- @sizeActiveIndicator: 6px;
9
+ --cSuccess: @cSuccess;
10
+ --cError: @cError;
11
+ }
20
12
 
21
- // Spacing
22
- @spacing: 1.2em;
23
- @spacing: @spacing;
24
- @spacingLayout: @spacing * 2;
25
13
 
26
- // Responsive
27
- @layoutWidth: 60rem;
28
- @pageWidth: 30rem;
29
- @focusWidth: 40rem;
14
+ body {
30
15
 
31
- @responsive1: 50em;
32
- @responsive2: 46em;
33
- @responsive3: 36em;
34
- @responsive4: 36em;
16
+ ::selection {
17
+ background: @cDark;
18
+ color: #fff;
19
+ }
20
+ }
35
21
 
36
22
  /*----------------------------------
37
- - COLORS
23
+ - BASIC THEMES
38
24
  ----------------------------------*/
39
25
 
40
- @cBgPage: #fff;
26
+ @whiteTheme: {
27
+ background: #FFF;
28
+ foreground: #8E8E8E;
29
+ accent1: @c1;
30
+ accent2: @c2;
31
+ }
32
+
33
+ @greyTheme: {
34
+ background: #F5F5F5;
35
+ foreground: #8E8E8E;
36
+ accent1: @c1;
37
+ accent2: @c2;
38
+ }
39
+
40
+ @silverTheme: {
41
+ background: #eee;
42
+ foreground: #777;
43
+ accent1: @c1;
44
+ accent2: @c2;
45
+ }
41
46
 
42
- @c1: #9125FF;
43
- @c1Light: #FFB169; // #64feda
44
- @c1SuperLight: #FFEBD9;
45
- @c2: #9125FF;
46
- @c3: #f2eee9;
47
- @c4: #f1dfde;
47
+ @darkTheme: {
48
+ background: #050505;
49
+ foreground: #999;
50
+ accent1: #E17DB2;
51
+ accent2: @c2;
52
+ }
48
53
 
49
- @cSuccess: #16f7e8 - #333;
50
- @cError: #f67273;
51
- @cWarn: #FFBA7B;
52
- @cInfo: #4abdff;
54
+ @darkerTheme: {
55
+ background: #181818;
56
+ foreground: #bbb;
57
+ accent1: #fff;
58
+ accent2: @c2;
59
+ }
53
60
 
54
- @cDark: #333;//#2C0653;
61
+ @darkestTheme: {
62
+ background: #242424;
63
+ foreground: #ddd;
64
+ accent1: #fff;
65
+ accent2: @c2;
66
+ }
55
67
 
56
- :root {
68
+ body,
69
+ .bg.grey {
70
+ .apply-theme(@greyTheme, @whiteTheme);
71
+ }
57
72
 
58
- --pageWidth: @pageWidth;
59
- --focusWidth: @focusWidth;
73
+ .card,
74
+ .bg.white {
75
+ .apply-theme(@whiteTheme, @greyTheme);
60
76
 
61
- --cAccent: @c1;
62
- --cAccent2: @c2;
77
+ // TODO: incliude these params in the theme map
78
+ box-shadow: 0 3px 2px fade(#000, 10%);
79
+ border: 1px solid fade(#000, 10%);
80
+ }
63
81
 
64
- --bgOverlay: fade(@c1 + #666, 70%);
82
+ .bg.silver {
83
+ .apply-theme(@silverTheme, @whiteTheme);
65
84
 
66
- --cSuccess: @cSuccess;
67
- --cError: @cError;
68
- }
85
+ box-shadow: inset 0 0 20px fade(#000, 5%)
86
+ }
69
87
 
70
- #githubRibbon {
71
- position: fixed;
72
- top: 0;
73
- right: 0;
74
- width: 149px;
75
- height: 149px;
76
- background: url(https://github.blog/wp-content/uploads/2008/12/forkme_right_darkblue_121621.png?resize=149%2C149);
88
+ .bg.dark {
89
+ .apply-theme(@darkTheme, @darkerTheme);
90
+ }
77
91
 
92
+ .bg.darker {
93
+ .apply-theme(@darkerTheme, @darkestTheme);
78
94
  }
79
95
 
80
96
  /*----------------------------------
81
- - SKINS: PRIMARY COLORS
97
+ - COLOR THEMES
82
98
  ----------------------------------*/
83
99
 
84
- // Light silver
85
- body {
86
- // Background
87
- @cBgPage2: @cBgPage - #090909;
88
- --cBg: @cBgPage;
89
- --cBg2: @cBgPage2;
90
- --cBgControl: #fff;
91
- --cBgHover: #f5f5f5;
92
-
93
- // Other
94
- @cLine: #eee;
95
- @cLine2: @cBgPage - #191919;
96
- --cLine: @cLine;
97
- --cLine2: @cLine2;
98
-
99
- // Text
100
- @cTxtBase: #8E8E8E;
101
- @cTxtDesc: #B1B1B1;
102
- @cTxtDiscret: #D6D6D6;
103
- @cTxtImportant: @cDark;
104
-
105
- --cTxtDiscret: @cTxtDiscret;
106
- --cTxtDesc: @cTxtDesc;
107
- --cTxtBase: @cTxtBase;
108
- --cTxtImportant: @cTxtImportant;
109
-
110
- ::selection {
111
- background: @cDark;
112
- color: #fff;
113
- }
100
+ @primaryTheme: {
101
+ background: #111;
102
+ foreground: #fff;
103
+ accent1: #FFF;
104
+ accent2: #FFF;
105
+ }
114
106
 
107
+ @secondaryTheme: {
108
+ background: #F5F5F5;
109
+ foreground: #8E8E8E;
110
+ accent1: @c1;
111
+ accent2: @c2;
115
112
  }
116
113
 
117
- // White
118
- .white,
119
- .corpsChamp,
120
- .input,
121
- .card,
122
- i.solid {
123
-
124
- // Background
125
- --cBg: #fff;
126
- --cBgControl: #fff;
127
- --cBgHover: #f5f5f5;
128
-
129
- // Other
130
- @cLine: #eee;
131
- @cLine2: #fff - #191919;
132
- --cLine: @cLine;
133
- --cLine2: @cLine2;
134
-
135
- // Text
136
- @cTxtBase: #8E8E8E;
137
- @cTxtDesc: #B1B1B1;
138
- @cTxtDiscret: #D6D6D6;
139
- @cTxtImportant: @cDark;
140
-
141
- --cTxtDiscret: @cTxtDiscret;
142
- --cTxtDesc: @cTxtDesc;
143
- --cTxtBase: @cTxtBase;
144
- --cTxtImportant: @cTxtImportant;
145
-
146
- border-radius: @radius;
114
+ @accentTheme: {
115
+ background: @c1;
116
+ foreground: #fff;
117
+ accent1: #fff;
118
+ accent2: #fff;;
147
119
  }
148
120
 
149
- &.c1,
150
- &.primary {
151
- .build-theme-bg(@c1, @c1 + #aaa);
121
+ .bg.primary {
152
122
 
153
- @cBgHighlight: @c1 + #111;
154
- --cBgHighlight: @cBgHighlight;
123
+ .apply-theme(@primaryTheme);
124
+
125
+ &.btn:hover {
126
+
127
+ }
128
+ }
155
129
 
156
- &.card {
157
- border-bottom: solid 3px @c1 - #222;
158
- box-shadow: 0 2px 50px fade(@c1 + #333, 100%);
130
+ .bg.secondary {
131
+ .apply-theme(@secondaryTheme);
132
+ }
159
133
 
160
- .btn {
161
- border: solid 1px fade(#fff, 20%);
162
- }
163
- }
134
+ .bg.accent {
135
+ .apply-theme(@accentTheme);
164
136
  }
165
137
 
166
- .btn.secondary {
167
- border: solid 2px fade(#000, 10%);
168
- color: @c1 - #222;
169
- &:hover {
170
- border-color: @c1;
171
- background: transparent !important;
172
- }
138
+ .color-theme( @color ) {
139
+ .apply-theme({
140
+ background: @color;
141
+ foreground: #111;
142
+ accent1: #111;
143
+ accent2: #111;
144
+ });
173
145
  }
174
146
 
175
- // Color
176
- .color {
177
-
178
- &.c1,
179
- &.primary {
180
- // Background
181
- @cBgHighlight: @c1 + #333;
182
- --cBg: @c1;
183
- --cBgHighlight: @cBgHighlight;
184
- --cBgControl: #fff;
185
-
186
- // Other
187
- @cLine: fade(#fff, 20%);
188
- @cLine2: fade(#fff, 40%);
189
- --cLine: @cLine;
190
- --cLine2: @cLine2;
191
-
192
- // Text
193
- @cTxtDiscret: @c1 + #666;
194
- @cTxtDesc: @c1 + #888;
195
- @cTxtBase: @c1 + #888;
196
- @cTxtImportant: #fff;
197
-
198
- --cTxtDiscret: @cTxtDiscret;
199
- --cTxtDesc: @cTxtDesc;
200
- --cTxtBase: @cTxtBase;
201
- --cTxtImportant: @cTxtImportant;
202
- }
203
- &.c2 { --color: @c2; }
204
- &.c3 { --color: @c3; }
205
- &.c4 { --color: @c4; }
206
-
207
- &.dark {
208
- // Background
209
- --cBg: @cDark;
210
- --cBgControl: #fff;
211
-
212
- // Other
213
- @cLine: fade(#fff, 20%);
214
- @cLine2: fade(#fff, 40%);
215
- --cLine: @cLine;
216
- --cLine2: @cLine2;
217
-
218
- // Text
219
- @cTxtDiscret: fade(#fff, 30%);
220
- @cTxtDesc: fade(#fff, 50%);
221
- @cTxtBase: fade(#fff, 70%);
222
- @cTxtImportant: #fff;
223
-
224
- --cTxtDiscret: @cTxtDiscret;
225
- --cTxtDesc: @cTxtDesc;
226
- --cTxtBase: @cTxtBase;
227
- --cTxtImportant: @cTxtImportant;
228
- }
147
+ .bg.light1 { .color-theme(#cce0fe ); }
148
+ .bg.light2 { .color-theme(#c7f0ee ); }
149
+ .bg.light3 { .color-theme(#cef5d2 ); }
150
+ .bg.light4 { .color-theme(#feeab6 ); }
151
+ .bg.light5 { .color-theme(#ffdccc ); }
152
+ .bg.light6 { .color-theme(#fcccf0 ); }
153
+ .bg.light7 { .color-theme(#e2d5f7 ); }
154
+
155
+ .bg.success {
156
+ box-shadow: none;
157
+ border: none;
158
+ .apply-theme({
159
+ background: lighten( @cSuccess, 30% );
160
+ foreground: darken( @cSuccess, 50% );
161
+ accent1: #111;
162
+ accent2: #111;
163
+ });
164
+ }
165
+
166
+ .bg.error {
167
+ box-shadow: none;
168
+ border: none;
169
+ .apply-theme({
170
+ background: lighten( @cError, 20% );
171
+ foreground: darken( @cError, 50% );
172
+ accent1: #111;
173
+ accent2: #111;
174
+ });
175
+ }
229
176
 
230
- &.success { --color: @cSuccess; }
231
- &.info { --color: @cInfo; }
232
- &.warn { --color: @cWarn; }
233
- &.error { --color: @cError; }
177
+ .bg.warn {
178
+ box-shadow: none;
179
+ border: none;
180
+ .apply-theme({
181
+ background: lighten( @cWarn, 20% );
182
+ foreground: darken( @cWarn, 50% );
183
+ accent1: #111;
184
+ accent2: #111;
185
+ });
186
+ }
234
187
 
235
-
188
+ .bg.info {
189
+ box-shadow: none;
190
+ border: none;
191
+ .apply-theme({
192
+ background: lighten( @cInfo, 50% );
193
+ foreground: darken( @cInfo, 50% );
194
+ accent1: #111;
195
+ accent2: #111;
196
+ });
236
197
  }
237
198
 
238
199
  /*----------------------------------
239
- - APPLY SKINS TO ELEMENTS
200
+ - GRADIENT & IMG THEMES
240
201
  ----------------------------------*/
241
- i {
242
- &.color {
243
- color: var(--color);
244
- text-shadow: 0 0 20px var(--color);
202
+
203
+ .bg.img {
204
+
205
+ &.blur {
206
+ background: url("./img/background/header-blur.png") center;
207
+ background-size: cover;
208
+ box-shadow: 0 10px 20px fade(#000, 10%);
245
209
  }
246
210
  }
247
211
 
248
- .card {
249
- box-shadow: 0 2px 4px fade(#000, 10%);
212
+ /*----------------------------------
213
+ - FOREGROUND THEMES
214
+ ----------------------------------*/
215
+
216
+ // Color themes
217
+ .primary.fg {
218
+ .build-theme-fg(@c1, #fff);
250
219
  }
251
220
 
252
- .card {
253
- &.color {
254
- background: var(--color);
255
-
256
- &.gray {
257
- @cBgGray: @cBgPage - #060606;
258
- --color: @cBgGray;
259
- background-color: var(--color);
260
- box-shadow: inset 0 0 30px fade(#000, 10%);
261
-
262
- @cTxtBase: @cBgGray - #666;
263
- --cTxtBase: @cTxtBase;
264
- color: var(--cTxtBase);
265
- }
266
-
267
- &.glass {
268
- --color: fade(#000, 85%);
269
- background-color: var(--color);
270
- box-sizing: 0;
271
- backdrop-filter: blur(10px) saturate(180%);
272
-
273
- h2 {
274
- font-weight: 400;
275
- }
276
- }
221
+ .fg {
222
+ &.success { .build-theme-fg( @cSuccess ); }
223
+ &.error { .build-theme-fg( @cError ); }
224
+ &.warn { .build-theme-fg( @cWarn ); }
225
+
226
+ &.gold { .build-theme-fg( #FFD700 - #222 ); }
227
+
228
+ &.gradient {
229
+ color: #B4C77C;
277
230
  }
278
231
  }
@@ -0,0 +1,54 @@
1
+ /*----------------------------------
2
+ - SIZES
3
+ ----------------------------------*/
4
+
5
+ @componentsSelector: ~".card, .btn, .input.text, .input.select, i.solid, .logo";
6
+
7
+ /*
8
+ WARN: ALL MEASURES SHOULD BE IN EM
9
+ */
10
+
11
+ // Text
12
+ @sTxtPage: calc(12px + 0.10vw);
13
+ @sIcon: 1.3em;
14
+
15
+ // Components
16
+ @radius: 0.75rem;
17
+ @sizeComponent: 4em;
18
+ // Spacing
19
+ @spacing: 1.2em;
20
+ @pageWidth: 30rem;
21
+
22
+ @cardPadding: @spacing * 1.5;
23
+ @cardPaddingLong: @spacing * 1.8;
24
+
25
+ @h1Size: 1.7em;
26
+ @h2Size: 1.5em;
27
+ @h3Size: 1.16em;
28
+
29
+ /*----------------------------------
30
+ - COLORS
31
+ ----------------------------------*/
32
+
33
+ /* TO BE REMOVED */@cBgPage: #fff;
34
+
35
+ // Primary colors palette
36
+ @c1: #7A32B3; // Should be darker than c1
37
+ @c2: #61288F;//#3bffb1 // Should be lighter than c2
38
+ @c3: red;
39
+
40
+ @cDark: #333;//#2C0653;
41
+
42
+ // Status colors
43
+ @cSuccess: #16f7e8 - #333;
44
+ @cError: #f67273;
45
+ @cWarn: #FFBA7B;
46
+ @cInfo: @c1;
47
+
48
+ /*----------------------------------
49
+ - LAYOUT
50
+ ----------------------------------*/
51
+
52
+ @layoutWidth: 150em;
53
+ @navigSidebarWidth: 20em;
54
+ @userSidebarWidth: 23em;
@@ -0,0 +1,23 @@
1
+ // TODO: move it into core (but how to make sure usecontext returns CrossPath's context ?)
2
+ import React from 'react';
3
+
4
+ import type CrossPathServer from '@/server/app';
5
+ import type { TRouterContext as TServerRouterRequestContext } from '@server/services/router/response';
6
+ import type { TRouterContext as TClientRouterRequestContext } from '@client/services/router/response';
7
+ import type CrossPathClient from '.';
8
+
9
+ // TO Fix: TClientRouterRequestContext is unable to get the right type of CrossPathClient["router"]
10
+ // (it gets ClientApplication instead of CrossPathClient)
11
+ type ClientRequestContext = TClientRouterRequestContext<CrossPathClient["router"], CrossPathClient>;
12
+ type ServerRequestContext = TServerRouterRequestContext<CrossPathServer["router"]>
13
+ type UniversalServices = ClientRequestContext | ServerRequestContext
14
+
15
+ // Non-universla services are flagged as potentially undefined
16
+ export type ClientContext = (
17
+ UniversalServices
18
+ &
19
+ Partial<Omit<ClientRequestContext, keyof UniversalServices>>
20
+ )
21
+
22
+ export const ReactClientContext = React.createContext<ClientContext>({} as ClientContext);
23
+ export default (): ClientContext => React.useContext<ClientContext>(ReactClientContext);
@@ -0,0 +1,59 @@
1
+ /*----------------------------------
2
+ - DEPENDANCES
3
+ ----------------------------------*/
4
+
5
+ // Core
6
+ import ClientApplication from '@client/app';
7
+ import type { CoreError } from '@common/errors';
8
+
9
+ // Core Services
10
+ import Router from '@client/services/router';
11
+
12
+ // App Services
13
+ import MetricsService from '@/client/services/metrics';
14
+
15
+ // Config
16
+ import { domains } from '@/common/config/router';
17
+
18
+ /*----------------------------------
19
+ - TYPES
20
+ ----------------------------------*/
21
+
22
+
23
+ /*----------------------------------
24
+ - APPLICATION
25
+ ----------------------------------*/
26
+ export class CrossPathCSM extends ClientApplication {
27
+
28
+ public Router = new Router(this, {
29
+ preload: [],
30
+
31
+ domains: __DEV__ ? {
32
+ ...domains.local,
33
+ current: domains.local.recruiters,
34
+ } : {
35
+ ...domains.prod,
36
+ current: domains.prod.recruiters,
37
+ },
38
+
39
+ context: (context, router) => ({
40
+ user: context.user || router.ssrContext.user
41
+ })
42
+ })
43
+
44
+ public metrics = new MetricsService(this);
45
+
46
+ public boot(): void {
47
+ // Tracking
48
+ this.Router.on('page.changed', () => {
49
+ this.metrics.event('pageview');
50
+ });
51
+ }
52
+
53
+ public handleError( error: CoreError | Error, httpCode?: number ) {
54
+ this.toast.error( error.message, undefined, null, { autohide: false });
55
+ // TODO: modal with conffeti
56
+ }
57
+ }
58
+
59
+ export default CrossPathCSM
@@ -0,0 +1,45 @@
1
+ /*----------------------------------
2
+ - DEPENDANCES
3
+ ----------------------------------*/
4
+
5
+ // Npm
6
+ import React from 'react';
7
+
8
+ // Core
9
+ import { Router } from '@app';
10
+ import { Button } from '@client/components';
11
+
12
+ // App
13
+ import useHeader from '@client/pages/useHeader';
14
+
15
+ /*----------------------------------
16
+ - CONTROLEUR
17
+ ----------------------------------*/
18
+ Router.error( 400, {}, ({ data }) => {
19
+
20
+ useHeader({
21
+ title: 'Bad request',
22
+ subtitle: data.message
23
+ });
24
+
25
+ return (
26
+ <div class="card w-3-4 col pd-2">
27
+
28
+ <div class="col al-center">
29
+
30
+ <i src="times-circle" class="fg error xxl" />
31
+
32
+ <h1>Bad Request</h1>
33
+
34
+ <p>{data.message}</p>
35
+
36
+ Do you think this is not normal?
37
+
38
+ </div>
39
+
40
+ <Button type="primary" link="https://crosspathworkspace.slack.com/archives/C04L2TGR5J6">
41
+ Report to the dev team
42
+ </Button>
43
+ </div>
44
+ )
45
+ });
@@ -0,0 +1,39 @@
1
+ /*----------------------------------
2
+ - DEPENDANCES
3
+ ----------------------------------*/
4
+
5
+ // Npm
6
+ import React from 'react';
7
+
8
+ // Core
9
+ import { Router } from '@app';
10
+ import { Button } from '@client/components';
11
+
12
+ // App
13
+ import useHeader from '@client/pages/useHeader';
14
+
15
+ /*----------------------------------
16
+ - RESSOURCES
17
+ ----------------------------------*/
18
+
19
+ /*----------------------------------
20
+ - CONTROLEUR
21
+ ----------------------------------*/
22
+ Router.error( 401, {}, ({ message, request, page }) => {
23
+
24
+ useHeader({
25
+ title: 'Authentication Required',
26
+ subtitle: message
27
+ });
28
+
29
+ return (
30
+ <div class="card w-3-4 col al-center pd-2">
31
+
32
+ <i src="times-circle" class="fg error xxl" />
33
+
34
+ <h1>Authentication Required</h1>
35
+
36
+ <p>{message}</p>
37
+ </div>
38
+ )
39
+ });