Skip to content
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
Expand Up @@ -54,7 +54,7 @@ const ProjectShowcasePage: FC = () => {
const [selectedIndustries, setSelectedIndustries] = useState<InputMultiselectOption[]>([])
const [selectedCategories, setSelectedCategories] = useState<InputMultiselectOption[]>([])
const [page, setPage] = useState(1)
const sortBy = 'createdAt'
const sortBy = 'publishedAt'
const [sortOrder, setSortOrder] = useState<'asc' | 'desc'>('desc')
const hasFiltersApplied = useMemo(() => (
!!keyword.trim() || selectedIndustries.length > 0 || selectedCategories.length > 0
Expand Down Expand Up @@ -136,7 +136,7 @@ const ProjectShowcasePage: FC = () => {
'work/project-showcase-posts',
filters.projectId || '',
filters.keyword || '',
'',
'PUBLISHED',
filters.industryId || '',
filters.categoryId || '',
String(nextPage),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,27 @@
&:hover {
text-decoration: underline;
}

&[target] {
&::after {
content: "";
-webkit-mask-size: "cover";
mask-size: "cover";
-webkit-mask-image: url(../../../lib/assets/external-link.svg);
mask-image: url(../../../lib/assets/external-link.svg);
-webkit-mask-repeat: no-repeat;
mask-repeat: no-repeat;
-webkit-mask-position: center;
mask-position: center;
-webkit-mask-size: 12px 12px;
mask-size: 12px 12px;
width: 12px;
height: 12px;
display: inline-block;
background-color: currentColor;
margin-left: $sp-1;
}
}
}

h1,
Expand All @@ -179,8 +200,9 @@
h6 {
color: $black-100;
margin: 0 0 16px;
font-weight: 700;
font-weight: 600;
text-transform: uppercase;
font-family: $font-barlow;
}

h1 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ const ShowcasePostMedia: FC<ShowcasePostMediaProps> = props => {
type='button'
className={styles.mediaButton}
aria-label={`Open gallery item ${index + 1}`}
title={mediaAsset.alt}
>
{isImage && (
<img
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,7 @@ const ShowcasePostMediaGallery: FC<ShowcasePostMediaGalleryProps> = props => {
key={thumbAsset.id}
className={classNames(styles.mediaItem, currentIndex === index && styles.active)}
onClick={function setCurrent() { setCurrentIndex(index) }}
title={thumbAsset.alt}
>
{isImage && (
<img
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@ interface ProjectShowcasePostFormData {
media: Array<{
type: string
url: string
alt?: string
}>
}

Expand All @@ -191,6 +192,7 @@ function mapPostToFormData(post?: ProjectShowcasePost): ProjectShowcasePostFormD
content: post?.content || '',
industryIds: post?.industries.map(item => item.id) || [],
media: post?.media?.map(item => ({
alt: item.alt,
type: item.type,
url: item.url,
})) || [],
Expand Down Expand Up @@ -693,7 +695,7 @@ export const ProjectShowcasePage: FC = () => {
)

const saveUploadedMedia = useCallback(
async (updatedMedia: Array<{ type: string; url: string }>) => {
async (updatedMedia: Array<{ type: string; url: string; alt?: string }>) => {
if (!projectId || !selectedPostId) {
return
}
Expand All @@ -705,6 +707,7 @@ export const ProjectShowcasePage: FC = () => {
})
await updatePostInCache(updatedPost)
setValue('media', (updatedPost.media ?? []).map(m => ({
alt: m.alt,
type: m.type,
url: m.url,
})))
Expand Down
7 changes: 7 additions & 0 deletions src/libs/shared/lib/utils/rich-text.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,11 @@ describe('rich-text utils', () => {
expect(rendered)
.toContain('rel="noopener noreferrer"')
})

it('supports markdown strikethrough markup', () => {
const rendered = renderRichTextToHtml('~~deleted~~')

expect(rendered)
.toContain('<del>deleted</del>')
})
})
1 change: 1 addition & 0 deletions src/libs/shared/lib/utils/rich-text.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ const RICH_TEXT_ALLOWED_TAGS = [
'blockquote',
'br',
'code',
'del',
'div',
'em',
'h1',
Expand Down
Loading