Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EventsListing responsiveness #189

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
quick fix
varunthakkar1 committed Oct 10, 2021
commit 95fba093fd3cf5c5de22fe555d1c38275e66b661
23,982 changes: 23,898 additions & 84 deletions package-lock.json

Large diffs are not rendered by default.

30 changes: 16 additions & 14 deletions src/components/event-listing/EventListing.tsx
Original file line number Diff line number Diff line change
@@ -8,7 +8,7 @@ import { Routes } from '../../App';
import { LinkButton } from '../../components/LinkButton';
import { EventInformation } from '../../containers/upcoming-events/ducks/types';
import { DEFAULT_IMAGE } from '../../utils/copy';
import { PRIMARY_BREAKPOINT } from '../../utils/breakpoints'
import { PRIMARY_BREAKPOINT } from '../../utils/breakpoints';

const { Text, Paragraph } = Typography;

@@ -61,7 +61,7 @@ const Thumbnail = styled.img`
width: 33%;
object-fit: cover;
height: 312px;
@media screen and (max-width: ${PRIMARY_BREAKPOINT}) {
width: 45%;
height: 214px;
@@ -101,7 +101,7 @@ const DateText = styled(Text)`
@media screen and (max-width: ${PRIMARY_BREAKPOINT}) {
font-size: 16px;
}
`
`;

interface EventListingProps extends EventInformation {
admin?: boolean;
@@ -116,25 +116,27 @@ const EventListing: React.FC<EventListingProps> = ({
admin,
}) => {
const history = useHistory();
const onMobile = useMediaQuery({ query: ('(max-width: ' + PRIMARY_BREAKPOINT + ')') });
const onMobile = useMediaQuery({
query: '(max-width: ' + PRIMARY_BREAKPOINT + ')',
});

const handleMobileOnClick = () => {
onMobile && history.push(Routes.EVENT_BASE_ROUTE + id)
}
onMobile && history.push(Routes.EVENT_BASE_ROUTE + id);
};

const StyledCard = styled(Card)`
margin-bottom: 32px;
height: ${onMobile ? '216px' : '314px'};
.ant-card-body {
padding: 0px;
}
cursor: ${onMobile && `pointer`};
`;
margin-bottom: 32px;
height: ${onMobile ? '216px' : '314px'};
.ant-card-body {
padding: 0px;
}
cursor: ${onMobile && `pointer`};
`;

return (
<StyledCard onClick={handleMobileOnClick}>
<CardContent>
<Thumbnail src={thumbnail || DEFAULT_IMAGE}/>
<Thumbnail src={thumbnail || DEFAULT_IMAGE} />
<Info>
<InlineTitle>{title}</InlineTitle>
{ticketCount && (