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
}}
>
<Conditional condition={link && clan.bgimage != null}>
<Conditional
condition={link && clan.bgimage != null && clan.bgimage != ""}
>
<div className={styles.headerImage}>
<img
src={clan.bgimage as string}
@ -33,7 +35,7 @@ export default function ClanCard({
</div>
</Conditional>
<div className={styles.horizontal}>
<Conditional condition={clan.pfp != null}>
<Conditional condition={clan.pfp != null && clan.pfp != ""}>
<div className={styles.horizontalLeft}>
<img
src={clan.pfp as string}
@ -87,7 +89,7 @@ export default function ClanCard({
.join(", ")}
</span>
</p>
<Conditional condition={clan.url != null}>
<Conditional condition={clan.url != null && clan.url != ""}>
<p className={globals.iconText}>
<span className={globals.iconSmall}>link</span>
<span className={globals.text}>

View file

@ -59,7 +59,13 @@ export const SubmitClanSchema = yup
.min(1)
.max(20),
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
.tuple([
yup.number().min(0).max(255).required(),
@ -76,9 +82,26 @@ export const SubmitClanSchema = yup
fanfiction: PolicySchema.required()
})
.required(),
pfp: yup.string().notRequired().url(),
bgimage: yup.string().notRequired().url(),
css: yup.string().notRequired(),
pfp: yup
.string()
.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!!")
// flairs: yup.array().of(ClientFlairSchema).required(),
})