Explorar el Código

Finished #2249

bugfix/2249-fix
jovan.cirkovic hace 3 años
padre
commit
a33d234152

+ 1
- 1
src/components/Cards/CreateOfferCard/ThirdPart/ThirdPartCreateOffer.js Ver fichero



const ThirdPartCreateOffer = (props) => { const ThirdPartCreateOffer = (props) => {
const { t } = useTranslation(); const { t } = useTranslation();
console.log(props)
const offer = useMemo( const offer = useMemo(
() => ({ () => ({
offer: { offer: {

+ 7
- 0
src/components/Header/Header.js Ver fichero

if (isAdminRoute()) { if (isAdminRoute()) {
search.setSearchStringManually(value); search.setSearchStringManually(value);
} else { } else {
if (history.location.pathname.includes("/offer")) {
const newQueryString = new URLSearchParams({ search: value });
history.push({
pathname: HOME_PAGE,
search: newQueryString.toString(),
});
}
if (!routeMatches(HOME_PAGE) && !routeMatches(BASE_PAGE)) { if (!routeMatches(HOME_PAGE) && !routeMatches(BASE_PAGE)) {
const newQueryString = new URLSearchParams({ search: value }); const newQueryString = new URLSearchParams({ search: value });
history.push({ history.push({

+ 16
- 1
src/components/MarketPlace/MarketPlace.js Ver fichero

import React, { useState } from "react"; import React, { useState } from "react";
import PropTypes from "prop-types"; import PropTypes from "prop-types";
import { MarketPlaceContainer } from "./MarketPlace.styled";
import {
AddOfferButton,
AddPlusIcon,
MarketPlaceContainer,
} from "./MarketPlace.styled";
import Header from "./Header/Header"; import Header from "./Header/Header";
import Offers from "./Offers/Offers"; import Offers from "./Offers/Offers";
import { useDispatch, useSelector } from "react-redux"; import { useDispatch, useSelector } from "react-redux";
import { useEffect } from "react"; import { useEffect } from "react";
import { fetchChats } from "../../store/actions/chat/chatActions"; import { fetchChats } from "../../store/actions/chat/chatActions";
import { selectUserId } from "../../store/selectors/loginSelectors"; import { selectUserId } from "../../store/selectors/loginSelectors";
import { toggleCreateOfferModal } from "../../store/actions/modal/modalActions";
import useIsMobile from "../../hooks/useIsMobile";


const MarketPlace = (props) => { const MarketPlace = (props) => {
const [isGrid, setIsGrid] = useState(false); const [isGrid, setIsGrid] = useState(false);
const userId = useSelector(selectUserId); const userId = useSelector(selectUserId);
const dispatch = useDispatch(); const dispatch = useDispatch();
const { isMobile } = useIsMobile();
useEffect(() => { useEffect(() => {
console.log("ABG", userId); console.log("ABG", userId);
if (userId) if (userId)
); );
}, [userId]); }, [userId]);
const offers = props.offers; const offers = props.offers;
const addOfferHandler = () => {
dispatch(toggleCreateOfferModal());
};
return ( return (
<MarketPlaceContainer> <MarketPlaceContainer>
<Header <Header
isUsers={props.users} isUsers={props.users}
users={props.allUsers} users={props.allUsers}
/> />
{isMobile && (
<AddOfferButton onClick={addOfferHandler}>
<AddPlusIcon />
</AddOfferButton>
)}
</MarketPlaceContainer> </MarketPlaceContainer>
); );
}; };

+ 23
- 0
src/components/MarketPlace/MarketPlace.styled.js Ver fichero

import { Box } from "@mui/material"; import { Box } from "@mui/material";
import styled from "styled-components"; import styled from "styled-components";
import selectedTheme from "../../themes";
import { ReactComponent as PlusIcon } from "../../assets/images/svg/plus.svg";


export const MarketPlaceContainer = styled(Box)` export const MarketPlaceContainer = styled(Box)`
height: 100%; height: 100%;
margin-right: 18px; margin-right: 18px;
} }
`; `;

export const AddOfferButton = styled(Box)`
width: 54px;
height: 54px;
border-radius: 100%;
background-color: ${selectedTheme.colors.primaryPurple};
position: fixed;
right: 12px;
bottom: 12px;
display: flex;
align-items: center;
justify-content: center;
`;

export const AddPlusIcon = styled(PlusIcon)`
width: 25px;
path {
stroke: ${selectedTheme.colors.iconYellowColor};
stroke-width: 6px;
}
`;

Cargando…
Cancelar
Guardar