Skip to content

Commit

Permalink
πŸ’„ Fix styles for mobile #2701 (#2720)
Browse files Browse the repository at this point in the history
* πŸ’„ Fix styles for mobile #2701

* Replace in config #2720

* πŸ’„  Fix style #2701

* πŸ’„ Adjust text alignment #2720

* πŸ› Made link title required #2701
  • Loading branch information
padms authored Jan 24, 2025
1 parent 431b6fc commit b7d9836
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 b7d9836

Please sign in to comment.