Skip to main content

PSThreadSettingPermission

Ví dụ

import {StackScreenProps} from '@react-navigation/stack';
import React from 'react';
import {useAppResourceContext} from '../contexts';
import {PiScaleNavStackParamList} from 'src/navigation';
import {PSSafeAreaView} from './PSSafeAreaView';
import {PSSettingPermissionInThreadScreen} from '@communi/chat-react-native';

type PSSettingPermissionScreenProps = StackScreenProps<
PiScaleNavStackParamList,
'PSSettingPermissionScreen'
>;

export const PSSettingPermissionScreen = ({
route,
navigation,
}: PSSettingPermissionScreenProps) => {
const {colors} = useAppResourceContext();

const onBackPress = () => {
navigation.goBack();
};

return (
<PSSafeAreaView
topBackgroundColor={colors.Base.b0}
containerBackgroundColor={colors.Base.b0}>
<PSSettingPermissionInThreadScreen
userRole={userRole}
threadId={threadId}
onBackPress={onBackPress}
/>
</PSSafeAreaView>
);
};


Các thành phần


export enum PSRoleThreadType {
OWNER = 1,
ADMIN = 2,
MEMBER = 3,
}

interface PSSettingPermissionProps {
userRole: PSRoleThreadType;
threadId: string;
onBackPress: () => void;
}
TênMô tảBắt buộc
threadIdTham số truyền vào threadId hiện tại
userRoleTham số truyền vào xác định hiển thị Member settings hay Admin settings
onBackPressCallback truyền vào để quay trở lại