-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
## JIRA Ticket [BSS-260](https://jira.csiro.au/browse/BSS-260): App Theming Setup [BSS-134](https://jira.csiro.au/browse/BSS-134): Survey Page: Overall page layout update [BSS-217](https://jira.csiro.au/browse/BSS-217): Survey List Page: List item styling [BSS-215](https://jira.csiro.au/browse/BSS-215): Survey List Page: Top bar styling ## Description Set up the ability to support multiple themes and switch between them. An example theme "bubble" is also included. Various components in the notebook list page have been updated to use different settings between the themes. ## Proposed Changes - added theme environment variable - moved theme files into default folder and created a theme file to manage exports of theme specific code - updated imports to use new theme exports - added bubble theme files - updated current components in the notebook list page to use theme specific settings - created survey card component - created heading component ## How to Test - log in to the app (if not already) - navigate to the home page - update `app/.env` to include `VITE_THEME=bubble` and save the file - verify that the theme has changed - (optional) navigate to a notebook page and verify that the theme has changed there as well - update `app/.env` to include `VITE_THEME=default` and save the file - verify that the theme has changed back to the default theme ## Additional Information Some features present in the default theme notebook list page have not yet been implemented in the bubble theme. ## Checklist - [x] I have confirmed all commits have been signed. - [x] I have added JSDoc style comments to any new functions or classes. - [x] Relevant documentation such as READMEs, guides, and class comments are updated.
- Loading branch information
Showing
24 changed files
with
806 additions
and
202 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import {NavLink} from 'react-router-dom'; | ||
import {appBarHeading} from '../../themes/index'; | ||
import {NOTEBOOK_NAME_CAPITALIZED} from '../../../buildconfig'; | ||
|
||
interface AppBarHeadingProps { | ||
link: string; | ||
} | ||
|
||
/** | ||
* AppBarHeading component that conditionally renders a heading or a logo based on the appBarHeading value. | ||
* | ||
* @param {AppBarHeadingProps} props - The properties for the AppBarHeading component. | ||
* @param {string} props.link - The link URL for the NavLink component. | ||
* @returns {JSX.Element} - The rendered AppBarHeading component. | ||
*/ | ||
export const AppBarHeading = ({link}: AppBarHeadingProps) => | ||
appBarHeading === 'bubble' ? ( | ||
<div | ||
style={{ | ||
flexGrow: 1, | ||
fontSize: 32, | ||
fontWeight: 600, | ||
textAlign: 'center', | ||
}} | ||
> | ||
{NOTEBOOK_NAME_CAPITALIZED}s | ||
</div> | ||
) : ( | ||
<NavLink style={{flexGrow: 1}} to={link}> | ||
<img | ||
src="/static/logo/Fieldmark-Short-Green-NoBorder.png" | ||
style={{maxWidth: '140px', flex: 1}} | ||
/> | ||
</NavLink> | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import {ProjectInformation} from '@faims3/data-model'; | ||
import ProjectCard from './project-card'; | ||
import {useNavigate} from 'react-router-dom'; | ||
import * as ROUTES from '../../../constants/routes'; | ||
|
||
/** | ||
* ProjectCardList component that displays a list of ProjectCard components. | ||
* | ||
* @param {ProjectCardListProps} props - The properties for the ProjectCardList component. | ||
* @param {ProjectInformation[]} props.projects - An array of project objects containing details to be displayed in the list. | ||
* @returns {JSX.Element} - The rendered ProjectCardList component. | ||
*/ | ||
export default function ProjectCardList({ | ||
projects, | ||
}: { | ||
projects: ProjectInformation[]; | ||
}) { | ||
const navigate = useNavigate(); | ||
|
||
const onClick = (project_id: string, activated: boolean) => | ||
activated && navigate(ROUTES.INDIVIDUAL_NOTEBOOK_ROUTE + project_id); | ||
|
||
return ( | ||
<div | ||
style={{ | ||
display: 'flex', | ||
flexDirection: 'column', | ||
gap: 16, | ||
}} | ||
> | ||
{projects.map(project => ( | ||
<ProjectCard | ||
key={project.project_id} | ||
project={project} | ||
onClick={onClick} | ||
/> | ||
))} | ||
</div> | ||
); | ||
} |
Oops, something went wrong.