-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Korjaa käyttöliittymän yksityiskohtia (#483)
* lisää suunnittelusopimusosioon puuttuvia tekstejä * korjaa maksimikooksi tiedostoille 25mb * korjaa checkbox ja radiobutton disabled teksti mustahkoksi * korjaa painikkeisiin typeksi button, jotta enterin painaminen tekstikentässä ei aiheuta painikkeeseen asetettua toimintoa * lisää hover-tyylit ja aktiivisen 'routen' headertyylit * siirrä virkamiehen nimi 'poistu palvelusta' painikkeen keskelle * aseta autocomplete kenttä aukeamaan enterin painalluksella * korjaa teksti projektin tiedot sivun lukutilasta * Korjaa tekstejä
- Loading branch information
Showing
12 changed files
with
113 additions
and
63 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
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
54 changes: 44 additions & 10 deletions
54
src/components/layout/navigation/HeaderNavigationItem.tsx
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 |
---|---|---|
@@ -1,28 +1,62 @@ | ||
import React, { FunctionComponent } from "react"; | ||
import React from "react"; | ||
import { IconProp } from "@fortawesome/fontawesome-svg-core"; | ||
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; | ||
import Link from "next/link"; | ||
import classNames from "classnames"; | ||
import { styled } from "@mui/material"; | ||
|
||
export interface NavigationRoute { | ||
label: string; | ||
href: string; | ||
icon?: IconProp; | ||
removeLeftPadding?: boolean; | ||
mobile?: true; | ||
isCurrentRoute?: boolean; | ||
} | ||
|
||
const HeaderNavigationItem: FunctionComponent<NavigationRoute> = ({ href, label, icon, removeLeftPadding, mobile }) => ( | ||
<li> | ||
const HeaderNavigationItem = styled(({ href, label, icon, mobile, className }: NavigationRoute & { className?: string }) => ( | ||
<li className={className}> | ||
<Link href={href}> | ||
<a | ||
className={classNames("py-1 mt-2 md:mt-0 md:py-6 md:px-2 pr-1 inline-block font-bold md:font-normal", removeLeftPadding && "pl-0")} | ||
> | ||
<a> | ||
{icon && !mobile && <FontAwesomeIcon icon={icon} size="lg" className="text-primary-dark mr-10" />} | ||
{label} | ||
<span>{label}</span> | ||
</a> | ||
</Link> | ||
</li> | ||
); | ||
))<NavigationRoute>(({ theme, isCurrentRoute }) => ({ | ||
"& a": { | ||
display: "inline-block", | ||
"&:hover": { | ||
background: "#F8F8F8", | ||
}, | ||
}, | ||
"& span": { | ||
display: "inline-block", | ||
[theme.breakpoints.down("md")]: { | ||
paddingTop: theme.spacing(1), | ||
paddingBottom: theme.spacing(1), | ||
marginTop: theme.spacing(2), | ||
paddingRight: theme.spacing(1), | ||
fontWeight: 700, | ||
}, | ||
[theme.breakpoints.up("md")]: { | ||
position: "relative", | ||
paddingTop: theme.spacing(6), | ||
paddingBottom: theme.spacing(6), | ||
marginTop: theme.spacing(0), | ||
paddingLeft: theme.spacing(2), | ||
paddingRight: theme.spacing(2), | ||
fontWeight: isCurrentRoute ? 700 : 400, | ||
"&::after": { | ||
content: "''", | ||
position: "absolute", | ||
width: "2rem", | ||
bottom: "0.75rem", | ||
left: 0, | ||
right: 0, | ||
margin: "auto", | ||
borderBottom: isCurrentRoute ? "3px solid #0064af" : undefined, | ||
}, | ||
}, | ||
}, | ||
})); | ||
|
||
export default HeaderNavigationItem; |
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
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
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