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
38 changes: 19 additions & 19 deletions app/[filename]/ServerRulePage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,26 +39,8 @@ export default function ServerRulePage({ serverRulePageProps, tinaProps }: Serve

<div className="layout-two-columns">
<Card dropShadow className="layout-main-section p-6">
<div className="flex border-b-2">
{rule?.thumbnail && (
<div className="w-[175px] h-[175px] relative mr-4">
<Image src={rule.thumbnail} alt="thumbnail image for the rule" fill className="object-cover object-center" />
</div>
)}
<div className="flex flex-col flex-1 justify-between">
<h1 className="text-ssw-red text-4xl leading-[1.2] my-0 b-4 font-semibold" data-tina-field={tinaField(rule, "title")}>
{rule?.title}
</h1>

<div className="flex justify-between my-2 flex-col md:flex-row">
<GitHubMetadata owner="SSWConsulting" repo="SSW.Rules.Content" path={rule?.id} className="mt-2" />
<RuleActionButtons rule={rule} />
</div>
</div>
</div>

{rule?.isArchived && rule?.archivedreason && (
<div className="mt-8 bg-red-50 border border-red-200 rounded-lg p-4">
<div className="mb-8 bg-red-50 border border-red-200 rounded-lg p-4">
<div className="flex items-start gap-3">
<div className="shrink-0">
<svg className="h-5 w-5 text-ssw-red" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true">
Expand All @@ -85,6 +67,24 @@ export default function ServerRulePage({ serverRulePageProps, tinaProps }: Serve
</div>
)}

<div className="flex border-b-2">
{rule?.thumbnail && (
<div className="w-[175px] h-[175px] relative mr-4">
<Image src={rule.thumbnail} alt="thumbnail image for the rule" fill className="object-cover object-center" />
</div>
)}
<div className="flex flex-col flex-1 justify-between">
<h1 className="text-ssw-red text-4xl leading-[1.2] my-0 b-4 font-semibold" data-tina-field={tinaField(rule, "title")}>
{rule?.title}
</h1>

<div className="flex justify-between my-2 flex-col md:flex-row">
<GitHubMetadata owner="SSWConsulting" repo="SSW.Rules.Content" path={rule?.id} className="mt-2" />
<RuleActionButtons rule={rule} />
</div>
</div>
</div>

<div className="mt-8 rule-content" data-tina-field={tinaField(rule, "body")}>
<TinaMarkdown content={rule?.body} components={getMarkdownComponentMapping(true)} />
</div>
Expand Down
7 changes: 4 additions & 3 deletions components/rule-list/rule-list-item.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,8 @@ const RuleListItem: React.FC<RuleListItemProps> = ({ rule, index, filter, onBook

return (
<li key={index} className="p-4 border rounded shadow">
<RuleListItemHeader rule={rule} index={index} />

{rule.isArchived && rule.archivedreason && (
<div className="mx-2 my-4 md:mx-6 md:my-4 bg-red-50 border border-red-200 rounded-lg p-4">
<div className="mx-2 mb-4 md:mx-6 md:mb-4 bg-red-50 border border-red-200 rounded-lg p-4">
<div className="flex items-start gap-3">
<div className="shrink-0">
<svg className="h-5 w-5 text-ssw-red" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true">
Expand All @@ -71,6 +69,9 @@ const RuleListItem: React.FC<RuleListItemProps> = ({ rule, index, filter, onBook
</div>
</div>
)}

<RuleListItemHeader rule={rule} index={index} />

{filter !== RuleListFilter.TitleOnly && (
<div data-tina-field={tinaField(rule, "body")} className="pt-4 pl-8 pr-2" ref={contentRef}>
<TinaMarkdown content={getContentForViewStyle(filter, rule.body)} components={MarkdownComponentMapping} />
Expand Down