diff --git a/README.md b/README.md index fb90840..cccaa25 100644 --- a/README.md +++ b/README.md @@ -32,9 +32,19 @@ We are using serverless functions to serve our GraphQl endpoint to the client ap ## Running locally -First, you need to have a Postegre Database to store the data, then you need to put the connection string in an .env file in your project root directory. -The connection string will be of the format: -postgresql://username:password@server/database_name +To run the project locally with your own local DB, you will need to first put a few env variables in an env file that should be created in /envs/server directory, named `local.env` + +The required variables that needs to be put there are: + +``` +NODE_ENV = "development" +DATABASE_PROXY_URL = "YOUR DB CONNECTION STRING" +JWT_SECRET = "SOME RANDOM JWT SECRET" +LNURL_AUTH_HOST = "http://localhost:8888/dev/login" +CLOUDFLARE_IMAGE_ACCOUNT_ID = "FOR UPLOADING IMAGES" +CLOUDFLARE_IMAGE_API_KEY = "FOR UPLOADING IMAGES" +CLOUDFLARE_IMAGE_ACCOUNT_HASH = "FOR UPLOADING IMAGES" +``` Then you need to run the migrations against your database. use the command: diff --git a/src/features/Auth/pages/LoginPage/LoginPage.tsx b/src/features/Auth/pages/LoginPage/LoginPage.tsx index 5b4b37e..8840b32 100644 --- a/src/features/Auth/pages/LoginPage/LoginPage.tsx +++ b/src/features/Auth/pages/LoginPage/LoginPage.tsx @@ -182,7 +182,7 @@ export default function LoginPage() { color='gray' onClick={copyToClipboard} >{copied ? "Copied" : "Copy"} - What is a lightning wallet? diff --git a/src/features/Posts/pages/PostDetailsPage/Components/StoryPageContent/useUpdateStory.tsx b/src/features/Posts/pages/PostDetailsPage/Components/StoryPageContent/useUpdateStory.tsx index 48b10e4..ac64108 100644 --- a/src/features/Posts/pages/PostDetailsPage/Components/StoryPageContent/useUpdateStory.tsx +++ b/src/features/Posts/pages/PostDetailsPage/Components/StoryPageContent/useUpdateStory.tsx @@ -8,6 +8,7 @@ import { NotificationsService } from "src/services/notifications.service"; import { useAppDispatch } from "src/utils/hooks"; import { useReduxEffect } from "src/utils/hooks/useReduxEffect"; import { openModal } from "src/redux/features/modals.slice"; +import { createRoute } from "src/utils/routing"; const CONFIRM_DELETE_STORY = createAction<{ confirmed?: boolean }>('DELETE_STORY_CONFIRMED')({}) @@ -31,7 +32,7 @@ export const useUpdateStory = (story: Story) => { cover_image: story.cover_image ? { id: null, name: null, url: story.cover_image } : null, })) - navigate("/blog/create-post?type=story") + navigate(createRoute({ type: "write-story" })) }; const onConfirmDelete = useCallback(({ payload: { confirmed } }: typeof CONFIRM_DELETE_STORY) => { diff --git a/src/features/Tournaments/pages/MakersPage/MakersPage.tsx b/src/features/Tournaments/pages/MakersPage/MakersPage.tsx index ebdf5d4..c9dd9a5 100644 --- a/src/features/Tournaments/pages/MakersPage/MakersPage.tsx +++ b/src/features/Tournaments/pages/MakersPage/MakersPage.tsx @@ -20,7 +20,7 @@ export default function MakersPage() { {query.loading ? : - query.data?.me ? + (query.data?.me && !!query.data.tournamentParticipationInfo) ? : null } diff --git a/src/features/Tournaments/pages/OverviewPage/RegisterationModals/LoginModal/LoginModal.tsx b/src/features/Tournaments/pages/OverviewPage/RegisterationModals/LoginModal/LoginModal.tsx index 043091a..9617266 100644 --- a/src/features/Tournaments/pages/OverviewPage/RegisterationModals/LoginModal/LoginModal.tsx +++ b/src/features/Tournaments/pages/OverviewPage/RegisterationModals/LoginModal/LoginModal.tsx @@ -153,7 +153,7 @@ export default function LinkingAccountModal({ onClose, direction, tournamentId, color='gray' onClick={copyToClipboard} >{copied ? "Copied" : "Copy"} - What is a lightning wallet? diff --git a/src/utils/routing/routes.ts b/src/utils/routing/routes.ts index 91b514d..895140a 100644 --- a/src/utils/routing/routes.ts +++ b/src/utils/routing/routes.ts @@ -15,7 +15,7 @@ type RouteOptions = username?: string, } | { - type: "edit-story", + type: "write-story", id?: number, } | { @@ -62,6 +62,10 @@ export function createRoute(options: RouteOptions) { + (!onlyId ? "-" : "") + `${options.id}` } + + if (options.type === 'write-story') + return "/story/write?type=story" + if ((options.type === "post" && options.postType.toLowerCase() === 'bounty') || options.type === "bounty") return `/blog/post/bounty/${options.id}`