Skip to content

Commit c514586

Browse files
committed
responsiveness fix and prevent crash on zupass gated events in app
1 parent 0b39ea8 commit c514586

4 files changed

Lines changed: 14 additions & 4 deletions

File tree

devconnect-app/src/app/store.hooks.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,11 @@ import { AppState } from './store';
1212
export const useFavorites = () => {
1313
const userData = useGlobalStore(useShallow((state) => state.userData));
1414
const favorites =
15-
useGlobalStore((state) => state.userData?.favorite_events) || [];
15+
useGlobalStore((state) => {
16+
console.log('SELECTOR RUNNING, state:', state);
17+
18+
return state.userData?.favorite_events;
19+
}) || [];
1620
const setFavoriteEvents = useGlobalStore((state) => state.setFavoriteEvents);
1721

1822
const updateFavorite = (eventId: string) => {

devconnect-app/src/app/store.provider.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,13 @@ export const GlobalStoreProvider = ({
4444
}: GlobalStoreProviderProps) => {
4545
const storeRef = useRef<AppStore | null>(null);
4646

47+
console.log('running on server client');
48+
4749
if (storeRef.current === null) {
50+
console.log('creating store');
4851
storeRef.current = createGlobalStore(initGlobalStore(events, userData));
52+
} else {
53+
console.log('store already created');
4954
}
5055

5156
useStore(storeRef.current, (state) => console.log('STATE', state));

lib/components/event-schedule-new/filter.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ export const FilterSummary = ({ filter }: { filter: any }) => {
167167
<div
168168
className={cn(
169169
filterCss["active-filters"],
170-
"max-w-[200px] truncate text-ellipsis"
170+
"max-w-[200px] truncate text-ellipsis hidden sm:!flex"
171171
)}
172172
>
173173
{/* <p className="small-text">Active filter:</p> */}

lib/components/event-schedule-new/layout-app.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import filterCss from "./filter.module.scss";
66
import Link from "lib/components/link/Link";
77
import layoutCss from "./layout-app.module.scss";
88
import cn from "classnames";
9+
import { withParcnetProvider } from "./zupass/zupass";
910
// import TicketPurple from "lib/assets/icons/ticket-purple.svg";
1011

1112
type CalendarLayoutProps = ScheduleProps & {
@@ -33,7 +34,7 @@ const Layout = (props: CalendarLayoutProps) => {
3334
layoutCss["layout-app"]
3435
)}
3536
>
36-
<div className="flex-col md:flex-row flex justify-between gap-4 md:mt-1 md:mb-1 mb-1 px-4 md:px-0">
37+
<div className="flex-col md:flex-row flex justify-between gap-4 md:mt-1 md:mb-1 mb-1">
3738
<div
3839
className={cn(
3940
"text-sm overflow-hidden px-4 py-2 text-[#36364C] self-center w-full",
@@ -123,4 +124,4 @@ const Layout = (props: CalendarLayoutProps) => {
123124
);
124125
};
125126

126-
export default Layout;
127+
export default withParcnetProvider(Layout);

0 commit comments

Comments
 (0)