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 @@ -141,6 +141,62 @@
&:hover {
text-decoration: underline;
}

&[target] {
&::after {
content: "";
-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;
-webkit-mask-image: url(./assets/external-link.svg);
mask-image: url(./assets/external-link.svg);
width: 12px;
height: 12px;
display: inline-block;
background-color: currentColor;
margin-left: $sp-1;
}
}
}

table {
display: block;
overflow-x: auto;
max-width: 100%;
border-collapse: collapse;
}

th,
td {
border: 1px solid $black-20;
padding: 10px;
text-align: left;
vertical-align: top;
}

pre {
background: $black-10;
border-radius: 8px;
padding: 16px;
overflow-x: auto;
white-space: pre-wrap;
word-break: break-word;
}

code {
background: $black-10;
border-radius: 4px;
padding: 2px 4px;
}

blockquote {
border-left: 4px solid $black-20;
color: $black-80;
padding-left: 16px;
margin: 0;
}
}

Expand Down Expand Up @@ -244,15 +300,14 @@
}

.challengeTitle {
color: $black-100;
color: $link-blue-dark;
font-family: Roboto;
font-size: 16px;
font-weight: 500;
line-height: 24px;
text-decoration: none;

&:hover {
color: $link-blue-dark;
text-decoration: none;
}
}
Expand All @@ -268,12 +323,28 @@
display: flex;
flex-wrap: wrap;
align-items: center;
gap: 8px;
color: $black-80;
font-family: Roboto;
font-size: 14px;
font-weight: 400;
line-height: 22px;
min-width: 220px;

span {
display: flex;
align-items: center;
}
}

.statSeparator::before {
display: block;
content: "";
border-radius: 50%;
width: 3px;
height: 3px;
background: url('data:image/svg+xml,<svg width="3" height="3" viewBox="0 0 3 3" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M0 1.36035C0 0.963867 0.125326 0.638021 0.375977 0.382812C0.631185 0.127604 0.968424 0 1.3877 0C1.80241 0 2.13965 0.125326 2.39941 0.375977C2.65918 0.62207 2.78906 0.957031 2.78906 1.38086V1.63379C2.78906 2.03027 2.66374 2.35384 2.41309 2.60449C2.16243 2.85514 1.82292 2.98047 1.39453 2.98047C0.970703 2.98047 0.631185 2.85514 0.375977 2.60449C0.125326 2.34928 0 2.02116 0 1.62012V1.36035Z" fill="%23555555"/></svg>') center no-repeat;
margin-left: 8px;
margin-right: 8px;
}

.challengeViewLink {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ const ShowcasePostPreview: FC<ShowcasePostPreviewProps> = props => {
</span>
)}
{typeof challenge.numOfRegistrants === 'number' && (
<span>
<span className={styles.statSeparator}>
{challenge.numOfRegistrants}
{' '}
registrants
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -880,6 +880,41 @@ export const ProjectShowcasePage: FC = () => {
selectedChallengeOptions,
])

const handlePreviewListPost = useCallback(async (post: ProjectShowcasePost) => {
if (!projectId) {
return
}

setIsLoadingPreview(true)
setIsPreviewModalOpen(true)

try {
const postDetails = await fetchProjectShowcasePost(projectId, post.id)
const builtPreview = await buildShowcasePreviewData({
categoryOptions: categoryOptions.slice(1),
challengeOptions: [],
editingPost: postDetails,
formData: mapPostToFormData(postDetails),
industryOptions: industryOptions.slice(1),
manageMode: 'edit',
projectId,
projectTitle: postDetails.projectTitle || projectResult.project?.name || 'Project',
})
setPreviewData(builtPreview)
} catch (err) {
showErrorToast(err instanceof Error ? err.message : 'Unable to load post preview.')
setIsPreviewModalOpen(false)
setPreviewData(undefined)
} finally {
setIsLoadingPreview(false)
}
}, [
categoryOptions,
industryOptions,
projectId,
projectResult.project?.name,
])

const updatePostInCache = useCallback(
async (updatedPost: ProjectShowcasePost) => {
await postsResult.mutate(currentData => {
Expand Down Expand Up @@ -1335,6 +1370,17 @@ export const ProjectShowcasePage: FC = () => {
<td className={styles.rowActions}>
{canManageProjectShowcasePosts && (
<>
<button
type='button'
className={styles.actionButton}
disabled={isLoadingPreview}
onClick={function onClick() {
handlePreviewListPost(post)
.catch(() => undefined)
}}
>
Preview
</button>
{post.status !== 'ARCHIVED' && (
<button
type='button'
Expand Down
Loading