Skip to content

Commit

Permalink
Merge branch 'padms/2701' into staging
Browse files Browse the repository at this point in the history
  • Loading branch information
padms committed Jan 21, 2025
2 parents d4194a0 + aff60fc commit 4aa3c9b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { anchor } from '@equinor/eds-icons'
import { EdsIcon } from '../../../icons'
import { AnchorLinkDescription } from '../anchorReferenceField'
import { Rule } from 'sanity'

export type AnchorLinkReference = {
_type: 'anchorLinkReference'
Expand All @@ -16,6 +17,7 @@ export default {
name: 'title',
description: 'Visible title for the anchor link in the list of anchors',
type: 'string',
validation: (Rule: Rule) => Rule.required(),
},
{
name: 'anchorReference',
Expand Down
6 changes: 3 additions & 3 deletions web/sections/AnchorLinkList/AnchorLinkList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const AnchorLinkList = forwardRef<HTMLElement, AnchorLinkListProps>(function Anc
const { title, anchorList = [], columns } = data

const getFlow = () => {
const commonGridStyling = 'grid auto-fill-fr lg:place-items-start'
const commonGridStyling = 'grid lg:place-items-start grid-cols-3'
switch (columns) {
case '3':
return `${commonGridStyling} lg:grid-cols-3`
Expand All @@ -29,7 +29,7 @@ const AnchorLinkList = forwardRef<HTMLElement, AnchorLinkListProps>(function Anc
return `${commonGridStyling} lg:grid-cols-6`
default:
case 'flex':
return 'grid auto-fill-fr justify-start'
return 'grid grid-cols-auto-fill-fr justify-start'
}
}
return (
Expand All @@ -49,7 +49,7 @@ const AnchorLinkList = forwardRef<HTMLElement, AnchorLinkListProps>(function Anc
{anchorList?.map((anchorLink: { id: string; title?: string; anchorReference?: string }) => {
const anchor = anchorLink?.anchorReference ? `#${anchorLink?.anchorReference}` : ''
return (
<li key={`anchor_link_${anchorLink?.id}`} className="w-full flex justify-center">
<li key={`anchor_link_${anchorLink?.id}`} className="w-full flex justify-start">
<ButtonLink variant="ghost" href={anchor} className="w-max text-moss-green-100">
{anchorLink?.title}
</ButtonLink>
Expand Down

0 comments on commit 4aa3c9b

Please sign in to comment.