react-icons/io#IoIosCloseCircle JavaScript Examples

The following examples show how to use react-icons/io#IoIosCloseCircle. 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: GroupInfoCard.js    From react-portal with MIT License 4 votes vote down vote up
GroupInfoCard = ({
	data,
	cardConfig,
	setRefreshGroups,
	refreshGroups,
	onClick,
	memberDetails
}) => {
	const [userData] = useState(getRole());
	const deleteGroup = async (e, id) => {
		e.stopPropagation();
		try {
			const res = await deleteGroupService(id);
			if (!res.error && res.message === "success") {
				setRefreshGroups(!refreshGroups);
				_notification("success", "Success", "Successfully Deleted!");
			}
		} catch (err) {
			_notification("error", "Error", err.message);
		}
	};

	return (
		<>
			<Card hoverable onClick={onClick}>
				<div
					style={{
						backgroundColor: cardConfig && cardConfig.primary,
						margin: "-16px -16px 16px -16px",
						padding: "16px",
						fontSize: "28px",
						fontWeight: "400",
						color: "white",
						display: "flex",
						justifyContent: "space-between",
						alignItems: "center"
					}}
				>
					{data.name}
					{userData.role === "lead" && (
						<Popconfirm
							onClick={e => e.stopPropagation()}
							okText="Yes"
							cancelText="No"
							title="Are you sure to delete this group?"
							onConfirm={e => {
								deleteGroup(e, data._id);
							}}
							onCancel={e => e.stopPropagation()}
						>
							<IoIosCloseCircle />
						</Popconfirm>
					)}
				</div>
				<div
					style={{
						overflow: "auto",
						backgroundColor: cardConfig && cardConfig.secondary,
						margin: "-16px",
						padding: "16px"
					}}
				>
					<Row
						style={{
							overflow: "auto",
							paddingBottom: "12px",
							alignItems: "center",
							justifyContent: "space-between"
						}}
					>
						<Avatar.Group
							maxCount={4}
							maxStyle={{
								color: cardConfig.primary,
								backgroundColor: cardConfig.tertiary
							}}
						>
							{memberDetails.heads.map((head, id) => (
								<Tooltip
									title={head.name}
									placement="top"
									key={id}
								>
									<Avatar src={head.image} />
								</Tooltip>
							))}
						</Avatar.Group>
						<FaCrown
							style={{
								fontSize: "18px",
								color: cardConfig.primary
							}}
						/>
					</Row>

					<Row style={{ overflow: "auto" }}>
						<Avatar.Group
							maxCount={4}
							maxStyle={{
								color: cardConfig.primary,
								backgroundColor: cardConfig.tertiary
							}}
						>
							{memberDetails.members.map((mem, id) => (
								<Tooltip
									title={mem.name}
									placement="top"
									key={id}
								>
									<Avatar src={mem.image} />
								</Tooltip>
							))}
						</Avatar.Group>
					</Row>
				</div>
			</Card>
		</>
	);
}