import React, { useState, useEffect } from "reactn"; import { Image, Pressable, Text, View } from "react-native"; import { FlatGrid } from "react-native-super-grid"; import { responsiveWidth } from "../actions/responsiveSizes.js"; import { Fonts, Palette, Style, gutters } from "../styles"; import { mainBorderRadius } from "../styles/Style"; import useLayoutType from "../hooks/useLayoutType.js"; const IconSelector = ({ onClose } = {}) => { const { isNative } = useLayoutType(); const [currentIconIndex, setCurrentIconIndex] = useState(0); useEffect(() => { if (isNative) { // import("expo-dynamic-app-icon").then((module) => { // getAppIcon = module.getAppIcon; // const iconIndex = getAppIcon(); // setCurrentIconIndex(Number(iconIndex)); // }); } }, []); return ( Nouvelle icône Modifiez l'icône de votre app, pour une expérience plus personnelle. } itemDimension={responsiveWidth(45)} data={[ require(`../../assets/alternateIcons/1.png`), require(`../../assets/alternateIcons/2.png`), require(`../../assets/alternateIcons/3.png`), require(`../../assets/alternateIcons/4.png`), ]} style={{ flex: 1, backgroundColor: Palette.darkPurple }} spacing={10} renderItem={({ item, index }) => { const isSelected = currentIconIndex === index + 1; return ( { // import("expo-dynamic-app-icon").then((module) => { // setAppIcon = module.setAppIcon; // setAppIcon((index + 1).toString()); // setCurrentIconIndex(index + 1); // onClose?.(); // }); }} > ); }} /> ); }; export default IconSelector;