Skip to content

Commit

Permalink
fix: use size small and use value for language
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffreiffers committed Nov 27, 2023
1 parent 6a96b5e commit 19f8448
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,7 @@ export const ConceptPageClient = ({
};

const handleLanguageChange = (lang) => {
console.log('LANG', lang);
setLanguage(lang);
};

Expand Down Expand Up @@ -489,10 +490,16 @@ export const ConceptPageClient = ({
<div className={classes.languages}>
<ToggleGroup
onChange={handleLanguageChange}
value={languageOptions.find((option) => option.value === language)?.label}
value={language}
size='small'
>
{languageOptions.map((item) => (
<ToggleGroup.Item key={item.value}>{item.label}</ToggleGroup.Item>
<ToggleGroup.Item
key={item.value}
value={item.value}
>
{item.label}
</ToggleGroup.Item>
))}
</ToggleGroup>
</div>
Expand Down Expand Up @@ -610,7 +617,10 @@ export const ConceptPageClient = ({
</InfoCard>

<div className={classes.tabs}>
<Tabs>
<Tabs
defaultValue={localization.comment.comments}
size='small'
>
<Tabs.List>
<Tabs.Tab value={localization.comment.comments}>{localization.comment.comments}</Tabs.Tab>
<Tabs.Tab value={localization.changeHistory}>{localization.changeHistory}</Tabs.Tab>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

.languages {
margin-bottom: 2rem;
width: 450px;
display: inline-block;
}

.status {
Expand Down
5 changes: 3 additions & 2 deletions libs/ui/src/lib/button/button.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
'use client';

import { Button as DigdirButton } from '@digdir/design-system-react';
import { Button as DigdirButton, ButtonProps } from '@digdir/design-system-react';
import cn from './button.module.css';

export const Button = ({ children, ...props }: any) => (
export const Button = ({ children, ...props }: ButtonProps) => (
<DigdirButton
{...props}
className={cn.button}
size={props.size ?? 'small'}
>
{children}
</DigdirButton>
Expand Down

0 comments on commit 19f8448

Please sign in to comment.