2022-08-01 16:01:27 +02:00
|
|
|
|
/*
|
|
|
|
|
|
Copyright 2022 The Matrix.org Foundation C.I.C.
|
|
|
|
|
|
|
|
|
|
|
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
|
|
you may not use this file except in compliance with the License.
|
|
|
|
|
|
You may obtain a copy of the License at
|
|
|
|
|
|
|
|
|
|
|
|
http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
|
|
|
|
|
|
|
|
Unless required by applicable law or agreed to in writing, software
|
|
|
|
|
|
distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
|
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
|
|
See the License for the specific language governing permissions and
|
|
|
|
|
|
limitations under the License.
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
import React from "react";
|
|
|
|
|
|
|
|
|
|
|
|
import { _t } from "../../../languageHandler";
|
|
|
|
|
|
import Modal from "../../../Modal";
|
|
|
|
|
|
import SdkConfig from "../../../SdkConfig";
|
|
|
|
|
|
import AccessibleButton from "../../views/elements/AccessibleButton";
|
|
|
|
|
|
import Heading from "../../views/typography/Heading";
|
|
|
|
|
|
import FeedbackDialog from "../dialogs/FeedbackDialog";
|
2022-09-22 15:08:14 +01:00
|
|
|
|
import { shouldShowFeedback } from "../../../utils/Feedback";
|
2022-08-01 16:01:27 +02:00
|
|
|
|
|
2023-01-12 13:25:14 +00:00
|
|
|
|
export function UserOnboardingFeedback(): JSX.Element {
|
2022-09-22 15:08:14 +01:00
|
|
|
|
if (!shouldShowFeedback()) {
|
2022-08-01 16:01:27 +02:00
|
|
|
|
return null;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return (
|
2023-01-02 15:34:34 +01:00
|
|
|
|
<div className="mx_UserOnboardingFeedback" data-testid="user-onboarding-feedback">
|
2022-08-01 16:01:27 +02:00
|
|
|
|
<div className="mx_UserOnboardingFeedback_content">
|
|
|
|
|
|
<Heading size="h4" className="mx_UserOnboardingFeedback_title">
|
2022-08-22 12:11:24 +02:00
|
|
|
|
{_t("How are you finding %(brand)s so far?", {
|
|
|
|
|
|
brand: SdkConfig.get("brand"),
|
|
|
|
|
|
})}
|
2022-08-01 16:01:27 +02:00
|
|
|
|
</Heading>
|
|
|
|
|
|
<div className="mx_UserOnboardingFeedback_text">
|
2022-08-22 12:11:24 +02:00
|
|
|
|
{_t("We’d appreciate any feedback on how you’re finding %(brand)s.", {
|
|
|
|
|
|
brand: SdkConfig.get("brand"),
|
|
|
|
|
|
})}
|
2022-08-01 16:01:27 +02:00
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<AccessibleButton
|
|
|
|
|
|
kind="primary_outline"
|
|
|
|
|
|
className="mx_UserOnboardingFeedback_action"
|
|
|
|
|
|
onClick={() => {
|
|
|
|
|
|
Modal.createDialog(FeedbackDialog, {
|
|
|
|
|
|
feature: "use-case-selection",
|
|
|
|
|
|
});
|
|
|
|
|
|
}}
|
|
|
|
|
|
>
|
|
|
|
|
|
{_t("Feedback")}
|
|
|
|
|
|
</AccessibleButton>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
);
|
|
|
|
|
|
}
|