updated photoFrame to not show upload first photo in searchMode

This commit is contained in:
Abhinav-grd 2021-05-20 13:19:45 +05:30
parent 9ff5140e61
commit 85f481ea3a

View file

@ -85,6 +85,7 @@ interface Props {
isFirstLoad; isFirstLoad;
openFileUploader; openFileUploader;
loadingBar; loadingBar;
searchMode: boolean;
} }
const PhotoFrame = ({ const PhotoFrame = ({
@ -98,6 +99,7 @@ const PhotoFrame = ({
isFirstLoad, isFirstLoad,
openFileUploader, openFileUploader,
loadingBar, loadingBar,
searchMode,
}: Props) => { }: Props) => {
const [open, setOpen] = useState(false); const [open, setOpen] = useState(false);
const [currentIndex, setCurrentIndex] = useState<number>(0); const [currentIndex, setCurrentIndex] = useState<number>(0);
@ -258,7 +260,7 @@ const PhotoFrame = ({
return ( return (
<> <>
{!isFirstLoad && files.length == 0 ? ( {!isFirstLoad && files.length == 0 && !searchMode ? (
<div <div
style={{ style={{
height: '60%', height: '60%',
@ -308,15 +310,13 @@ const PhotoFrame = ({
) { ) {
currentDate = currentDate =
item.metadata.creationTime / 1000; item.metadata.creationTime / 1000;
const dateTimeFormat = new Intl.DateTimeFormat( const dateTimeFormat =
'en-IN', new Intl.DateTimeFormat('en-IN', {
{
weekday: 'short', weekday: 'short',
year: 'numeric', year: 'numeric',
month: 'long', month: 'long',
day: 'numeric', day: 'numeric',
} });
);
timeStampList.push({ timeStampList.push({
itemType: ITEM_TYPE.TIME, itemType: ITEM_TYPE.TIME,
date: isSameDay( date: isSameDay(