-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #31 from BirthdayResearch/nicoletan/dfc-495-ui-int…
…egration-for-storing-email feat(ui-ux): UI integration for storing email
- Loading branch information
Showing
11 changed files
with
242 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
NEXT_PUBLIC_SERVER_URL="http://localhost:5741/" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,25 @@ | ||
"use client"; | ||
|
||
import { Provider } from "react-redux"; | ||
import UnlockPower from "@/app/ui/sections/UnlockPower"; | ||
import HowItWorksSection from "@/app/ui/sections/HowItWorksSection"; | ||
import MarbleOpportunitiesSection from "@/app/ui/sections/MarbleOpportunitiesSection"; | ||
import JoinTheCommunitySection from "@/app/ui/sections/JoinTheCommunitySection"; | ||
import FaqSection from "@/app/ui/sections/FaqSection"; | ||
import DFIOpportunities from "@/app/ui/sections/DFIOpportunities"; | ||
import { store } from "@/app/store/store"; | ||
|
||
export default function Page() { | ||
return ( | ||
<div className="flex flex-col justify-center items-center w-full my-12 md:my-24 gap-y-24 md:gap-y-60"> | ||
<UnlockPower /> | ||
<MarbleOpportunitiesSection /> | ||
<HowItWorksSection /> | ||
<DFIOpportunities /> | ||
<JoinTheCommunitySection /> | ||
<FaqSection /> | ||
</div> | ||
<Provider store={store}> | ||
<div className="flex flex-col justify-center items-center w-full my-12 md:my-24 gap-y-24 md:gap-y-60"> | ||
<UnlockPower /> | ||
<MarbleOpportunitiesSection /> | ||
<HowItWorksSection /> | ||
<DFIOpportunities /> | ||
<JoinTheCommunitySection /> | ||
<FaqSection /> | ||
</div> | ||
</Provider> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import { createApi, fetchBaseQuery } from "@reduxjs/toolkit/query/react"; | ||
import { CreateUserI } from "@/app/types/user"; | ||
import process from "process"; | ||
|
||
// eslint-disable-next-line import/prefer-default-export | ||
export const marbleFiApi = createApi({ | ||
reducerPath: "marbleFiApi", | ||
baseQuery: fetchBaseQuery({ baseUrl: process.env.NEXT_PUBLIC_SERVER_URL }), | ||
endpoints: (builder) => ({ | ||
createUser: builder.mutation<any, CreateUserI>({ | ||
query: ({ email, status }) => ({ | ||
url: "/user", | ||
body: { | ||
email: email, | ||
status: status, | ||
}, | ||
method: "POST", | ||
}), | ||
}), | ||
}), | ||
}); | ||
|
||
export const { useCreateUserMutation } = marbleFiApi; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import { marbleFiApi } from "@/app/store/marbleFiApi"; | ||
|
||
const rootReducer = marbleFiApi.reducer; | ||
export type RootState = ReturnType<typeof rootReducer>; | ||
|
||
export default rootReducer; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { configureStore } from "@reduxjs/toolkit"; | ||
import { marbleFiApi } from "@/app/store/marbleFiApi"; | ||
|
||
export const store = configureStore({ | ||
reducer: { | ||
[marbleFiApi.reducerPath]: marbleFiApi.reducer, | ||
}, | ||
middleware: (getDefaultMiddleware) => | ||
getDefaultMiddleware().concat(marbleFiApi.middleware), | ||
}); | ||
|
||
// Infer the `RootState` and `AppDispatch` types from the store itself | ||
export type RootState = ReturnType<typeof store.getState>; | ||
// Inferred type: {posts: PostsState, comments: CommentsState, users: UsersState} | ||
export type AppDispatch = typeof store.dispatch; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
export const enum SubscriptionStatus { | ||
ACTIVE = "ACTIVE", | ||
INACTIVE = "INACTIVE", | ||
} | ||
|
||
export interface CreateUserI { | ||
email: string; | ||
status?: SubscriptionStatus; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.