-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
acc8276
commit 9652402
Showing
10 changed files
with
137 additions
and
74 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
import { ImageWithAlt } from './imageWithAlt' | ||
import type { Reference } from 'sanity' | ||
import { Rule } from 'sanity' | ||
|
||
|
||
export type CarouselImage = { | ||
_type: 'carouselImage' | ||
image: ImageWithAlt | ||
captionPositionUnderImage?: boolean | ||
action?: Reference[] | ||
} | ||
|
||
export default { | ||
name: 'carouselImage', | ||
title: 'Image with options', | ||
type: 'object', | ||
options: { | ||
collapsed: false, | ||
}, | ||
fields: [ | ||
{ | ||
name: 'image', | ||
title: 'Image with alt', | ||
type: 'imageWithAlt', | ||
}, | ||
{ | ||
name: 'caption', | ||
title: 'Image caption', | ||
type: 'string', | ||
}, | ||
{ | ||
name: 'attribution', | ||
title: 'Credit', | ||
type: 'string', | ||
}, | ||
{ | ||
type: 'boolean', | ||
name: 'captionPositionUnderImage', | ||
title: 'Position caption and credit under image', | ||
description: 'Toggle to display caption and credit under the image.', | ||
initialValue: false, | ||
}, | ||
{ | ||
name: 'action', | ||
title: 'Link', | ||
type: 'array', | ||
of: [{ type: 'linkSelector', title: 'Link' }], | ||
description: 'Optional link associated with the image.', | ||
validation: (Rule: Rule) => Rule.max(1).error('Only one action is permitted'), | ||
}, | ||
], | ||
preview: { | ||
select: { | ||
imageUrl: 'image.asset.url', | ||
alt: 'image.alt', | ||
caption: 'caption', | ||
}, | ||
prepare({ imageUrl, caption, alt }: { imageUrl: string; alt: string; caption: string }) { | ||
return { | ||
title: alt || 'No alt text', | ||
subtitle: caption || 'No caption', | ||
media: <img src={imageUrl} alt={alt} style={{ height: '100%' }} />, | ||
} | ||
}, | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 0 additions & 28 deletions
28
web/pageComponents/shared/search/pagination/PaginationItem.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters