Skip to content

Commit

Permalink
feat(edit): styled floating buttons (#1113)
Browse files Browse the repository at this point in the history
* chore(edit): removed unused imports

* fix(edit): made floating button have same font-size and font-weight

* fix(edit): added aria label to save button
  • Loading branch information
vildeopp authored and SharmaTarun1111111 committed Jul 11, 2023
1 parent 7d92cbe commit 0cb4ad7
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 9 deletions.
4 changes: 2 additions & 2 deletions next-tavla/src/Admin/components/StyledLink/styles.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
justify-content: center;
gap: 0.5rem;
color: var(--main-background-color);
background-color: var(--primary-button-color);
border-radius: 0.25rem;
background-color: var(--colors-brand-white);
border-radius: 1.5rem;
width: max-content;
padding: 1rem;
text-decoration: none;
Expand Down
10 changes: 6 additions & 4 deletions next-tavla/src/Admin/scenarios/Edit/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { SettingsDispatchContext } from 'Admin/utils/contexts'
import { settingsReducer } from './reducer'
import { ToastProvider } from '@entur/alert'
import { CopyText } from 'Admin/components/CopyText'
import { PrimaryButton } from '@entur/button'
import { FloatingButton } from '@entur/button'
import { StyledLink } from 'Admin/components/StyledLink'

function Edit({
Expand All @@ -32,14 +32,16 @@ function Edit({
<TilesSettings tiles={settings.tiles} />
<CopyText text={linkUrl} toastText="Kopiert lenke" />
<div className={classes.floatingButtonWrapper}>
<PrimaryButton
<FloatingButton
className={classes.saveButton}
size="medium"
aria-label={'Lagre instillinger'}
onClick={() => {
setBoardSettings(documentId, settings)
}}
>
Lagre instillinger
</PrimaryButton>
Lagre innstillinger
</FloatingButton>
<StyledLink
linkUrl={'/' + documentId}
text="Se avgangstavla"
Expand Down
7 changes: 4 additions & 3 deletions next-tavla/src/Admin/scenarios/Edit/styles.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,11 @@
flex-direction: row;
gap: 1em;
position: fixed;
bottom: 10px;
right: 10px;
bottom: 1em;
right: 1em;
}

.saveButton {
width: max-content;
font-size: 1em;
font-weight: 400;
}

0 comments on commit 0cb4ad7

Please sign in to comment.