Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(web): Districts slice - text wrap and style changes #16221

Merged
merged 3 commits into from
Oct 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { style } from '@vanilla-extract/css'

import { themeUtils } from '@island.is/island-ui/theme'

export const districtsList = style({
Expand All @@ -18,3 +19,8 @@ export const districtsList = style({
},
}),
})

export const districtsListItem = style({
breakInside: 'avoid',
display: 'block',
})
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export const DistrictsSlice: React.FC<React.PropsWithChildren<SliceProps>> = ({
</GridColumn>
</GridRow>
<GridRow>
<GridColumn span={['10/10', '10/10', '5/10']}>
<GridColumn span={['10/10', '10/10', '10/10', '10/10', '5/10']}>
{slice.description && (
<Box paddingRight={[0, 0, 6]}>
<Text marginTop={3}>{slice.description}</Text>
Expand All @@ -50,7 +50,12 @@ export const DistrictsSlice: React.FC<React.PropsWithChildren<SliceProps>> = ({
className={styles.districtsList}
>
{slice.links.map((link, index) => (
<Box component="li" key={index} marginBottom={4}>
<Box
component="li"
key={index}
marginBottom={4}
className={styles.districtsListItem}
>
<Link href={link.url}>
<Button variant="text" as="span">
{link.text}
Expand All @@ -61,7 +66,7 @@ export const DistrictsSlice: React.FC<React.PropsWithChildren<SliceProps>> = ({
</Box>
</GridColumn>
{!!slice.image && (
<GridColumn span={['10/10', '10/10', '5/10']}>
<GridColumn span={['10/10', '10/10', '10/10', '10/10', '5/10']}>
{slice.image.url.split('.').pop() === 'svg' ? (
<object data={slice.image.url} type="image/svg+xml">
<img src={slice.image.url} alt="" />
Expand Down