Skip to content
Snippets Groups Projects
Commit 769f34d6 authored by Tore.Brede's avatar Tore.Brede
Browse files

Fixing and temporarily ignoring some eslint warnings

parent ec785c67
No related branches found
No related tags found
1 merge request!53GREG-41: Initial footer and header
Pipeline #93777 passed
...@@ -17,7 +17,7 @@ export const appVersion: string = process.env.REACT_APP_VERSION as string ...@@ -17,7 +17,7 @@ export const appVersion: string = process.env.REACT_APP_VERSION as string
export const appName: string = process.env.REACT_APP_NAME as string export const appName: string = process.env.REACT_APP_NAME as string
/* Institution */ /* Institution */
export const appInst: string = env.REACT_APP_INST as string; export const appInst: string = env.REACT_APP_INST as string
/* Theming */ /* Theming */
export const appTheme: string = env.REACT_APP_THEME export const appTheme: string = env.REACT_APP_THEME
...@@ -26,7 +26,7 @@ export const appTheme: string = env.REACT_APP_THEME ...@@ -26,7 +26,7 @@ export const appTheme: string = env.REACT_APP_THEME
/* Show warning in the footer about this being a staging/test system */ /* Show warning in the footer about this being a staging/test system */
export const appStagingWarning: boolean = export const appStagingWarning: boolean =
env.REACT_APP_STAGING_WARNING === 'true'; env.REACT_APP_STAGING_WARNING === 'true'
/* Footer content */ /* Footer content */
export const appTechnicalSupportLink: string = env.REACT_APP_SUPPORT_URL as string export const appTechnicalSupportLink: string = env.REACT_APP_SUPPORT_URL as string
......
...@@ -69,14 +69,25 @@ function DropDown(props: IProps) { ...@@ -69,14 +69,25 @@ function DropDown(props: IProps) {
} }
return ( return (
<DropDownMenu <DropDownMenu
aria-haspopup='true' aria-haspopup='true'
aria-expanded={open} aria-expanded={open}
/* eslint-disable-next-line react/jsx-no-bind */
onFocus={openMenu} onFocus={openMenu}
tabIndex={0} tabIndex={0}
> >
<div> <div>
<div onClick={openMenu}> <div role='button'
onKeyDown={(event) => {
if (event.key === 'Enter' || event.key === ' ') {
openMenu()
}
}}
onClick={openMenu}
tabIndex={0}
>
{/* eslint-disable-next-line */}
{placeholder {placeholder
? placeholder ? placeholder
: getValueName(value, options).toLowerCase()} : getValueName(value, options).toLowerCase()}
...@@ -85,19 +96,25 @@ function DropDown(props: IProps) { ...@@ -85,19 +96,25 @@ function DropDown(props: IProps) {
<div> <div>
{open && ( {open && (
<DropDownList> <DropDownList>
{options.map((option, index) => { {options.map((option) => (
return ( // eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions
<li <li
onClick={( onKeyDown={(event) => {
event: React.MouseEvent<HTMLElement, MouseEvent>, if (event.key === 'Enter' || event.key === ' ') {
) => { openMenu()
handleClick(option) }
}} }}
>
<p>{option.name}</p> onClick={(
</li> // eslint-disable-next-line @typescript-eslint/no-unused-vars
) event: React.MouseEvent<HTMLElement, MouseEvent>,
})} ) => {
handleClick(option)
}}
>
<p>{option.name}</p>
</li>
))}
</DropDownList> </DropDownList>
)} )}
</div> </div>
...@@ -105,4 +122,10 @@ function DropDown(props: IProps) { ...@@ -105,4 +122,10 @@ function DropDown(props: IProps) {
) )
} }
DropDown.defaultProps =
{
placeholder: undefined,
}
export default DropDown export default DropDown
import { appInst } from 'appConfig' import React from 'react'
import { appTheme } from 'appConfig'
import UiOLogoBar from './UiO' import UiOLogoBar from './UiO'
import UiBLogoBar from './UiB' import UiBLogoBar from './UiB'
function LogoBar() { function LogoBar() {
switch (appInst) { switch (appTheme) {
case 'uio': case 'uio':
return <UiOLogoBar /> return <UiOLogoBar />
case 'uib': case 'uib':
......
import React from 'react' import React from 'react'
import styled from 'styled-components/macro' import styled from 'styled-components/macro'
import { useTranslation } from 'react-i18next'
const LogoBarWrapper = styled.div` const LogoBarWrapper = styled.div`
background-color: ${(props) => props.theme.colors.secondary}); background-color: ${(props) => props.theme.colors.secondary});
...@@ -15,8 +13,6 @@ const LogoBar = styled.div` ...@@ -15,8 +13,6 @@ const LogoBar = styled.div`
` `
function UiBLogoBar() { function UiBLogoBar() {
const { i18n, t } = useTranslation(['common', 'footer'])
return ( return (
<LogoBarWrapper> <LogoBarWrapper>
<LogoBar> <LogoBar>
......
...@@ -10,10 +10,6 @@ const LogoBarWrapper = styled.div` ...@@ -10,10 +10,6 @@ const LogoBarWrapper = styled.div`
background-color: ${({ theme }) => theme.page.headerBackgroundColor}; background-color: ${({ theme }) => theme.page.headerBackgroundColor};
` `
const LogoBar = styled.div`
margin: 0 auto;
`
type Language = { type Language = {
language: string language: string
} }
...@@ -25,7 +21,7 @@ const Logo = styled.div<Language>` ...@@ -25,7 +21,7 @@ const Logo = styled.div<Language>`
` `
function UiOLogoBar() { function UiOLogoBar() {
const { i18n, t } = useTranslation(['common', 'footer']) const { i18n } = useTranslation(['common', 'footer'])
return ( return (
<LogoBarWrapper> <LogoBarWrapper>
......
...@@ -44,7 +44,7 @@ const ContentContainer = styled.div` ...@@ -44,7 +44,7 @@ const ContentContainer = styled.div`
` `
const Footer: React.FunctionComponent = () => { const Footer: React.FunctionComponent = () => {
const { i18n, t } = useTranslation(['common', 'footer']) const { t } = useTranslation(['common', 'footer'])
return ( return (
<> <>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment