35 lines
1.6 KiB
TypeScript
35 lines
1.6 KiB
TypeScript
// Metro module 15430 (f15431).
|
|
import { ONBOARDING_HOME_RESOURCES_SHEET_KEY } from "./OnboardingHomeConstants";
|
|
import { useToken } from "../../../design/tokens/native/useToken";
|
|
import Module712 from "../../../_bundle/Module712";
|
|
import useResourceChannels from "../useResourceChannels";
|
|
import { selectHomeResourceChannel } from "../GuildOnboardingHomeActionCreators";
|
|
import ActionSheetActionCreators from "../../action_sheet/native/ActionSheetActionCreators";
|
|
import { ActionSheet } from "../../../design/components/Sheet/native/ActionSheet.native";
|
|
import { ActionSheetRow } from "../../../design/components/Sheet/native/ActionSheetRow.native";
|
|
import AvatarUtils from "../../../utils/AvatarUtils";
|
|
import FastImage from "../../../components_native/common/FastImage";
|
|
export default function OnboardingHomeResourcesSheet(props) {
|
|
const guildId = props.guildId;
|
|
const token = useToken(Module712.modules.mobile.TABLE_ROW_ICON_SIZE);
|
|
return <ActionSheet>
|
|
<ActionSheetRow.Group hasIcons>
|
|
{useResourceChannels(guildId).map((item) => {
|
|
let uri = AvatarUtils.getResourceChannelIconURL(item);
|
|
if (uri == null) {
|
|
uri = void 0;
|
|
}
|
|
return <ActionSheetRow key={item.channelId} label={item.title} icon={uri != null ? <FastImage style={{
|
|
width: token,
|
|
height: token
|
|
}} source={{
|
|
uri
|
|
}} /> : void 0} onPress={() => {
|
|
selectHomeResourceChannel(guildId, item.channelId);
|
|
ActionSheetActionCreators.hideActionSheet(ONBOARDING_HOME_RESOURCES_SHEET_KEY);
|
|
}} arrow />;
|
|
})}
|
|
</ActionSheetRow.Group>
|
|
</ActionSheet>;
|
|
};
|