delint and tidy code
This commit is contained in:
parent
1ba601ba22
commit
05a9023bac
2 changed files with 20 additions and 19 deletions
|
@ -34,17 +34,14 @@ interface IProps extends IDialogProps {
|
||||||
const BetaFeedbackDialog: React.FC<IProps> = ({ featureId, onFinished }) => {
|
const BetaFeedbackDialog: React.FC<IProps> = ({ featureId, onFinished }) => {
|
||||||
const info = SettingsStore.getBetaInfo(featureId);
|
const info = SettingsStore.getBetaInfo(featureId);
|
||||||
|
|
||||||
const extraData = SettingsStore.getBetaInfo(featureId)?.extraSettings.reduce((o, k) => {
|
|
||||||
o[k] = SettingsStore.getValue(k);
|
|
||||||
return o;
|
|
||||||
}, {});
|
|
||||||
|
|
||||||
return <GenericFeatureFeedbackDialog
|
return <GenericFeatureFeedbackDialog
|
||||||
title={_t("%(featureName)s beta feedback", { featureName: info.title })}
|
title={_t("%(featureName)s beta feedback", { featureName: info.title })}
|
||||||
subheading={_t(info.feedbackSubheading)}
|
subheading={_t(info.feedbackSubheading)}
|
||||||
onFinished={onFinished}
|
onFinished={onFinished}
|
||||||
rageshakeLabel={info.feedbackLabel}
|
rageshakeLabel={info.feedbackLabel}
|
||||||
rageshakeData={extraData}
|
rageshakeData={Object.fromEntries((SettingsStore.getBetaInfo(featureId)?.extraSettings || []).map(k => {
|
||||||
|
return SettingsStore.getValue(k);
|
||||||
|
}))}
|
||||||
>
|
>
|
||||||
<AccessibleButton kind="link" onClick={() => {
|
<AccessibleButton kind="link" onClick={() => {
|
||||||
onFinished(false);
|
onFinished(false);
|
||||||
|
|
|
@ -73,19 +73,23 @@ const SpaceFeedbackPrompt = ({ onClick }: { onClick?: () => void }) => {
|
||||||
<hr />
|
<hr />
|
||||||
<div>
|
<div>
|
||||||
<span className="mx_SpaceFeedbackPrompt_text">{ _t("Spaces are a new feature.") }</span>
|
<span className="mx_SpaceFeedbackPrompt_text">{ _t("Spaces are a new feature.") }</span>
|
||||||
<AccessibleButton kind="link" onClick={() => {
|
<AccessibleButton
|
||||||
if (onClick) onClick();
|
kind="link"
|
||||||
Modal.createTrackedDialog("Spaces Feedback", "", GenericFeatureFeedbackDialog, {
|
onClick={() => {
|
||||||
title: _t("Spaces feedback"),
|
if (onClick) onClick();
|
||||||
subheading: _t("Thank you for trying Spaces. Your feedback will help inform the next versions."),
|
Modal.createTrackedDialog("Spaces Feedback", "", GenericFeatureFeedbackDialog, {
|
||||||
rageshakeLabel: "spaces-feedback",
|
title: _t("Spaces feedback"),
|
||||||
rageshakeData: {
|
subheading: _t("Thank you for trying Spaces. " +
|
||||||
"feature_spaces.all_rooms": SettingsStore.getValue("feature_spaces.all_rooms"),
|
"Your feedback will help inform the next versions."),
|
||||||
"feature_spaces.space_member_dms": SettingsStore.getValue("feature_spaces.space_member_dms"),
|
rageshakeLabel: "spaces-feedback",
|
||||||
"feature_spaces.space_dm_badges": SettingsStore.getValue("feature_spaces.space_dm_badges"),
|
rageshakeData: Object.fromEntries([
|
||||||
},
|
"feature_spaces.all_rooms",
|
||||||
});
|
"feature_spaces.space_member_dms",
|
||||||
}}>
|
"feature_spaces.space_dm_badges",
|
||||||
|
].map(k => [k, SettingsStore.getValue(k)])),
|
||||||
|
});
|
||||||
|
}}
|
||||||
|
>
|
||||||
{ _t("Give feedback.") }
|
{ _t("Give feedback.") }
|
||||||
</AccessibleButton>
|
</AccessibleButton>
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in a new issue