react-icons/fi#FiShoppingBag JavaScript Examples

The following examples show how to use react-icons/fi#FiShoppingBag. 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: Header.js    From plataforma-sabia with MIT License 5 votes vote down vote up
Header = () => {
	const { technology } = useTechnology();
	const { openModal } = useModal();
	const { user } = useAuth();
	const router = useRouter();

	const handleClick = ({ target: { name } }) => {
		if (!user.email) {
			router.push(`${internalPages.signIn}?redirect=${router.asPath}`);
			return;
		}

		if (!user.operations.can_buy_technology) {
			openModal('pendingUserData', {
				message: 'Complete o seu cadastro para adquirir esta tecnologia.',
			});
			return;
		}

		openModal(name, { technology });
	};

	const ownerUser = getTechnologyOwner(technology);

	return (
		<HeaderContainer>
			<ImagesCarousel />
			<DescriptionContainer>
				<UpContent>
					<DescriptionTitle>{technology.title}</DescriptionTitle>
					<UpContentButtonsContainer>
						<Share />
						<Likes id={technology.id} count={technology.likes} type="technology" />
					</UpContentButtonsContainer>
				</UpContent>
				<DescriptionContentWrapper>
					<DescriptionText>
						<p>Descrição</p>
						{technology.description}
						{!!ownerUser?.institution && (
							<p>
								{ownerUser.institution.initials} - {ownerUser.institution.name}
							</p>
						)}
					</DescriptionText>
					<ActionsContainer>
						{!!technology.technologyCosts?.is_seller && (
							<TechnologyPrice>
								<h5>{formatMoney(technology.technologyCosts?.price)}</h5>
								<p>A unidade</p>
							</TechnologyPrice>
						)}
						<ActionButtonsContainer>
							{!!technology.technologyCosts?.is_seller && (
								<Button
									variant="success"
									name="buyTechnology"
									onClick={handleClick}
								>
									<FiShoppingBag fontSize="1.6rem" />
									Adquirir essa tecnologia
								</Button>
							)}
						</ActionButtonsContainer>
					</ActionsContainer>
				</DescriptionContentWrapper>
			</DescriptionContainer>
		</HeaderContainer>
	);
}