Skip to content

Commit 7067254

Browse files
authored
Merge pull request #12052 from ArianHamdi/fix/feedback-widget/s1
fix: feedback widget by modifying left property
2 parents 556cf7d + ff1e34f commit 7067254

File tree

1 file changed

+72
-65
lines changed

1 file changed

+72
-65
lines changed

src/components/FeedbackWidget.tsx

Lines changed: 72 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,9 @@ const FixedDot = ({
4545
boxShadow="tableItemBox"
4646
position="sticky"
4747
bottom={{ base: `${bottomOffset + 1}rem`, lg: 4 }}
48-
ms="auto"
48+
me="1rem"
4949
mt={{ lg: "inherit" }}
50+
insetStart={`calc(100% - ${size})`}
5051
insetEnd={4}
5152
zIndex={98} /* Below the mobile menu */
5253
display="flex"
@@ -137,7 +138,7 @@ const FeedbackWidget = () => {
137138
setIsExpanded(false)
138139
}
139140

140-
// Dispay on English pages only
141+
// Display on English pages only
141142
if (locale !== DEFAULT_LOCALE) return null
142143

143144
return (
@@ -184,79 +185,85 @@ const FeedbackWidget = () => {
184185
<AlertDialogOverlay>
185186
<AlertDialogContent
186187
position="fixed"
187-
insetEnd={{ base: 4, sm: 8 }}
188-
insetStart={{ base: 4, sm: "auto" }}
189-
bottom={{ base: `${bottomOffset + 5}rem`, lg: 20 }}
190-
w={{ base: "auto", sm: "300px" }}
191-
bgColor="ednBackground"
192-
border="1px"
193-
borderColor="buttonColor"
188+
maxW={1504}
189+
m="auto"
190+
alignItems="flex-end"
191+
backgroundColor="transparent"
194192
boxShadow="tableItemBox"
195-
borderRadius="base"
196-
py="4"
197-
px="2"
193+
me={24}
194+
bottom={{ base: `${bottomOffset + 5}rem`, lg: 20 }}
198195
>
199-
<AlertDialogCloseButton />
200-
201-
<AlertDialogHeader
202-
fontSize="xl"
203-
fontWeight="bold"
204-
lineHeight="6"
205-
textAlign="center"
196+
<Box
197+
w={{ base: "auto", sm: "300px" }}
198+
bgColor="ednBackground"
199+
border="1px"
200+
borderColor="buttonColor"
201+
borderRadius="base"
202+
py="4"
203+
px="2"
206204
>
207-
{feedbackSubmitted
208-
? t("feedback-widget-thank-you-title")
209-
: t("feedback-widget-prompt")}
210-
</AlertDialogHeader>
205+
<AlertDialogCloseButton />
211206

212-
{/* Body: */}
213-
{feedbackSubmitted && (
214-
<>
215-
<AlertDialogBody
216-
fontWeight="normal"
217-
fontSize="md"
218-
lineHeight="5"
219-
textAlign="center"
220-
>
221-
{t("feedback-widget-thank-you-subtitle")}
222-
</AlertDialogBody>
223-
<AlertDialogBody
224-
fontWeight="bold"
225-
fontSize="xs"
226-
lineHeight="4"
227-
letterSpacing="wide"
228-
color="searchBorder"
229-
textAlign="center"
230-
>
231-
{t("feedback-widget-thank-you-timing")}
232-
</AlertDialogBody>
233-
</>
234-
)}
207+
<AlertDialogHeader
208+
fontSize="xl"
209+
fontWeight="bold"
210+
lineHeight="6"
211+
textAlign="center"
212+
>
213+
{feedbackSubmitted
214+
? t("feedback-widget-thank-you-title")
215+
: t("feedback-widget-prompt")}
216+
</AlertDialogHeader>
235217

236-
<AlertDialogFooter display="flex" gap="6">
237-
{feedbackSubmitted ? (
238-
<Button onClick={handleSurveyOpen} flex={1}>
239-
{t("feedback-widget-thank-you-cta")}
240-
</Button>
241-
) : (
218+
{/* Body: */}
219+
{feedbackSubmitted && (
242220
<>
243-
<Button
244-
variant="solid"
245-
onClick={() => handleSubmit(true)}
246-
flex={1}
221+
<AlertDialogBody
222+
fontWeight="normal"
223+
fontSize="md"
224+
lineHeight="5"
225+
textAlign="center"
247226
>
248-
{t("yes")}
249-
</Button>
250-
<Button
251-
variant="solid"
252-
onClick={() => handleSubmit(false)}
253-
flex={1}
227+
{t("feedback-widget-thank-you-subtitle")}
228+
</AlertDialogBody>
229+
<AlertDialogBody
230+
fontWeight="bold"
231+
fontSize="xs"
232+
lineHeight="4"
233+
letterSpacing="wide"
234+
color="searchBorder"
235+
textAlign="center"
254236
>
255-
{t("no")}
256-
</Button>
237+
{t("feedback-widget-thank-you-timing")}
238+
</AlertDialogBody>
257239
</>
258240
)}
259-
</AlertDialogFooter>
241+
242+
<AlertDialogFooter display="flex" gap="6">
243+
{feedbackSubmitted ? (
244+
<Button onClick={handleSurveyOpen} flex={1}>
245+
{t("feedback-widget-thank-you-cta")}
246+
</Button>
247+
) : (
248+
<>
249+
<Button
250+
variant="solid"
251+
onClick={() => handleSubmit(true)}
252+
flex={1}
253+
>
254+
{t("yes")}
255+
</Button>
256+
<Button
257+
variant="solid"
258+
onClick={() => handleSubmit(false)}
259+
flex={1}
260+
>
261+
{t("no")}
262+
</Button>
263+
</>
264+
)}
265+
</AlertDialogFooter>
266+
</Box>
260267
</AlertDialogContent>
261268
</AlertDialogOverlay>
262269
</AlertDialog>

0 commit comments

Comments
 (0)