react-icons/fi#FiXCircle JavaScript Examples
The following examples show how to use
react-icons/fi#FiXCircle.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: components.js From idena-web with MIT License | 6 votes |
function FailedThumbnail() {
return (
<Fill
bg={rgba(89, 89, 89, 0.95)}
borderRadius={['16px', '12px']}
css={{
display: 'flex',
justifyContent: 'center',
alignItems: 'center',
}}
>
<FiXCircle size={rem(20)} color={theme.colors.white} />
</Fill>
)
}
Example #2
Source File: PackAppsList.js From winstall with GNU General Public License v3.0 | 4 votes |
function PackAppsList({ notLoggedIn = false, providedApps, reorderEnabled, onListUpdate, allApps}){
const [apps, setApps] = useState([]);
const [, updateState] = useState();
const forceUpdate = useCallback(() => updateState({}), []);
const [showAdd, setShowAdd] = useState(false);
useEffect(() => {
setApps(providedApps)
}, [])
if(!reorderEnabled){
return (
<ul className={`${styles.appsList} ${styles.noDragList}`}>
{apps.map((app) => (
<div className={styles.appCard} key={app._id}>
<SingleApp app={app} pack={true} displaySelect={true}/>
</div>
))}
</ul>
);
}
const onDragEnd = (result) => {
if (!result.destination) {
return;
}
if (result.destination.index === result.source.index) {
return;
}
const updatedApps = reorder(
apps,
result.source.index,
result.destination.index
);
onListUpdate(updatedApps)
setApps(updatedApps);
}
const manageUpdates = (id) => {
const updatedApps = apps.filter(i => i._id !== id);
setApps(updatedApps);
onListUpdate(updatedApps);
}
const handleSelect = (app, isSelected) => {
let existingApps = apps;
if (isSelected) {
existingApps.push(app);
} else {
existingApps = existingApps.filter(a => a._id !== app._id);
}
setApps(existingApps);
onListUpdate(existingApps);
forceUpdate();
}
const closeModal = () => {
setShowAdd(false);
}
return (
<>
<h2>Apps in this pack</h2>
{!notLoggedIn && <p>Tip! Drag and drop any app to re-order how they appear in your pack.</p>}
<button className={`button center ${apps.length === 0 ? '' : 'subtle'}`} onClick={() => setShowAdd(!showAdd)}><FiPlusCircle/> {`Add ${apps.length != 0 ? "More" : ""} Apps`}</button><br/>
<Modal
isOpen={showAdd}
onRequestClose={closeModal}
className={styles.addModal}
overlayClassName={styles.modalOverlay}
contentLabel="Example Modal"
>
<div className={styles.modalHeader}>
<h2>Add Apps</h2>
<FiXCircle onClick={closeModal}/>
</div>
<Search apps={allApps} preventGlobalSelect={handleSelect} isPackView={true} alreadySelected={apps} limit={4}/>
</Modal>
{notLoggedIn ? <p>You need to login first before you can view the apps in this pack.</p> : (
<DragDropContext onDragEnd={onDragEnd}>
<Droppable droppableId="list">
{(provided) => (
<ul
ref={provided.innerRef}
{...provided.droppableProps}
className={styles.appsList}
>
<AppsList apps={apps} onListUpdate={manageUpdates} />
{provided.placeholder}
</ul>
)}
</Droppable>
</DragDropContext>
) }
</>
);
}