diff --git a/website/README.md b/website/README.md index 6460a523b9..1e9734aa3b 100644 --- a/website/README.md +++ b/website/README.md @@ -42,3 +42,8 @@ After adding your LOCALE.json file(s) in `./public/locales/`, build the website ```bash PUBLIC_URL='https://my-domain.com' REACT_APP_BACKEND_URL='http://api.my-domain.com' REACT_APP_FALLBACK_LANGUAGE=en yarn build ``` + +## Additional options + +- `REACT_APP_DISABLE_FEATURES_CARDS=1` - Allows disabling Features cards +- `REACT_APP_DISABLE_ONE_CLICK_LINK=1` - Allows disabling "One-click link" support diff --git a/website/src/App.tsx b/website/src/App.tsx index 663490a0c5..29a98a8424 100644 --- a/website/src/App.tsx +++ b/website/src/App.tsx @@ -18,6 +18,7 @@ const App = () => { }); } + const features = process.env.REACT_APP_DISABLE_FEATURES_CARDS !== '1'; return ( @@ -25,7 +26,7 @@ const App = () => {
- + {features && } diff --git a/website/src/Routing.tsx b/website/src/Routing.tsx index 2275217c93..25d5360ded 100644 --- a/website/src/Routing.tsx +++ b/website/src/Routing.tsx @@ -5,11 +5,12 @@ import DisplaySecret from './displaySecret/DisplaySecret'; import Upload from './createSecret/Upload'; export const Routing = () => { + const oneClickLink = process.env.REACT_APP_DISABLE_ONE_CLICK_LINK !== '1'; return ( } /> } /> - } /> + {oneClickLink && } />} } /> ); diff --git a/website/src/displaySecret/Result.tsx b/website/src/displaySecret/Result.tsx index 62e8d47916..93c470596c 100644 --- a/website/src/displaySecret/Result.tsx +++ b/website/src/displaySecret/Result.tsx @@ -26,6 +26,7 @@ const Result = ({ uuid, password, prefix, customPassword }: ResultProps) => { `${window.location.protocol}//${window.location.host}`) + `/#/${prefix}`; const short = `${base}/${uuid}`; const full = `${short}/${password}`; + const oneClickLink = process.env.REACT_APP_DISABLE_ONE_CLICK_LINK !== '1'; const { t } = useTranslation(); return ( @@ -39,7 +40,7 @@ const Result = ({ uuid, password, prefix, customPassword }: ResultProps) => { - {!customPassword && ( + {oneClickLink && !customPassword && ( )}