@material-ui/icons APIs
- ExpandMore
- Delete
- Close
- Visibility
- VisibilityOff
- Check
- Add
- Edit
- Search
- ExpandLess
- Settings
- Person
- Info
- Clear
- ExitToApp
- ArrowDropDown
- Home
- GitHub
- Warning
- ArrowBack
- SearchOutlined
- Done
- LocationOn
- PlayArrow
- Apps
- Brightness4
- Brightness7
- Description
- KeyboardArrowDown
- KeyboardArrowLeft
- KeyboardArrowRight
- MoreVert
- LocationCity
- Map
- Image
- AccountCircle
- InfoOutlined
- Create
- Block
- Replay
- AddCircle
- HomeRounded
- GetApp
- ChevronLeft
- ChevronRight
- CloudDownload
- CheckCircleOutline
- Send
- LockOpen
- Cancel
- NavigateNext
- AccountBox
- DragIndicator
- FavoriteBorderOutlined
- AccessTime
- DoneAll
- CheckCircle
- CropFree
- LockOutlined
- Undo
- Dashboard
- People
- PhotoLibrary
- HomeOutlined
- Group
- ArrowDropUp
- Remove
- ArrowUpward
- Save
- ArrowForward
- AttachFile
- Headset
- SignalCellularAlt
- ArrowForwardIos
- PlayCircleFilled
- AccessAlarm
- Adjust
- BarChart
- CloseRounded
- PlayArrowOutlined
- ImageRounded
- MenuBookRounded
- RefreshRounded
- HourglassEmptyOutlined
- Announcement
- Ballot
- QuestionAnswerOutlined
- CloudUpload
- SkipNext
- ArrowRightAlt
- MoreHoriz
- FileCopy
- MenuBook
- Language
- AlternateEmail
- FolderOpen
- Lock
- Pets
- AddCircleRounded
- ExploreRounded
- WbSunnyRounded
- Brightness2Rounded
- DonutLargeRounded
- AssistantRounded
- AccountCircleRounded
- ExitToAppRounded
- VpnKey
- MailOutline
- Smartphone
- DeleteForever
- LanguageOutlined
- Colorize
- SignalCellularConnectedNoInternet2Bar
- SignalCellularConnectedNoInternet0Bar
- SignalCellular4Bar
- DeleteOutline
- NewReleases
- LocalOffer
- Assessment
- Place
- TrendingDown
- ShoppingCart
- Stop
- RotateLeft
- Menu
- Flag
- Forum
- GroupSharp
- InsertEmoticon
- NotificationsActive
- PhoneIphone
- AllInbox
- Comment
- Photo
- PlaylistAddCheck
- CloudUploadRounded
- ExpandMoreOutlined
- History
- PersonOutlineOutlined
- ArrowForwardIosRounded
- ArrowBackIosRounded
- AssignmentOutlined
- VerticalAlignCenterOutlined
- CalendarTodayOutlined
- Error
- PlaylistPlay
- MusicNoteTwoTone
- Portrait
- ExploreOutlined
- DeleteRounded
- EditRounded
- SaveRounded
- CreateNewFolder
- MeetingRoom
- MenuOpenRounded
- MenuRounded
- DateRange
- CallEnd
- Assignment
- KeyboardBackspace
- BluetoothSearching
- CameraAlt
- PlaylistAdd
- Favorite
- Bluetooth
- OpenInBrowser
- Loop
- FileCopyOutlined
- NavigateBefore
- MergeType
- Dvr
- PersonOutline
- PlayCircleFilledWhiteOutlined
- StoreMallDirectoryOutlined
- SupervisedUserCircleOutlined
- MonetizationOn
- OpenInNew
- ArrowDownward
- AddBox
- FilterList
- FirstPage
- LastPage
- ViewColumn
- Notifications
- DriveEta
- LocalTaxi
- Redo
- AccountTree
- TextFields
- SaveAlt
- ThumbDown
- ThumbUp
- LocalPhone
- VolumeUp
- VolumeDown
- Translate
- AddCircleOutlined
- RemoveCircleOutlined
- Router
- RemoveRedEye
- Chat
- Mood
- Mic
OtherRelated APIs
@material-ui/icons#ArrowBackIosRounded JavaScript Examples
The following examples show how to use
@material-ui/icons#ArrowBackIosRounded.
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: product-images.js From horondi_client_fe with MIT License | 4 votes |
ProductImages = ({ images }) => {
const [isOpen, setIsOpen] = useState(false);
const [imagesSet, setImagesSet] = useState([]);
const [currImg, setCurrImg] = useState(0);
const [primaryImage, setPrimaryImage] = useState(0);
const [secondaryImages, setSecondaryImages] = useState([]);
const [loading, setLoading] = useState(false);
const { t } = useTranslation();
const { palette } = useTheme();
const isLightTheme = palette.type === 'light';
const initImages = useMemo(
() => [images.primary.small, ...images.additional.map(({ small }) => small)],
[images.primary.small, images.additional]
);
useEffect(() => {
const initialPhotos = async () => {
setLoading(true);
const mapImages = await Promise.all(
initImages.map(async (item) => {
try {
const result = await getImage(item);
return { src: result };
} catch (e) {
return { src: isLightTheme ? productPlugLight : productPlugDark };
}
})
);
setImagesSet(mapImages);
setLoading(false);
};
initialPhotos();
}, [isLightTheme, initImages]);
useEffect(() => {
setSecondaryImages(imagesSet.slice(1, images.length));
}, [imagesSet, images.length]);
useEffect(() => {
const updatedSecondaryImages = imagesSet.filter((_, i) => i !== primaryImage);
setSecondaryImages(updatedSecondaryImages);
}, [primaryImage, imagesSet]);
const styles = useStyles();
const openImage = (idx) => {
setIsOpen(true);
setCurrImg(idx);
};
const sideImages = secondaryImages
.filter((_, i) => i < 3)
.map((image, i) => {
if (i === imagesSet.length || i === 2) {
return (
<div className={styles.lastImagesBox} key={i} onClick={() => openImage(i + 1)}>
<div className={styles.lastImageText}>
{t('product.allPhotos.viewAll')} {`(${images.additional.length})`}{' '}
{t('product.allPhotos.photo')}
</div>
<img
className={styles.lastImage}
src={image.src}
alt={t('product.imgAltInfo')}
data-cy='image'
/>
</div>
);
}
return (
<div key={i} className={styles.imageItem}>
<img
className={styles.sideImage}
src={image.src}
alt={t('product.imgAltInfo')}
onClick={() => setPrimaryImage(imagesSet.indexOf(secondaryImages[i]))}
data-cy='image'
/>
</div>
);
});
const nextImg = () => {
setPrimaryImage((prev) => prev + 1);
};
const prevImg = () => {
setPrimaryImage((prev) => prev - 1);
};
return (
<div className={styles.imageBody}>
<ImgsViewer
imgs={imagesSet}
currImg={currImg}
showThumbnails
isOpen={isOpen}
onClickPrev={() => setCurrImg((prev) => prev - 1)}
onClickNext={() => setCurrImg((prev) => prev + 1)}
onClickThumbnail={(index) => setCurrImg(index)}
onClose={() => setIsOpen(false)}
closeBtnTitle={t('common.close')}
leftArrowTitle={t('common.prev')}
rightArrowTitle={t('common.next')}
/>
<div className={styles.images}>
<div className={styles.imagePreviewContainer}>
<button className={styles.circle} onClick={prevImg} disabled={primaryImage === 0}>
<ArrowBackIosRounded />
</button>
<div className={styles.imageContainer}>
{loading ? (
<Loader heightWrap='100px' />
) : (
<img
src={imagesSet[primaryImage]?.src}
className={styles.primaryImage}
alt={t('product.imgAltInfo')}
/>
)}
</div>
<button
className={styles.circle}
onClick={nextImg}
disabled={primaryImage === initImages.length - 1}
>
<ArrowForwardIosRounded />
</button>
</div>
<div className={styles.additionalImagePreview}>{sideImages}</div>
</div>
</div>
);
}