61 lines
2.8 KiB
TypeScript
61 lines
2.8 KiB
TypeScript
// Metro module 16036 (f16037).
|
|
import PresenceStore from "../../../stores/PresenceStore";
|
|
import { AnalyticEvents } from "../../../Constants";
|
|
import { createStyles } from "../../../design/components/Styles/native/createStyles";
|
|
import Module712 from "../../../_bundle/Module712";
|
|
import useMountEffect from "../../../hooks/useMountEffect";
|
|
import { getStreamerApplication } from "../../../modules/go_live/utils/StreamerApplicationSelectors";
|
|
import AnalyticsUtils from "../../../utils/AnalyticsUtils";
|
|
import trackStreamProblem from "../../../modules/go_live/utils/trackStreamProblem";
|
|
import ActionSheetActionCreators from "../../../modules/action_sheet/native/ActionSheetActionCreators";
|
|
import { presentFeedbackSent } from "../../../modules/toast/native/ToastUtils";
|
|
import getStreamIssueReportOptions from "../../../modules/go_live/utils/getStreamIssueReportOptions";
|
|
import { ActionSheetRow } from "../../../design/components/Sheet/native/ActionSheetRow.native";
|
|
import { ActionSheet } from "../../../design/components/Sheet/native/ActionSheet.native";
|
|
import { BottomSheetTitleHeader } from "../../../design/components/Sheet/native/BottomSheetTitleHeader.native";
|
|
import { intl, t } from "../../../intl/index.native";
|
|
import { BottomSheetScrollView } from "../../../_bundle/Module5245";
|
|
const useStyles = createStyles({
|
|
container: {
|
|
padding: 16,
|
|
backgroundColor: Module712.colors.BACKGROUND_SURFACE_HIGH
|
|
}
|
|
});
|
|
export default function ReportProblem(props) {
|
|
const { stream, analyticsData } = props;
|
|
const styles = useStyles();
|
|
useMountEffect(() => {
|
|
const streamerApplication = getStreamerApplication(stream, PresenceStore);
|
|
AnalyticsUtils.track(AnalyticEvents.OPEN_POPOUT, {
|
|
type: "Stream Issue Sheet",
|
|
other_user_id: stream.ownerId,
|
|
application_id: streamerApplication != null ? streamerApplication.id : null,
|
|
application_name: streamerApplication != null ? streamerApplication.name : null,
|
|
game_id: streamerApplication != null ? streamerApplication.id : null
|
|
});
|
|
});
|
|
const r8 = getStreamIssueReportOptions({
|
|
isStreamer: false,
|
|
isEndStream: false
|
|
}).map((item, index) => {
|
|
const value = item.value;
|
|
return <ActionSheetRow key={index} label={item.label} arrow onPress={() => {
|
|
trackStreamProblem({
|
|
problem: value,
|
|
stream,
|
|
feedback: "",
|
|
streamApplication: getStreamerApplication(stream, PresenceStore),
|
|
analyticsData,
|
|
location: "Stream"
|
|
});
|
|
ActionSheetActionCreators.hideActionSheet();
|
|
presentFeedbackSent();
|
|
}} />;
|
|
});
|
|
return <ActionSheet scrollable header={<BottomSheetTitleHeader title={intl.string(t.XuqqwI)} />}>
|
|
<BottomSheetScrollView style={styles.container}>
|
|
<ActionSheetRow.Group hasIcons={false}>{r8}</ActionSheetRow.Group>
|
|
</BottomSheetScrollView>
|
|
</ActionSheet>;
|
|
};
|