Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/fixing-share-component' into url…
Browse files Browse the repository at this point in the history
…-share
  • Loading branch information
tfloxolodeiro committed Dec 5, 2023
2 parents ec92fd8 + 3f52ff5 commit a25b047
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 20 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand All @@ -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')
Expand All @@ -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')
Expand All @@ -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'
Expand Down
1 change: 1 addition & 0 deletions sample.env
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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 <Stack>
{shareId ?
Expand Down
6 changes: 3 additions & 3 deletions src/components/creator/Editor/CreatorViewMode.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,20 +30,20 @@ export const CreatorViewMode = () => {
return (<>
{challengeExists ? (
<>
<Header CenterComponent={<CreatorViewHeader challenge={challengeBeingEdited} />} SubHeader={<EditorSubHeader viewButton={<ReturnToEditionButton />} />} />
<Header CenterComponent={<CreatorViewHeader title={challengeBeingEdited.title} />} SubHeader={<EditorSubHeader viewButton={<ReturnToEditionButton />} />} />
<EmberView height='calc(100% - var(--creator-subheader-height))' path={EMBER_IMPORTED_CHALLENGE_PATH} />
</>
) : <></>}
</>)
}

const CreatorViewHeader = ({ challenge }: { challenge: SerializedChallenge }) => {
export const CreatorViewHeader = ({ title }: { title: string }) => {
const { t } = useTranslation('creator')

return <BetaBadge smaller={true}>
<PBreadcrumbs>
<HeaderText text={t("editor.previewModeHeader")} />
<Typography>{challenge.title}</Typography>
<Typography>{title}</Typography>
</PBreadcrumbs>
</BetaBadge>

Expand Down
19 changes: 8 additions & 11 deletions src/components/creator/SharedChallengeView.tsx
Original file line number Diff line number Diff line change
@@ -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 ? (
<>
<Header/>
<EmberView height='calc(100% - var(--creator-subheader-height))' path={EMBER_IMPORTED_CHALLENGE_PATH} />
</>
) : <></>}
</>)
return <>
<Header CenterComponent={<CreatorViewHeader title={challenge.titulo} />} />
<EmberView height='100%' path={EMBER_IMPORTED_CHALLENGE_PATH} />
</>
}

0 comments on commit a25b047

Please sign in to comment.