Skip to content

Commit

Permalink
Merge pull request #81 from easyops-cn/steve/pre-wrap-desc
Browse files Browse the repository at this point in the history
Set pre-wrap for doc descriptions
  • Loading branch information
weareoutman authored May 15, 2024
2 parents 1169608 + 1ae7f3f commit 9019647
Show file tree
Hide file tree
Showing 8 changed files with 21 additions and 17 deletions.
2 changes: 1 addition & 1 deletion src/components/BrickDocEvents/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export default function BrickDocEvents({
{event.deprecated ? <del>{event.name}</del> : event.name}
</code>
</td>
<td>{event.description}</td>
<td className="pre-wrap">{event.description}</td>
<td>
<MaybeEmptyCode>
{event.detail?.annotation ? (
Expand Down
2 changes: 1 addition & 1 deletion src/components/BrickDocInterface/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ export default function BrickDocInterface({
<td style={{ textAlign: "center" }}>
{item.type === "indexSignature" || item.optional ? "" : "✅"}
</td>
<td>{item.description}</td>
<td className="pre-wrap">{item.description}</td>
</tr>
))}
</tbody>
Expand Down
2 changes: 1 addition & 1 deletion src/components/BrickDocMethods/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export default function BrickDocMethods({
{method.deprecated ? <del>{method.name}</del> : method.name}
</code>
</td>
<td>{method.description}</td>
<td className="pre-wrap">{method.description}</td>
<td>
{method.params.map((param, index, array) => (
<React.Fragment key={index}>
Expand Down
2 changes: 1 addition & 1 deletion src/components/BrickDocParts/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export default function BrickDocParts({
<td>
<code>{part.name}</code>
</td>
<td>{part.description}</td>
<td className="pre-wrap">{part.description}</td>
</tr>
))}
</tbody>
Expand Down
2 changes: 1 addition & 1 deletion src/components/BrickDocProperties/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export default function BrickDocProperties({
{prop.deprecated ? <del>{prop.name}</del> : prop.name}
</code>
</td>
<td>{prop.description}</td>
<td className="pre-wrap">{prop.description}</td>
<td>
<MaybeEmptyCode>
<GeneralType annotation={prop.annotation} />
Expand Down
22 changes: 11 additions & 11 deletions src/components/BrickDocSlots/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ import type { SlotManifest } from "@next-core/brick-manifest";
import MaybeEmptyCode from "@site/src/components/MaybeEmptyCode";

export default function BrickDocSlots({
slots
slots,
}: {
slots: SlotManifest[]
slots: SlotManifest[];
}): JSX.Element {
return (
<table>
Expand All @@ -16,15 +16,15 @@ export default function BrickDocSlots({
</tr>
</thead>
<tbody>
{
slots.map(slot => (
<tr key={slot.name}>
<td><MaybeEmptyCode fallback="(default)">{slot.name}</MaybeEmptyCode></td>
<td>{slot.description}</td>
</tr>
))
}
{slots.map((slot) => (
<tr key={slot.name}>
<td>
<MaybeEmptyCode fallback="(default)">{slot.name}</MaybeEmptyCode>
</td>
<td className="pre-wrap">{slot.description}</td>
</tr>
))}
</tbody>
</table>
)
);
}
2 changes: 1 addition & 1 deletion src/components/ProviderDocParams/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export default function ProviderDocParams({
{param.name}
</code>
</td>
<td>{param.description}</td>
<td className="pre-wrap">{param.description}</td>
<td>
<MaybeEmptyCode>
<GeneralType annotation={param.annotation} />
Expand Down
4 changes: 4 additions & 0 deletions src/css/custom.css
Original file line number Diff line number Diff line change
Expand Up @@ -96,3 +96,7 @@ html[data-theme="dark"] .header-github-link::before {

@media (max-width: 640px) {
}

.pre-wrap {
white-space: pre-wrap;
}

0 comments on commit 9019647

Please sign in to comment.