diff --git a/src/components/DocBaseOverview/DocBaseOverview.tsx b/src/components/DocBaseOverview/DocBaseOverview.tsx index 89846de..23a8591 100644 --- a/src/components/DocBaseOverview/DocBaseOverview.tsx +++ b/src/components/DocBaseOverview/DocBaseOverview.tsx @@ -17,12 +17,13 @@ import Icon from '../Icon/Icon'; interface Props { organizationProp: Organization | undefined; + counter: number; } /** * A list of all DocBases of an organization. */ -function DocBaseOverview({ organizationProp }: Props) { +function DocBaseOverview({ organizationProp, counter }: Props) { const [docBases, setDocBases] = useState([]); const [fileCount, setFileCount] = useState(0); const [selectedOrgID, setSelectedOrgID] = useState(-1); @@ -38,7 +39,9 @@ function DocBaseOverview({ organizationProp }: Props) { useEffect(() => { APIService.getOrganizationNames().then((orgs) => { let orgID = -1; - if (organizationProp !== undefined) { + if (selectedOrgID !== -1) { + orgID = selectedOrgID; + } else if (organizationProp !== undefined) { orgID = organizationProp.id; } else if (orgs !== undefined && orgs.length > 0) { orgID = orgs[0].id; @@ -46,7 +49,7 @@ function DocBaseOverview({ organizationProp }: Props) { loadDocBases(orgID); }); // eslint-disable-next-line react-hooks/exhaustive-deps - }, []); + }, [organizationProp, counter]); const loadDocBases = (orgID: number) => { if (orgID === -1) { diff --git a/src/views/Home/Home.scss b/src/views/Home/Home.scss index 1d10d19..3dd80b2 100644 --- a/src/views/Home/Home.scss +++ b/src/views/Home/Home.scss @@ -6,3 +6,17 @@ .Home { margin-bottom: 100px; } + +.userStudy { + padding: 20px; + background-color: #083d60; + color: white; + width: 50%; + a { + color: white; + } + font-size: 20px; + border-radius: 15px; + border: 2px solid white; + box-shadow: 5px 5px 5px #0000008c; +} diff --git a/src/views/Home/Home.tsx b/src/views/Home/Home.tsx index 80db438..9f6deb5 100644 --- a/src/views/Home/Home.tsx +++ b/src/views/Home/Home.tsx @@ -21,6 +21,7 @@ function Home() { const [username] = useState(getUserName()); const isLoggedIn = useLoggedIn(); + const [counter, setCounter] = useState(0); if (isLoggedIn()) { return ( @@ -37,35 +38,36 @@ function Home() { Hi {username.slice(0, -2)} {username.slice(-2)} 👋 -

- User Study -

-

- - If you are from the user study, you can download - some sample documents{' '} - - here - {' '} - to use them for the upload. - -

-

- - If the link does not download the file, please click{' '} - - here - {' '} - and download the file manually. - -

+
+

User Study

+

+ + If you are from the user study, you can download + some sample documents{' '} + + here + {' '} + to use them for the upload. + +

+

+ + If the link does not download the file, please + click{' '} + + here + {' '} + and download the file manually. + +

+

Tip

@@ -75,11 +77,18 @@ function Home() {

Document Upload

- + { + //window.location.reload(); + setCounter(counter + 1); + }} + >

DocBase

{import.meta.env.VITE_APP_LOG === 'true' && ( diff --git a/src/views/OrgPage/OrgPage.tsx b/src/views/OrgPage/OrgPage.tsx index c56db75..69533a2 100644 --- a/src/views/OrgPage/OrgPage.tsx +++ b/src/views/OrgPage/OrgPage.tsx @@ -25,6 +25,7 @@ function OrgPage() { const [members, setMembers] = useState([]); const [documents, setDocuments] = useState([]); const [render, setRender] = useState(false); + const [counter, setCounter] = useState(0); const navigate = useNavigate(); const isLoggedIn = useLoggedIn(); @@ -139,11 +140,17 @@ function OrgPage() { organization.id ).then((docs) => { setDocuments(docs); + setCounter(counter + 1); }); }} >

Docbase

- {render && } + {render && ( + + )}