diff --git a/.github/workflows/pl-fe.yaml b/.github/workflows/pl-fe.yaml index fad6f0d7b..41969b041 100644 --- a/.github/workflows/pl-fe.yaml +++ b/.github/workflows/pl-fe.yaml @@ -34,13 +34,11 @@ jobs: working-directory: ./packages/pl-fe run: yarn lint - - name: build + - name: Build env: NODE_ENV: production working-directory: ./packages/pl-fe - run: | - yarn build - cp dist/index.html dist/404.html + run: yarn build - name: i18n working-directory: ./packages/pl-fe @@ -48,7 +46,7 @@ jobs: yarn i18n git diff git diff --quiet || (echo "Locale files are out of date. Please run \`yarn i18n\`" && exit 1) - + - name: Upload artifact uses: actions/upload-artifact@v4 with: @@ -57,7 +55,16 @@ jobs: - name: Include archive working-directory: ./packages/pl-fe/dist - run: zip -r pl-fe.zip . + run: zip -r ../pl-fe.zip . + + - name: build + env: + NODE_ENV: production + working-directory: ./packages/pl-fe + run: | + WITH_LANDING_PAGE=true yarn build + cp dist/index.html dist/404.html + cp pl-fe.zip dist/pl-fe.zip - name: Install pl-api deps working-directory: ./packages/pl-api diff --git a/packages/pl-fe/src/build-config-compiletime.ts b/packages/pl-fe/src/build-config-compiletime.ts index eafa610d7..452bc0f63 100644 --- a/packages/pl-fe/src/build-config-compiletime.ts +++ b/packages/pl-fe/src/build-config-compiletime.ts @@ -12,6 +12,7 @@ const { NODE_ENV, BACKEND_URL, FE_SUBDIRECTORY, + WITH_LANDING_PAGE, } = process.env; const sanitizeURL = (url: string | undefined = ''): string => { @@ -28,6 +29,7 @@ const env = { NODE_ENV: NODE_ENV || 'development', BACKEND_URL: sanitizeURL(BACKEND_URL), FE_SUBDIRECTORY: sanitizeBasename(FE_SUBDIRECTORY), + WITH_LANDING_PAGE: WITH_LANDING_PAGE === 'true', }; export type PlFeEnv = typeof env; diff --git a/packages/pl-fe/src/build-config.ts b/packages/pl-fe/src/build-config.ts index b3f3d860a..72e4b5186 100644 --- a/packages/pl-fe/src/build-config.ts +++ b/packages/pl-fe/src/build-config.ts @@ -4,4 +4,5 @@ export const { NODE_ENV, BACKEND_URL, FE_SUBDIRECTORY, + WITH_LANDING_PAGE, } = import.meta.compileTime('./build-config-compiletime.ts'); diff --git a/packages/pl-fe/src/features/ui/components/link-footer.tsx b/packages/pl-fe/src/features/ui/components/link-footer.tsx index 86ad87222..dd2c6c9e2 100644 --- a/packages/pl-fe/src/features/ui/components/link-footer.tsx +++ b/packages/pl-fe/src/features/ui/components/link-footer.tsx @@ -1,32 +1,45 @@ import React from 'react'; -import { FormattedMessage } from 'react-intl'; +import { defineMessages, FormattedMessage, useIntl } from 'react-intl'; +import { WITH_LANDING_PAGE } from 'pl-fe/build-config'; import Text from 'pl-fe/components/ui/text'; import Emojify from 'pl-fe/features/emoji/emojify'; import { usePlFeConfig } from 'pl-fe/hooks/use-pl-fe-config'; import sourceCode from 'pl-fe/utils/code'; +const messages = defineMessages({ + footerNotice: { id: 'getting_started.footer_notice', defaultMessage: 'Proudly made in Poland. {emoji}' }, +}); + const LinkFooter: React.FC = (): JSX.Element => { + const intl = useIntl(); const plFeConfig = usePlFeConfig(); return ( - - {plFeConfig.linkFooterMessage ? ( - - - - ) : ( - {sourceCode.repository}, - code_version: sourceCode.version, - }} - /> + <> + + {plFeConfig.linkFooterMessage ? ( + + + + ) : ( + {sourceCode.repository}, + code_version: sourceCode.version, + }} + /> + )} + + {WITH_LANDING_PAGE && ( + + + )} - + ); }; diff --git a/packages/pl-fe/src/locales/en.json b/packages/pl-fe/src/locales/en.json index b6ed1c0bc..12cbb0ce3 100644 --- a/packages/pl-fe/src/locales/en.json +++ b/packages/pl-fe/src/locales/en.json @@ -872,6 +872,7 @@ "gdpr.title": "{siteTitle} uses cookies", "generic.logo": "Logo", "generic.saved": "Saved", + "getting_started.footer_notice": "Proudly made in Poland. {emoji}", "getting_started.open_source_notice": "{code_name} is open source software. You can contribute or report issues at {code_link} (v{code_version}).", "group.cancel_request": "Cancel request", "group.delete.success": "Group successfully deleted",