react-icons/fa APIs
- FaTwitter
- FaGithub
- FaSearch
- FaDiscord
- FaEye
- FaInstagram
- FaPlus
- FaFacebookF
- FaTrash
- FaGlobe
- FaUsers
- FaEdit
- FaListUl
- FaWhatsapp
- FaApple
- FaTimes
- FaMoon
- FaSun
- FaYoutube
- FaInfoCircle
- FaSave
- FaEyeSlash
- FaCheck
- FaRegCheckCircle
- FaExternalLinkAlt
- FaChevronUp
- FaChevronDown
- FaUser
- FaThumbsUp
- FaGoogle
- FaChevronLeft
- FaTrashAlt
- FaCheckCircle
- FaExclamationCircle
- FaCode
- FaFilter
- FaLinkedinIn
- FaHome
- FaAngleRight
- FaAngleLeft
- FaCopy
- FaArrowRight
- FaThumbsDown
- FaTimesCircle
- FaMapMarkedAlt
- FaNetworkWired
- FaFacebook
- FaMedal
- FaQuestionCircle
- FaAppStoreIos
- FaRegNewspaper
- FaLinkedin
- FaAward
- FaSpinner
- FaBell
- FaLink
- FaCog
- FaCaretDown
- FaCaretLeft
- FaCaretRight
- FaRegQuestionCircle
- FaSignInAlt
- FaRegCircle
- FaPlayCircle
- FaBook
- FaMinus
- FaRegClock
- FaRegTimesCircle
- FaUserClock
- FaClipboardCheck
- FaTelegram
- FaToolbox
- FaCalendarAlt
- FaChevronCircleDown
- FaChevronCircleUp
- FaChevronCircleRight
- FaCogs
- FaDownload
- FaSitemap
- FaTrophy
- FaGripVertical
- FaFlagCheckered
- FaMapMarkerAlt
- FaChrome
- FaRegStickyNote
- FaRegSun
- FaTags
- FaGetPocket
- FaRegEdit
- FaRobot
- FaDev
- FaQuora
- FaGraduationCap
- FaClipboard
- FaVine
- FaMicroscope
- FaReact
- FaVuejs
- FaPalette
- FaPen
- FaSmile
- FaPaperPlane
- FaImage
- FaUserPlus
- FaAnchor
- FaCaretUp
- FaRss
- FaRegLightbulb
- FaStar
- FaSignOutAlt
- FaUserMinus
- FaEnvelopeOpenText
- FaPencilAlt
- FaExclamation
- FaUnlock
- FaLock
- FaSlack
- FaUserCircle
- FaEnvelope
- FaKey
- FaRegStar
- FaWrench
- FaMarkdown
- FaArrowCircleLeft
- FaArrowCircleRight
- FaScroll
- FaUserFriends
- FaBolt
- FaExpand
- FaLocationArrow
- FaStopCircle
- FaHandHolding
- FaPhotoVideo
- FaShareAlt
- FaVoicemail
- FaGithubAlt
- FaLifeRing
- FaSyncAlt
- FaSoundcloud
- FaSpotify
- FaHistory
- FaBloggerB
- FaDrawPolygon
- FaHandPaper
- FaHandPointer
- FaPhone
- FaList
- FaMailBulk
- FaHourglass
- FaMediumM
- FaPlay
- FaGift
- FaChevronRight
- FaLongArrowAltRight
- FaMedium
- FaWindowClose
- FaEllipsisH
- FaVolumeUp
- FaVolumeMute
- FaKeyboard
- FaHammer
- FaFileImport
- FaListOl
- FaSquare
- FaFillDrip
- FaUserLock
- FaRegPlusSquare
- FaRegFile
- FaSlash
- FaCloudUploadAlt
- FaBackspace
- FaAngleDoubleRight
- FaAngleDoubleLeft
- FaGlasses
- FaPause
- FaCheckSquare
- FaComment
- FaPrint
- FaShareSquare
- FaChartBar
- FaMagic
- FaBicycle
- FaCat
- FaDirections
- FaGlobeAfrica
- FaMountain
- FaUpload
- FaLightbulb
- FaDocker
- FaTwitterSquare
- FaGlobeAmericas
- FaLinux
- FaFile
- FaDesktop
- FaFacebookMessenger
- FaWpforms
- FaBomb
- FaBars
- FaTabletAlt
- FaMemory
- FaCalendarDay
- Fa500Px
- FaAdobe
- FaAdversal
- FaAirbnb
- FaAlipay
- FaAmazon
- FaAmazonPay
- FaBehanceSquare
- FaInstagramSquare
- FaLaugh
- FaMagento
- FaOpera
- FaYinYang
Other Related APIs
react-icons/fa#FaLongArrowAltRight TypeScript Examples
The following examples show how to use
react-icons/fa#FaLongArrowAltRight.
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: index.tsx From pokedex with MIT License | 4 votes |
Evolution: React.FC<{ name: string; color: string }> = ({
name,
color,
}) => {
const [pokemonsFamily, setPokemonsFamily] = useState<PokemonEvolvesProps[]>(
[],
);
const [evolvesPokemon, setEvolvesPokemon] = useState<PokemonEvolvesProps[]>(
[],
);
// Criando uma função recursiva para navegar na árvore de evolução do pokémon
// A cada chamada é extraído o nome da espécie e concatenado com a lista dos nomes.
const handleNameSpecies = useCallback(
({
species,
evolves_to,
evolution_details,
}: EvolvesProps): PokemonEvolvesProps[] => {
let namesPokemons: PokemonEvolvesProps[] = [
{
name: species.name,
level: 0,
},
];
if (evolution_details.length)
namesPokemons[0].level = evolution_details[0].min_level;
// A propriedade evolves_to retornada pela api é um vetor, desta maneira, pode-se que um
// pokémon tenha duas caminhos/folhas na evolução.
// if (evolution_details.length) console.log(evolution_details[0].min_level);
evolves_to.forEach((evolves: EvolvesProps) => {
namesPokemons = namesPokemons.concat(handleNameSpecies(evolves));
});
return namesPokemons;
},
[],
);
useEffect(() => {
// Na rota /pokemon-species é retornado os atributos da espécie do Pokémon
api.get(`/pokemon-species/${name}`).then(responseSpecies => {
// E na propriedade evolution_chain é dado a url para a cadeia evolutiva do Pokémon
// É extraído uma parte da url pelo motivo que o axios já possui o caminho raiz da api
const url = responseSpecies.data.evolution_chain.url.split('v2')[1];
api.get(url).then(responseEvolution => {
const species = handleNameSpecies(responseEvolution.data.chain);
setPokemonsFamily(species);
});
});
}, [name, handleNameSpecies]);
useEffect(() => {
if (pokemonsFamily.length) {
const urlsAxios = pokemonsFamily.map(p => api.get(`/pokemon/${p.name}`));
Promise.all([...urlsAxios]).then(responses => {
const result = responses.map((response, index) => {
const { id, sprites } = response.data;
return {
...pokemonsFamily[index],
number: `#${'000'.substr(id.toString().length)}${id}`,
image: sprites.other['official-artwork'].front_default,
};
});
setEvolvesPokemon(result);
});
}
}, [pokemonsFamily]);
return (
<SectionEvolution>
{evolvesPokemon.length ? (
evolvesPokemon.slice(0, 6).map((evolves, index) => (
<React.Fragment key={evolves.level}>
{index !== 0 && (
<EvolutionPokemon>
<FaLongArrowAltRight size={80} color="rgba(0, 0, 0, 0.06)" />
<p>(Level {evolves.level || 'null'})</p>
</EvolutionPokemon>
)}
<EvolutionPokemon>
<EvolutionPokemonImage to={`/pokemon/${evolves.name}`}>
<Pokeball />
<img
src={evolves.image}
alt={`Imagem do pokémon ${evolves.name}`}
/>
</EvolutionPokemonImage>
<p>{evolves.number}</p>
<h4>{evolves.name}</h4>
</EvolutionPokemon>
</React.Fragment>
))
) : (
<h1 style={{ textAlign: 'center' }}>Carregando...</h1>
)}
</SectionEvolution>
);
}