Skip to content

Commit

Permalink
fix narrow study modules page
Browse files Browse the repository at this point in the history
  • Loading branch information
mipyykko committed Aug 22, 2023
1 parent 1bf20d3 commit de7791f
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion frontend/components/Dashboard/StudyModules/ModuleCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ function ModuleCard({ studyModule, image, loading }: ModuleCardProps) {
const moduleNotFound = !loading && !studyModule

return (
<Grid item xs={12} sm={6} lg={6}>
<Grid item xxxs={12} xxs={12} xs={12} sm={6} lg={6}>
<Base>
{loading && (
<ImageBackgroundSkeleton>
Expand Down
6 changes: 4 additions & 2 deletions frontend/lib/with-apollo-client/fetch-user-details.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import { ApolloClient } from "@apollo/client"

import { CurrentUserDocument } from "/graphql/generated"
import { CurrentUserDocument, CurrentUserQuery } from "/graphql/generated"

export default async function fetchUserDetails(apollo: ApolloClient<object>) {
export default async function fetchUserDetails(
apollo: ApolloClient<object>,
): Promise<CurrentUserQuery["currentUser"]> {
const { data } = await apollo.query({
query: CurrentUserDocument,
fetchPolicy: "cache-first",
Expand Down
4 changes: 4 additions & 0 deletions frontend/lib/with-apollo-client/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,10 @@ const withApolloClient = (App: any) => {
pageProps = await App.getInitialProps(pageCtx)
}

if (!pageProps.pageProps) {
pageProps.pageProps = {}
}

pageProps.pageProps.currentUser = currentUser

if (typeof window === "undefined") {
Expand Down
2 changes: 0 additions & 2 deletions frontend/pages/_app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,6 @@ MyApp.getInitialProps = async (props: AppContext) => {
const admin = signedIn && isAdmin(ctx)
const accessToken = getAccessToken(ctx)

/*Object.assign(originalProps.pageProps, { signedIn, admin, accessToken })
return originalProps*/
return {
...originalProps,
pageProps: {
Expand Down

0 comments on commit de7791f

Please sign in to comment.