Skip to content

Commit

Permalink
created config file for demosite url
Browse files Browse the repository at this point in the history
  • Loading branch information
harith-hacky03 authored and sumn2u committed Jun 11, 2024
1 parent 59a4f84 commit 03c15b1
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
7 changes: 7 additions & 0 deletions client/config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@

const config = {
demoSiteUrl:"https://annotate-docs.dwaste.live/"
};

export default config;

3 changes: 2 additions & 1 deletion client/src/DemoSite/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import React, { useEffect, useState } from "react"
import SetupPage from "../SetupPage";
import { useSettings } from "../SettingsProvider";
import {setIn} from "seamless-immutable"
import config from '../../config.js';

const extractRelevantProps = (region) => ({
cls: region.cls,
Expand Down Expand Up @@ -160,7 +161,7 @@ export default () => {
const updatedIndex = (selectedImageIndex - 1 + imageNames.length) % imageNames.length
changeSelectedImageIndex(isNaN(updatedIndex ) ? 0 : updatedIndex)
}}
openDocs={() => window.open("https://annotate-docs.dwaste.live/", '_blank')}
openDocs={() => window.open(config.demoSiteUrl, '_blank')}
hideSettings={true}
disabledNextAndPrev={settings.images.length <= 1}
selectedImageIndex={selectedImageIndex}
Expand Down
3 changes: 2 additions & 1 deletion client/src/SetupPage/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import { useSettings } from "../SettingsProvider";
import { useTranslation } from "react-i18next"
import { Info } from '@mui/icons-material';
import NoteSection from "../NoteSection";
import config from '../../config.js'; //importing demo site config from client/config.js

const Container = styled("div")({
marginTop: "2rem",
Expand Down Expand Up @@ -110,7 +111,7 @@ export const SetupPage = ({setConfiguration, settings, setShowLabel}) => {
<NoteSection
icon={Info}
text={t("more_info")}
link="https://annotate-docs.dwaste.live"
link={config.demoSiteUrl}
/>
<Box display="flex" paddingTop="5rem" justifyContent="end">
<Button variant="contained" disabled={settings.taskDescription.trim().length <= 0} onClick={() => setTab("configure")} disableElevation>
Expand Down

0 comments on commit 03c15b1

Please sign in to comment.