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
export const appName: string = process.env.REACT_APP_NAME as string
/* Institution */
export const appInst: string = env.REACT_APP_INST as string;
export const appInst: string = env.REACT_APP_INST as string
/* Theming */
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 */
export const appStagingWarning: boolean =
env.REACT_APP_STAGING_WARNING === 'true';
env.REACT_APP_STAGING_WARNING === 'true'
/* Footer content */
export const appTechnicalSupportLink: string = env.REACT_APP_SUPPORT_URL as string
......
......@@ -69,14 +69,25 @@ function DropDown(props: IProps) {
}
return (
<DropDownMenu
aria-haspopup='true'
aria-expanded={open}
/* eslint-disable-next-line react/jsx-no-bind */
onFocus={openMenu}
tabIndex={0}
>
<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
: getValueName(value, options).toLowerCase()}
......@@ -85,19 +96,25 @@ function DropDown(props: IProps) {
<div>
{open && (
<DropDownList>
{options.map((option, index) => {
return (
<li
onClick={(
event: React.MouseEvent<HTMLElement, MouseEvent>,
) => {
handleClick(option)
}}
>
<p>{option.name}</p>
</li>
)
})}
{options.map((option) => (
// eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions
<li
onKeyDown={(event) => {
if (event.key === 'Enter' || event.key === ' ') {
openMenu()
}
}}
onClick={(
// eslint-disable-next-line @typescript-eslint/no-unused-vars
event: React.MouseEvent<HTMLElement, MouseEvent>,
) => {
handleClick(option)
}}
>
<p>{option.name}</p>
</li>
))}
</DropDownList>
)}
</div>
......@@ -105,4 +122,10 @@ function DropDown(props: IProps) {
)
}
DropDown.defaultProps =
{
placeholder: undefined,
}
export default DropDown
import { appInst } from 'appConfig'
import React from 'react'
import { appTheme } from 'appConfig'
import UiOLogoBar from './UiO'
import UiBLogoBar from './UiB'
function LogoBar() {
switch (appInst) {
switch (appTheme) {
case 'uio':
return <UiOLogoBar />
case 'uib':
......
import React from 'react'
import styled from 'styled-components/macro'
import { useTranslation } from 'react-i18next'
const LogoBarWrapper = styled.div`
background-color: ${(props) => props.theme.colors.secondary});
......@@ -15,8 +13,6 @@ const LogoBar = styled.div`
`
function UiBLogoBar() {
const { i18n, t } = useTranslation(['common', 'footer'])
return (
<LogoBarWrapper>
<LogoBar>
......
......@@ -10,10 +10,6 @@ const LogoBarWrapper = styled.div`
background-color: ${({ theme }) => theme.page.headerBackgroundColor};
`
const LogoBar = styled.div`
margin: 0 auto;
`
type Language = {
language: string
}
......@@ -25,7 +21,7 @@ const Logo = styled.div<Language>`
`
function UiOLogoBar() {
const { i18n, t } = useTranslation(['common', 'footer'])
const { i18n } = useTranslation(['common', 'footer'])
return (
<LogoBarWrapper>
......
......@@ -44,7 +44,7 @@ const ContentContainer = styled.div`
`
const Footer: React.FunctionComponent = () => {
const { i18n, t } = useTranslation(['common', 'footer'])
const { t } = useTranslation(['common', 'footer'])
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