react-icons/fa APIs
- FaTwitter
- FaGithub
- FaInstagram
- FaLinkedin
- FaTimes
- FaPlus
- FaFacebookF
- FaSearch
- FaYoutube
- FaFacebook
- FaTrash
- FaHeart
- FaLinkedinIn
- FaBars
- FaEnvelope
- FaStar
- FaPlay
- FaHome
- FaEdit
- FaSun
- FaMoon
- FaUser
- FaGithubAlt
- FaFacebookSquare
- FaArrowRight
- FaCheck
- FaTwitterSquare
- FaAngleRight
- FaInfoCircle
- FaMapMarkerAlt
- FaArrowLeft
- FaPen
- FaTrashAlt
- FaShoppingCart
- FaGithubSquare
- FaCheckCircle
- FaDownload
- FaCaretDown
- FaChevronRight
- FaCog
- FaCode
- FaDev
- FaDribbble
- FaLocationArrow
- FaExternalLinkAlt
- FaAngleDown
- FaArrowUp
- FaSignOutAlt
- FaTags
- FaQuoteLeft
- FaPause
- FaChevronLeft
- FaChevronDown
- FaReact
- FaFolderOpen
- FaCircle
- FaAngleLeft
- FaCompass
- FaAlignRight
- FaMinus
- FaBoxOpen
- FaLink
- FaUsers
- FaGoogle
- FaTwitch
- FaRss
- FaSpotify
- FaCrown
- FaLock
- FaCopyright
- FaRegTrashAlt
- FaUserAlt
- FaRegStar
- FaPhone
- FaMapMarkedAlt
- FaRegCircle
- FaVolumeUp
- FaDiscord
- FaUserCircle
- FaList
- FaStackOverflow
- FaFreeCodeCamp
- FaMicrophone
- FaRedo
- FaClipboard
- FaChevronUp
- FaLongArrowAltRight
- FaAngleDoubleRight
- FaKey
- FaCubes
- FaBan
- FaMediumM
- FaPinterest
- FaVideo
- FaDribbbleSquare
- FaComment
- FaBellSlash
- FaRegBuilding
- FaSlack
- FaItunesNote
- FaBox
- FaWonSign
- FaAirbnb
- FaDoorOpen
- FaGlobe
- FaBath
- FaParking
- FaWhatsapp
- FaUserInjured
- FaRegPlusSquare
- FaPlayCircle
- FaPauseCircle
- FaVolumeMute
- FaSpinner
- FaRegLightbulb
- FaCcVisa
- FaCcMastercard
- FaCcPaypal
- FaCcAmazonPay
- FaRegHeart
- FaCartArrowDown
- FaCartPlus
- FaPinterestSquare
- FaPaypal
- FaAmazon
- FaShopify
- FaApple
- FaTruck
- FaUndoAlt
- FaRocketchat
- FaWallet
- FaPinterestP
- FaGooglePlay
- FaCaretUp
- FaFilter
- FaCalendarAlt
- FaCodeBranch
- FaExclamationCircle
- FaEye
- FaOsi
- FaRegEdit
- FaMicrophoneAlt
- FaMicrophoneAltSlash
- FaCogs
- FaEllipsisH
- FaEquals
- FaQrcode
- FaAddressBook
- FaServer
- FaFolder
- FaLongArrowAltLeft
- FaSkype
- FaHandHoldingHeart
- FaRegPaperPlane
- FaRegBookmark
- FaInbox
- FaHamburger
- FaSearchLocation
- FaBirthdayCake
- FaUserGraduate
- FaGoogleDrive
- FaPaperPlane
- FaLockOpen
- FaUserFriends
- FaExchangeAlt
- FaEllipsisV
- FaSortAmountDown
- FaSortAmountUp
- FaCaretSquareRight
- FaCaretSquareLeft
- FaColumns
- FaUndo
- FaQuestionCircle
- FaBloggerB
- FaRedditAlien
- FaCodepen
- FaGitlab
- FaBlogger
- FaCameraRetro
- FaTabletAlt
- FaRegNewspaper
- FaRegCalendarAlt
- FaForward
- FaQuoteRight
- FaVoteYea
- FaShareSquare
- FaBehanceSquare
- FaSignInAlt
- FaSkull
- FaReddit
- FaRegSmileBeam
- FaWindowClose
- FaWindowMinimize
- FaWindowMaximize
- FaPaste
- FaStopwatch
- FaStop
- FaSave
- FaFileExport
- FaHandPointer
- FaFile
- FaMapSigns
- FaClipboardCheck
- FaClock
- FaThList
- FaDumbbell
- FaGuitar
- FaNetworkWired
- FaPuzzlePiece
- FaUserEdit
- FaEyeSlash
- FaPhoneAlt
- FaStickyNote
- FaThumbsUp
- FaThumbsDown
- FaArrowCircleUp
- FaLightbulb
- FaBookOpen
- FaRegSquare
- FaItalic
- FaBold
- FaPencilAlt
- FaSlash
- FaShapes
- FaShip
- FaTree
- FaFilePdf
- FaRegArrowAltCircleRight
- FaFileUpload
- FaKeyboard
- FaBehance
- FaGoodreadsG
- FaProductHunt
- FaXing
- FaBolt
OtherRelated APIs
react-icons/fa#FaQrcode JavaScript Examples
The following examples show how to use
react-icons/fa#FaQrcode.
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: AddContactDialog.js From sailplane-web with GNU General Public License v3.0 | 4 votes |
export default function AddContactDialog({onClose, isVisible, contacts, myID}) {
const dispatch = useDispatch();
const existingIds = contacts ? [myID, ...contacts.map((c) => c.pubKey)] : [];
const [label, setLabel] = useState('');
const [pubKey, setPubKey] = useState('');
const [error, setError] = useState(null);
const [isQRScanModalVisible, setIsQRScanModalVisible] = useState(false);
const inputRef = useRef(null);
useEffect(() => {
if (isVisible) {
inputRef.current.focus();
inputRef.current.select();
} else {
setPubKey('');
setLabel('');
setError(null);
}
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [isVisible]);
const styles = {
title: {
fontSize: 16,
color: primary45,
marginBottom: 8,
},
labelTitle: {
marginTop: 12,
marginBottom: 4,
},
input: {
border: `1px solid ${primary3}`,
borderRadius: 4,
color: primary,
fontSize: 14,
fontWeight: 200,
padding: 4,
display: 'inline-flex',
width: '100%',
boxSizing: 'border-box',
},
confirmBlock: {
marginTop: 14,
display: 'flex',
justifyContent: 'flex-end',
},
cancel: {
marginRight: 8,
},
optional: {
position: 'relative',
top: -8,
left: 4,
fontSize: 13,
},
inputIconContainer: {
},
inputIcon: {
display: 'flex',
alignItems: 'center',
// height: '100%',
position: 'absolute',
right: 8,
cursor: 'pointer',
backgroundColor: '#FFF',
},
inputWrapper: {
display: 'flex',
flexGrow: 2,
position: 'relative',
alignItems: 'center',
},
};
const createContact = () => {
if (!publicKeyValid(pubKey)) {
setError('Invalid user ID');
} else if (existingIds.includes(pubKey)) {
setError('Contact already exists');
} else {
dispatch(addContact(pubKey, label));
onClose();
}
};
return (
<Dialog
backgroundColor={primary15}
isVisible={isVisible}
title={'Add contact'}
body={
<div style={styles.body}>
{error ? <Well isError={true}>{error}</Well> : null}
<div style={styles.title}>User ID:</div>
<div style={styles.inputWrapper}>
<input
ref={inputRef}
type={'text'}
value={pubKey}
onChange={(event) => setPubKey(event.target.value)}
autoCorrect={'off'}
style={styles.input}
placeholder={`(ex: 0356467b31...)`}
className={'textInput'}
onKeyPress={(event) => {
if (event.key === 'Enter') {
createContact();
}
}}
/>
<FaQrcode
onClick={() => setIsQRScanModalVisible(true)}
color={primary45}
size={16}
style={styles.inputIcon}
/>
</div>
<div style={{...styles.title, ...styles.labelTitle}}>
Name
<span style={styles.optional}>(optional)</span>
</div>
<input
type={'text'}
value={label}
onChange={(event) => setLabel(event.target.value)}
autoCorrect={'off'}
style={styles.input}
placeholder={`(ex: John Richardson)`}
className={'textInput'}
onKeyPress={(event) => {
if (event.key === 'Enter') {
createContact();
}
}}
/>
<div style={styles.confirmBlock}>
<BigButton
title={'Cancel'}
inverted={false}
noHover={true}
customWhiteColor={primary15}
style={styles.cancel}
onClick={onClose}
/>
<BigButton
id={'addContactDialogButton'}
title={'Add contact'}
onClick={createContact}
inverted={true}
customWhiteColor={primary15}
/>
</div>
<QRScanDialog
isVisible={isQRScanModalVisible}
onClose={() => setIsQRScanModalVisible(false)}
onScan={(userID)=>{
setPubKey(userID);
setIsQRScanModalVisible(false);
}}
/>
</div>
}
onClose={onClose}
/>
);
}