ソースを参照

Ready for testing and deploy

bugfix/1919
Djordje Mitrovic 3年前
コミット
58d8275e76

+ 1
- 2
src/components/Cards/ItemDetailsCard/ImagesCarousel/ImagesCarousel.js ファイルの表示

<CloseButtonIcon /> <CloseButtonIcon />
</CloseButton> </CloseButton>
<Scroller isCarousel> <Scroller isCarousel>
{props?.images.map((image) => {
{props?.offer?.images.map((image) => {
if (!image) return; if (!image) return;
return ( return (
<OfferImage <OfferImage
offer: PropTypes.any, offer: PropTypes.any,
onModalClose: PropTypes.any, onModalClose: PropTypes.any,
createOffer: PropTypes.bool, createOffer: PropTypes.bool,
images: PropTypes.array
}; };


export default ImagesCarousel; export default ImagesCarousel;

+ 42
- 24
src/components/Header/Header.js ファイルの表示

import { ReactComponent as Marketplace } from "../../assets/images/svg/package.svg"; import { ReactComponent as Marketplace } from "../../assets/images/svg/package.svg";
import { useTranslation } from "react-i18next"; import { useTranslation } from "react-i18next";
import useIsTablet from "../../hooks/useIsTablet"; import useIsTablet from "../../hooks/useIsTablet";
import { clearFilters } from "../../store/actions/filters/filtersActions";


const Header = () => { const Header = () => {
const theme = useTheme(); const theme = useTheme();
const [shouldShow, setShouldShow] = useState(true); const [shouldShow, setShouldShow] = useState(true);
const routeMatch = useRouteMatch(); const routeMatch = useRouteMatch();
const { isTablet } = useIsTablet(); const { isTablet } = useIsTablet();
const [logoClicked, setLogoClicked] = useState(false);
const { t } = useTranslation(); const { t } = useTranslation();


// Dont show header on auth routes(login, register, etc.) and admin routes // Dont show header on auth routes(login, register, etc.) and admin routes
} }
}, []); }, []);


useEffect(() => {
if (logoClicked) {
if (isAdminRoute()) {
history.push({
pathname: ADMIN_HOME_PAGE,
state: {
logo: true,
},
});
} else {
if (user) {
history.push({
pathname: HOME_PAGE,
state: {
logo: true,
},
});
} else {
history.push({
pathname: MARKETPLACE_PAGE,
state: {
logo: true,
},
});
}
if (searchRef?.current) searchRef.current.value = "";
}
setLogoClicked(false);
}
}, [logoClicked]);

// Sets value into search input based on query string // Sets value into search input based on query string
useEffect(() => { useEffect(() => {
if (searchRef.current) { if (searchRef.current) {


// When user clicks logo, he sends specific state so filters can be removed // When user clicks logo, he sends specific state so filters can be removed
const handleLogoClick = () => { const handleLogoClick = () => {
if (isAdminRoute()) {
history.push({
pathname: ADMIN_HOME_PAGE,
state: {
logo: true,
},
});
} else {
if (user) {
history.push({
pathname: HOME_PAGE,
state: {
logo: true,
},
});
} else {
history.push({
pathname: MARKETPLACE_PAGE,
state: {
logo: true,
},
});
}
if (searchRef?.current) searchRef.current.value = "";
if (
!(
routeMatches(HOME_PAGE) ||
routeMatches(BASE_PAGE) ||
routeMatches(MARKETPLACE_PAGE)
)
) {
dispatch(clearFilters());
setLogoClicked(true);
} }
}; };



+ 3
- 0
src/hooks/useOffers/useFilters.js ファイルの表示

if (clearAll) { if (clearAll) {
clear(); clear();
} }
return () => {
clear();
}
}, []); }, []);


const numOfFiltersChosen = useMemo(() => { const numOfFiltersChosen = useMemo(() => {

+ 2
- 2
src/hooks/useOffers/useSubcategoryFilter.js ファイルの表示

}; };


const clear = () => { const clear = () => {
setSelectedSubcategoryLocally(initialOption);
dispatch(setFilteredSubcategory(initialOption));
setSelectedSubcategoryLocally({});
dispatch(setFilteredSubcategory({}));
}; };


return { return {

読み込み中…
キャンセル
保存