-
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.
Merge pull request #203 from Amsterdam/fix/ads-header-update
ADS packages update & Header menu change
- Loading branch information
Showing
24 changed files
with
243 additions
and
165 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
{ | ||
"semi": false, | ||
"trailingComma" : "none" | ||
"trailingComma": "none", | ||
"bracketSpacing": true | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
.header { | ||
h1 { | ||
font-size: var(--ams-text-level-4-font-size); | ||
} | ||
|
||
div:first-child { | ||
container-type: inline-size; | ||
container-name: branding; | ||
} | ||
|
||
@container (max-width: 36rem) { | ||
div:first-child > a { | ||
max-inline-size: 12px; | ||
} | ||
div:first-child > a svg path:nth-child(1) { | ||
opacity: 0; | ||
} | ||
} | ||
} |
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,17 @@ | ||
import { Grid } from "@amsterdam/design-system-react" | ||
|
||
type Props = { | ||
children: React.ReactNode[] | ||
} | ||
|
||
export const PageGrid: React.FC<Props> = ({ children }) => ( | ||
<Grid> | ||
{ children.map((child, index) => ( | ||
<Grid.Cell key={ index } span="all"> | ||
{ child } | ||
</Grid.Cell> | ||
)) } | ||
</Grid> | ||
) | ||
|
||
export default PageGrid |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,26 @@ | ||
import styled from "styled-components" | ||
import { Icon } from "@amsterdam/design-system-react" | ||
import { Header, Icon } from "@amsterdam/design-system-react" | ||
import { PersonalLoginIcon } from "@amsterdam/design-system-react-icons" | ||
import { useAuth } from "react-oidc-context" | ||
import { useNavigate } from "react-router-dom" | ||
import { useDecodedToken } from "app/hooks" | ||
|
||
const Wrapper = styled.div` | ||
display: flex; | ||
align-items: center; | ||
` | ||
|
||
const StyledIcon = styled(Icon)` | ||
margin-right: 0.5rem; | ||
` | ||
import { useNavigate } from "react-router-dom" | ||
import { useDecodedToken } from "app/hooks" | ||
|
||
export const User: React.FC = () => { | ||
const auth = useAuth() | ||
const decodedToken = useDecodedToken() | ||
const navigate = useNavigate() | ||
|
||
return auth.isAuthenticated ? ( | ||
<Wrapper onClick={() => navigate("/auth")} > | ||
<StyledIcon | ||
<Header.MenuLink onClick={() => navigate("/auth")} fixed> | ||
{decodedToken?.given_name} | ||
<Icon | ||
style={{ paddingInlineStart: ".5rem ", blockSize: ".8em" }} | ||
size="level-5" | ||
svg={ PersonalLoginIcon } | ||
svg={PersonalLoginIcon} | ||
/> | ||
{ decodedToken?.given_name } | ||
</Wrapper> | ||
) : <></> | ||
</Header.MenuLink> | ||
) : ( | ||
<></> | ||
) | ||
} | ||
|
||
export default User |
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
Oops, something went wrong.