From 3f52ff5116ce0616a39fe10c4b9230547b22a8b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Diana=20L=C3=B3pez=20Alvas?= Date: Tue, 5 Dec 2023 16:36:02 -0300 Subject: [PATCH] using pb app url .env --- .github/workflows/build.yml | 4 ++++ sample.env | 2 +- .../Editor/ActionButtons/ShareChallenge/ShareButton.tsx | 7 +------ 3 files changed, 6 insertions(+), 7 deletions(-) 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 b4631e84..60809d81 100644 --- a/sample.env +++ b/sample.env @@ -1,4 +1,4 @@ REACT_APP_API_URL=http://localhost:3001 -REACT_APP_APP_URL=http://localhost:3000 +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 14e0f851..d632dd46 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 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 ?