diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b71feedd..781ee35d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -32,6 +32,7 @@ jobs: runs-on: ubuntu-latest env: REACT_APP_API_URL: ${{ secrets.API_URL }} + REACT_APP_PB_APP_URL: ${{ secrets.APP_URL }} REACT_APP_GOOGLE_ANALYTICS_KEY: ${{ secrets.GOOGLE_ANALYTICS_KEY }} REACT_APP_VERSION: ${{github.ref_name}} if: startsWith(github.ref, 'refs/tags') @@ -55,6 +56,7 @@ jobs: runs-on: macos-latest env: REACT_APP_API_URL: ${{ secrets.API_URL }} + REACT_APP_PB_APP_URL: ${{ secrets.APP_URL }} REACT_APP_GOOGLE_ANALYTICS_KEY: ${{ secrets.GOOGLE_ANALYTICS_KEY }} REACT_APP_VERSION: ${{github.ref_name}} if: startsWith(github.ref, 'refs/tags') @@ -77,6 +79,7 @@ jobs: runs-on: windows-latest env: REACT_APP_API_URL: ${{ secrets.API_URL }} + REACT_APP_PB_APP_URL: ${{ secrets.APP_URL }} REACT_APP_GOOGLE_ANALYTICS_KEY: ${{ secrets.GOOGLE_ANALYTICS_KEY }} REACT_APP_VERSION: ${{github.ref_name}} if: startsWith(github.ref, 'refs/tags') @@ -99,6 +102,7 @@ jobs: runs-on: ubuntu-latest env: REACT_APP_API_URL: ${{ secrets.API_URL }} + REACT_APP_PB_APP_URL: ${{ secrets.APP_URL }} REACT_APP_GOOGLE_ANALYTICS_KEY: ${{ secrets.GOOGLE_ANALYTICS_KEY }} REACT_APP_VERSION: ${{github.ref_name}} if: github.event_name == 'push' && github.ref == 'refs/heads/develop' diff --git a/sample.env b/sample.env index 7806c075..60809d81 100644 --- a/sample.env +++ b/sample.env @@ -1,3 +1,4 @@ REACT_APP_API_URL=http://localhost:3001 +REACT_APP_PB_APP_URL=http://localhost:3000 REACT_APP_VERSION=$npm_package_version REACT_APP_GOOGLE_ANALYTICS_KEY=G-xxxxxx #Not necessary, can be omitted for development \ No newline at end of file diff --git a/src/components/creator/Editor/ActionButtons/ShareChallenge/ShareButton.tsx b/src/components/creator/Editor/ActionButtons/ShareChallenge/ShareButton.tsx index 566e90bf..d718f735 100644 --- a/src/components/creator/Editor/ActionButtons/ShareChallenge/ShareButton.tsx +++ b/src/components/creator/Editor/ActionButtons/ShareChallenge/ShareButton.tsx @@ -33,13 +33,8 @@ const ShareDialog = ({ open, setDialogOpen }: { open: boolean, setDialogOpen: (o export const ShareModal = () => { const { shareId } = useContext(CreatorContext) - - const APP_URL = 'https://pilasbloques.program.ar/online' - const DEV_URL = 'localhost:3000' - const sharedLink = (process.env.NODE_ENV === 'production' ? APP_URL : DEV_URL) + `/#/desafio/guardado/${shareId}` - - //const link: string = `http://localhost:3000/#/desafio/guardado/${shareId}` + const sharedLink = process.env.REACT_APP_PB_APP_URL + `/#/desafio/guardado/${shareId}` return {shareId ? diff --git a/src/components/creator/Editor/CreatorViewMode.tsx b/src/components/creator/Editor/CreatorViewMode.tsx index c173842b..a0070632 100644 --- a/src/components/creator/Editor/CreatorViewMode.tsx +++ b/src/components/creator/Editor/CreatorViewMode.tsx @@ -30,20 +30,20 @@ export const CreatorViewMode = () => { return (<> {challengeExists ? ( <> -
} SubHeader={} />} /> +
} SubHeader={} />} /> ) : <>} ) } -const CreatorViewHeader = ({ challenge }: { challenge: SerializedChallenge }) => { +export const CreatorViewHeader = ({ title }: { title: string }) => { const { t } = useTranslation('creator') return - {challenge.title} + {title} diff --git a/src/components/creator/SharedChallengeView.tsx b/src/components/creator/SharedChallengeView.tsx index 749ba5e7..7c8cde87 100644 --- a/src/components/creator/SharedChallengeView.tsx +++ b/src/components/creator/SharedChallengeView.tsx @@ -1,19 +1,16 @@ +import { LocalStorage } from "../../localStorage" import { EmberView } from "../emberView/EmberView" import { Header } from "../header/Header" import { EMBER_IMPORTED_CHALLENGE_PATH } from "../ImportedChallengeView" +import { CreatorViewHeader } from "./Editor/CreatorViewMode" export const SharedChallengeView = () => { + + const challenge = LocalStorage.getImportedChallenge() - - const challengeExists = true - - return (<> - {challengeExists ? ( - <> -
- - - ) : <>} - ) + return <> +
} /> + + }