Fix some stuff

This commit is contained in:
MeowcaTheoRange 2023-09-25 13:48:47 -05:00
parent 0c527f43e2
commit 00eb688c54
2 changed files with 32 additions and 7 deletions

View file

@ -24,7 +24,9 @@ export default function ClanCard({
theme: clan.color ? Color3.fromRGB(...clan.color) : undefined theme: clan.color ? Color3.fromRGB(...clan.color) : undefined
}} }}
> >
<Conditional condition={link && clan.bgimage != null}> <Conditional
condition={link && clan.bgimage != null && clan.bgimage != ""}
>
<div className={styles.headerImage}> <div className={styles.headerImage}>
<img <img
src={clan.bgimage as string} src={clan.bgimage as string}
@ -33,7 +35,7 @@ export default function ClanCard({
</div> </div>
</Conditional> </Conditional>
<div className={styles.horizontal}> <div className={styles.horizontal}>
<Conditional condition={clan.pfp != null}> <Conditional condition={clan.pfp != null && clan.pfp != ""}>
<div className={styles.horizontalLeft}> <div className={styles.horizontalLeft}>
<img <img
src={clan.pfp as string} src={clan.pfp as string}
@ -87,7 +89,7 @@ export default function ClanCard({
.join(", ")} .join(", ")}
</span> </span>
</p> </p>
<Conditional condition={clan.url != null}> <Conditional condition={clan.url != null && clan.url != ""}>
<p className={globals.iconText}> <p className={globals.iconText}>
<span className={globals.iconSmall}>link</span> <span className={globals.iconSmall}>link</span>
<span className={globals.text}> <span className={globals.text}>

View file

@ -59,7 +59,13 @@ export const SubmitClanSchema = yup
.min(1) .min(1)
.max(20), .max(20),
description: yup.string().max(10000).ensure(), description: yup.string().max(10000).ensure(),
url: yup.string().notRequired().url(), url: yup
.string()
.notRequired()
.url()
.transform(v => {
return v.length <= 0 ? undefined : v;
}),
color: yup color: yup
.tuple([ .tuple([
yup.number().min(0).max(255).required(), yup.number().min(0).max(255).required(),
@ -76,9 +82,26 @@ export const SubmitClanSchema = yup
fanfiction: PolicySchema.required() fanfiction: PolicySchema.required()
}) })
.required(), .required(),
pfp: yup.string().notRequired().url(), pfp: yup
bgimage: yup.string().notRequired().url(), .string()
css: yup.string().notRequired(), .notRequired()
.url()
.transform(v => {
return v.length <= 0 ? undefined : v;
}),
bgimage: yup
.string()
.notRequired()
.url()
.transform(v => {
return v.length <= 0 ? undefined : v;
}),
css: yup
.string()
.notRequired()
.transform(v => {
return v.length <= 0 ? undefined : v;
}),
code: yup.string().notRequired().max(256, "Too secure!!") code: yup.string().notRequired().max(256, "Too secure!!")
// flairs: yup.array().of(ClientFlairSchema).required(), // flairs: yup.array().of(ClientFlairSchema).required(),
}) })