Skip to content

Commit 5117353

Browse files
committed
Errors are red
Fixed efficiency tip on tippy popup wrong margin
1 parent 6e8e77f commit 5117353

3 files changed

Lines changed: 22 additions & 14 deletions

File tree

src/components/ClassBuilder.jsx

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -691,7 +691,7 @@ export const HeaderDeclaration = ({ type, name, image, open_source_url }) => {
691691
const class_data = GetClassData(type, name);
692692

693693
if (!class_data)
694-
return "Failed to load class data.";
694+
return <span class="error">Failed to load class '{name}' ({type}) data.</span>;
695695

696696
const is_static = type === "StaticClass" || type === "UtilityClass";
697697

@@ -717,10 +717,10 @@ export const ConstructorDeclaration = ({ type, name }) => {
717717
const class_data = GetClassData(type, name);
718718

719719
if (!class_data)
720-
return "Failed to load constructor data.";
720+
return <span class="error">Failed to load constructor '{name}' ({type}) data.</span>;
721721

722722
return class_data.constructors.map((constructor, index) => {
723-
const id = `constructor-${constructor.name.toLowerCase().replace(' ', '-')}`;
723+
const id = `constructor-${constructor.name.toLowerCase().replaceAll(' ', '-')}`;
724724
const hash_link = `Direct Link to ${constructor.name}`;
725725
return <>
726726
<Heading as="h3" id={id} className="custom-anchor">
@@ -767,7 +767,7 @@ export const InheritedClassFunctions = ({ inherited_class_name, parent_class_nam
767767
const class_data = GetClassData("Class", parent_class_name);
768768

769769
if (!class_data)
770-
return "Failed to load class data.";
770+
return <span class="error">Failed to load inherited class '{parent_class_name}' ({inherited_class_name}) data.</span>;
771771

772772
return (<>
773773
<Details summary={`Inherited ${parent_class_name} ${is_static ? "Static " : ""}Functions`}>
@@ -801,7 +801,7 @@ export const FunctionsDeclaration = ({ type, name }) => {
801801
const class_data = GetClassData(type, name);
802802

803803
if (!class_data)
804-
return "Failed to load class data.";
804+
return <span class="error">Failed to load class '{name}' ({type}) data.</span>;
805805

806806
return (<>
807807
{ class_data.inheritance && !class_data.is_base ? <>
@@ -835,7 +835,7 @@ export const StaticFunctionsDeclaration = ({ type, name }) => {
835835
const class_data = GetClassData(type, name);
836836

837837
if (!class_data)
838-
return "Failed to load class data.";
838+
return <span class="error">Failed to load class '{name}' ({type}) data.</span>;
839839

840840
return (<>
841841
{ class_data.inheritance && !class_data.is_base ? <>
@@ -859,7 +859,7 @@ export const ExamplesDeclaration = ({ type, name }) => {
859859
const class_data = GetClassData(type, name);
860860

861861
if (!class_data)
862-
return "Failed to load class data.";
862+
return <span class="error">Failed to load class '{name}' ({type}) data.</span>;
863863

864864
return <>
865865
{ class_data.static_functions && class_data.static_functions.map((value) =>
@@ -879,7 +879,7 @@ export const EventsDeclaration = ({ type, name }) => {
879879
const class_data = GetClassData(type, name);
880880

881881
if (!class_data)
882-
return "Failed to load class data.";
882+
return <span class="error">Failed to load class '{name}' ({type}) data.</span>;
883883

884884
return (<>
885885
{ class_data.inheritance && !class_data.is_base ? <>
@@ -911,7 +911,7 @@ export const PropertiesDeclaration = ({ type, name }) => {
911911
const class_data = GetClassData(type, name);
912912

913913
if (!class_data)
914-
return "Failed to load class data.";
914+
return <span class="error">Failed to load class '{name}' ({type}) data.</span>;
915915

916916
return (<>
917917
{
@@ -945,7 +945,7 @@ export const StaticPropertiesDeclaration = ({ type, name }) => {
945945
const class_data = GetClassData(type, name);
946946

947947
if (!class_data)
948-
return "Failed to load class data.";
948+
return <span class="error">Failed to load class '{name}' ({type}) data.</span>;
949949

950950
return (<>
951951
{
@@ -995,7 +995,7 @@ export const MethodReference = ({ type, class_name, method_name = null, static_m
995995
const class_data = GetClassData(type, class_name);
996996

997997
if (!class_data)
998-
return "Failed to load method data.";
998+
return <span class="error">Failed to load method {method_name || static_method_name} ({class_name}) data.</span>;
999999

10001000
const is_base = class_data.is_base ? true : false;
10011001
const is_static = type === "StaticClass" || type === "UtilityClass";
@@ -1021,12 +1021,12 @@ export const EventReference = ({ type, class_name, event, show_class_name = fals
10211021
const class_data = GetClassData(type, class_name);
10221022

10231023
if (!class_data)
1024-
return "Failed to load event data.";
1024+
return <span class="error">Failed to load event '{event}' ({class_name}) data.</span>;
10251025

10261026
const event_data = class_data.events.find(({ name }) => name === event);
10271027

10281028
if (!event_data)
1029-
return "Failed to load event data.";
1029+
return <span class="error">Failed to load event '{event}' ({class_name}) data.</span>;
10301030

10311031
const is_base = class_data.is_base ? true : false;
10321032

src/css/custom.css

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -424,6 +424,10 @@ html[data-theme='dark'] .header-account-link:before {
424424
background: no-repeat center/26px url("/img/social/account-white.svg");
425425
}
426426

427+
span.error {
428+
color: red;
429+
}
430+
427431
/* Header Chips */
428432

429433
.header-chips {
@@ -550,6 +554,10 @@ h3 > .native-type {
550554
opacity: 0.9;
551555
}
552556

557+
.tippy-box .efficiency-chip {
558+
margin-top: 0;
559+
}
560+
553561
@media (max-width: 576px) {
554562
.efficiency-chip {
555563
float: none;

0 commit comments

Comments
 (0)