Skip to content

Commit

Permalink
Naviger til soek
Browse files Browse the repository at this point in the history
  • Loading branch information
betsytraran committed May 22, 2024
1 parent 3f08608 commit 88e9cbd
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,15 @@ const initialState = {

const NavigateButton = styled(Button)`
position: sticky;
top: 10px;
//padding-bottom: 30px;
top: ${(props) => (props.className === 'gaa-til-soek' ? '75px' : '10px')};
width: 80px;
transform: translateX(-120%);
display: grid;
&& {
svg {
width: 50px;
height: 50px;
width: 45px;
height: 45px;
margin: 0 auto 5px auto;
}
}
Expand Down Expand Up @@ -91,8 +90,8 @@ export default () => {
})
}

const navigateToTreff = () => {
const treff = document.getElementById('treff')?.offsetTop
const navigateTo = (element: string) => {
const treff = document.getElementById(element)?.offsetTop
window.scrollTo({ top: treff, behavior: 'smooth' })
}

Expand All @@ -101,8 +100,12 @@ export default () => {
<div className="flexbox--align-center--justify-start">
<Title title="Søk etter personer i Tenor" />
</div>
<div className="flexbox--flex-wrap">
<NavigateButton onClick={() => navigateToTreff()} kind="chevron-down-double-circle">
<div className="flexbox--flex-wrap" id="soek">
<NavigateButton
className="gaa-til-treff"
onClick={() => navigateTo('treff')}
kind="chevron-down-double-circle"
>
GÅ TIL TREFF
</NavigateButton>
<SoekForm
Expand All @@ -112,6 +115,13 @@ export default () => {
/>
</div>
<div id="treff">
<NavigateButton
className="gaa-til-soek"
onClick={() => navigateTo('soek')}
kind="chevron-up-double-circle"
>
GÅ TIL SØK
</NavigateButton>
<TreffListe
response={response?.data}
personListe={state.personListe}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ export const TreffListe = ({
const antallTreff = localStorage['antallTreff']

return (
<div className="flexbox--flex-wrap">
<div className="flexbox--flex-wrap" style={{ marginTop: '-70px' }}>
<div
className="flexbox--full-width"
style={{ marginBottom: '20px', position: 'sticky', top: '10px', zIndex: 1 }}
Expand Down

0 comments on commit 88e9cbd

Please sign in to comment.