Skip to content

Commit beb5c82

Browse files
committed
Remove zendesk and add monday feedback
1 parent 6c9794f commit beb5c82

File tree

5 files changed

+102
-51
lines changed

5 files changed

+102
-51
lines changed

app/Base/index.tsx

Lines changed: 60 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,24 @@
1-
import React, { useState, useMemo, useCallback } from 'react';
1+
import React, {
2+
useState,
3+
useMemo,
4+
useCallback,
5+
} from 'react';
26
import localforage from 'localforage';
7+
import { IoRemove } from 'react-icons/io5';
38
import { Router } from 'react-router-dom';
4-
import { init, ErrorBoundary, setUser as setUserOnSentry, withProfiler } from '@sentry/react';
59
import { unique, _cs } from '@togglecorp/fujs';
10+
import {
11+
init,
12+
ErrorBoundary,
13+
setUser as setUserOnSentry,
14+
withProfiler,
15+
} from '@sentry/react';
616
import {
717
AlertContainer,
818
AlertContext,
919
AlertOptions,
1020
Button,
21+
useModalState,
1122
} from '@the-deep/deep-ui';
1223
import { ApolloProvider } from '@apollo/client';
1324
import { setMapboxToken } from '@togglecorp/re-map';
@@ -20,17 +31,10 @@ import 'mapbox-gl/dist/mapbox-gl.css';
2031
import Init from '#base/components/Init';
2132
import browserHistory from '#base/configs/history';
2233
import sentryConfig from '#base/configs/sentry';
23-
import { UserContext, UserContextInterface } from '#base/context/UserContext';
24-
import {
25-
openZendeskFeedback,
26-
setUserOnZendesk,
27-
} from '#base/utils/zendesk';
2834
import { NavbarContext, NavbarContextInterface } from '#base/context/NavbarContext';
2935
import AuthPopup from '#base/components/AuthPopup';
30-
import { sync } from '#base/hooks/useAuthSync';
3136
import Navbar from '#base/components/Navbar';
3237
import Routes from '#base/components/Routes';
33-
import { User } from '#base/types/user';
3438
import {
3539
processDeepUrls,
3640
processDeepOptions,
@@ -44,7 +48,9 @@ import { apolloClient } from '#base/configs/apollo';
4448
import localforageInstance from '#base/configs/localforage';
4549
import { mapboxToken } from '#base/configs/env';
4650
import { trackingId, gaConfig } from '#base/configs/googleAnalytics';
47-
51+
import { UserContext, UserContextInterface } from '#base/context/UserContext';
52+
import { sync } from '#base/hooks/useAuthSync';
53+
import { User } from '#base/types/user';
4854
import FullPageErrorMessage from '#views/FullPageErrorMessage';
4955

5056
import styles from './styles.css';
@@ -74,14 +80,20 @@ if (trackingId) {
7480
function Base() {
7581
const [user, setUser] = useState<User | undefined>();
7682

83+
const [
84+
showMondayForm,
85+
setMondayFormVisible,
86+
setMondayFormHidden,
87+
] = useModalState(false);
88+
7789
const [navbarState, setNavbarState] = useState<{
7890
path: string;
7991
visibility: boolean;
8092
}[]>([]);
8193

8294
const authenticated = !!user;
8395

84-
const setUserWithSentryAndZendesk: typeof setUser = useCallback(
96+
const setUserWithSentry: typeof setUser = useCallback(
8597
(u) => {
8698
if (typeof u === 'function') {
8799
setUser((oldUser) => {
@@ -90,15 +102,13 @@ function Base() {
90102
const sanitizedUser = newUser;
91103
sync(!!sanitizedUser, sanitizedUser?.id);
92104
setUserOnSentry(sanitizedUser ?? null);
93-
setUserOnZendesk(sanitizedUser ?? null);
94105

95106
return newUser;
96107
});
97108
} else {
98109
const sanitizedUser = u;
99110
sync(!!sanitizedUser, sanitizedUser?.id);
100111
setUserOnSentry(sanitizedUser ?? null);
101-
setUserOnZendesk(sanitizedUser ?? null);
102112
setUser(u);
103113
}
104114
},
@@ -109,12 +119,12 @@ function Base() {
109119
() => ({
110120
authenticated,
111121
user,
112-
setUser: setUserWithSentryAndZendesk,
122+
setUser: setUserWithSentry,
113123
}),
114124
[
115125
authenticated,
116126
user,
117-
setUserWithSentryAndZendesk,
127+
setUserWithSentry,
118128
],
119129
);
120130

@@ -219,6 +229,14 @@ function Base() {
219229

220230
const navbarShown = currentNavbarState?.visibility;
221231

232+
const openMondayForm = () => {
233+
setMondayFormVisible();
234+
};
235+
236+
const closeMondayForm = () => {
237+
setMondayFormHidden();
238+
};
239+
222240
return (
223241
<div className={styles.base}>
224242
<ErrorBoundary
@@ -261,14 +279,38 @@ function Base() {
261279
</RequestContext.Provider>
262280
</ErrorBoundary>
263281
<Button
282+
className={styles.mondayHelpButton}
264283
name={undefined}
265-
title="Bug/Feedback?"
284+
title="Bug / Feedback?"
266285
variant="action"
267-
className={styles.zendeskHelpButton}
268-
onClick={openZendeskFeedback}
286+
onClick={openMondayForm}
287+
type="button"
269288
>
270289
Bug / Feedback?
271290
</Button>
291+
292+
{showMondayForm && (
293+
<div className={styles.formOverlay}>
294+
<div className={styles.formContent}>
295+
<div className={styles.formTopBar}>
296+
<p>Leave us a message</p>
297+
<Button
298+
name={undefined}
299+
icons={<IoRemove />}
300+
iconsContainerClassName={styles.iframeClose}
301+
onClick={closeMondayForm}
302+
type="button"
303+
variant="transparent"
304+
/>
305+
</div>
306+
<iframe
307+
className={styles.iframe}
308+
src="https://forms.monday.com/forms/embed/6438474a471702280d54bd27e87f5855?r=apse2"
309+
title="Monday Form"
310+
/>
311+
</div>
312+
</div>
313+
)}
272314
</div>
273315
);
274316
}

app/Base/styles.css

Lines changed: 42 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
width: 24rem;
4040
}
4141

42-
.zendesk-help-button {
42+
.monday-help-button {
4343
position: fixed;
4444
bottom: var(--dui-spacing-extra-large);
4545
left: 0;
@@ -54,6 +54,47 @@
5454
font-size: var(--dui-font-size-extra-small);
5555
font-weight: var(--dui-font-weight-regular);
5656
}
57+
58+
.form-overlay {
59+
display: flex;
60+
position: fixed;
61+
bottom: var(--dui-spacing-large);
62+
left: var(--dui-spacing-large);
63+
}
64+
65+
.form-content {
66+
position: relative;
67+
z-index: 1000;
68+
border: var(--dui-width-separator-thin) solid var(--dui-color-separator);
69+
border-radius: var(--dui-border-radius-card);
70+
background-color: var(--dui-color-white);
71+
}
72+
73+
.form-top-bar {
74+
display: flex;
75+
align-items: center;
76+
justify-content: space-between;
77+
gap: var(--dui-spacing-extra-large);
78+
border-top-left-radius: var(--dui-border-radius-card);
79+
border-top-right-radius: var(--dui-border-radius-card);
80+
background-color: var(--dui-color-accent);
81+
padding: var(--dui-spacing-extra-small) var(--dui-spacing-medium);
82+
width: 100%;
83+
color: var(--dui-color-white);
84+
}
85+
86+
.iframe-close {
87+
display: flex;
88+
justify-content: flex-end;
89+
color: var(--dui-color-white);
90+
}
91+
92+
.iframe {
93+
flex-grow: 1;
94+
border: none;
95+
width: 330px;
96+
height: 490px;
97+
}
5798
}
5899

59100
h1, h2, h3, h4, h5, h6 {

app/Base/utils/zendesk.d.ts

Lines changed: 0 additions & 5 deletions
This file was deleted.

app/Base/utils/zendesk.js

Lines changed: 0 additions & 17 deletions
This file was deleted.

app/index.html

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -63,16 +63,6 @@
6363
}
6464
</script>
6565
<!-- End of anti-click-jacking -->
66-
<!-- Start of deephelp Zendesk Widget script -->
67-
<script id="ze-snippet" src="https://static.zdassets.com/ekr/snippet.js?key=c203955c-2d20-4d54-814b-4247caf4340f">
68-
</script>
69-
<script type="text/javascript">
70-
window.zESettings = {};
71-
zE(function() {
72-
zE.hide();
73-
});
74-
</script>
75-
<!-- End of deephelp Zendesk Widget script -->
7666
<!-- Start of Google tag (gtag.js) -->
7767
<% if (process.env.REACT_APP_GA_MEASUREMENT_ID) { %>
7868
<script async src="https://www.googletagmanager.com/gtag/js?id=<%=process.env.REACT_APP_GA_MEASUREMENT_ID%>"></script>

0 commit comments

Comments
 (0)