added generic types on props, tweaked nav and footer coloring
This commit is contained in:
parent
4682b90711
commit
fcf2179001
6 changed files with 95 additions and 28 deletions
|
@ -6,7 +6,7 @@ import type {
|
|||
} from "@config/io/types";
|
||||
import { Tag, Flag } from "@icons";
|
||||
|
||||
import TypeDetails from "./TypeDetails.astro"
|
||||
import TypeDetails from "./TypeDetails.astro";
|
||||
|
||||
export interface Props {
|
||||
propsKeys: string[];
|
||||
|
@ -21,14 +21,20 @@ const { propsKeys, propsData } = Astro.props;
|
|||
const propData = propsData[item]
|
||||
let typeLink:string;
|
||||
let linkText:string;
|
||||
let genericType:string|undefined;
|
||||
let genericTypeLink:string|undefined;
|
||||
const gadget = propData.type.gadget;
|
||||
if (gadget) {
|
||||
typeLink = "#"
|
||||
linkText = `[${Object.keys(gadget).toString()}]`
|
||||
} else {
|
||||
typeLink = getQMLTypeLink(propData.type as unknown as QMLTypeLinkObject)
|
||||
typeLink = getQMLTypeLink(propData.type)
|
||||
linkText = propData.type.name || propData.type.type
|
||||
}
|
||||
if (propData.type.of) {
|
||||
genericType = propData.type.of.name;
|
||||
genericTypeLink = getQMLTypeLink(propData.type.of)
|
||||
}
|
||||
return (
|
||||
<li id={ item } class="typedata-root typeprop-root">
|
||||
<p class="typedata-name typeprop-name">
|
||||
|
@ -36,7 +42,7 @@ const { propsKeys, propsData } = Astro.props;
|
|||
{ item }<span class="type-datatype">: <a
|
||||
href={typeLink}
|
||||
target="_blank"
|
||||
>{ linkText }</a></span>
|
||||
>{ linkText }</a>{genericType && (<a href={genericTypeLink} class="type-datatype generic-type"><{genericType}></a>)}</span>
|
||||
</p>
|
||||
{
|
||||
propData.flags && propData.flags.length > 0 ? (
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue