This repository has been archived by the owner on Mar 27, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
make everything lazy loading and resized a lot of images
- Loading branch information
Showing
19 changed files
with
52 additions
and
40 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
interface ImageProps extends React.ImgHTMLAttributes<HTMLImageElement> { | ||
class?: string; | ||
} | ||
|
||
const Image: React.FC<ImageProps> = ({ class: classProp, className, style, ...props }) => { | ||
const classes = className || classProp; | ||
return <img className={classes} style={style} {...props} loading="lazy" />; | ||
}; | ||
|
||
export default Image; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,34 @@ | ||
import { downloadImageUser } from "@/supabase" | ||
import { downloadImageUser } from "@/supabase"; | ||
import BioCheck from "./bio"; | ||
import type { ServerDataItem } from "@/server_types"; | ||
import * as lucide from "lucide-react"; | ||
import Image from "@/components/Image"; | ||
|
||
interface Props { | ||
user: ServerDataItem; | ||
textColorSolid: string; | ||
} | ||
const BioBlock: React.FC<Props> = ({ user, textColorSolid }) => { | ||
return ( | ||
<div className="flex flex-col justify-center items-center"> | ||
<img src={downloadImageUser(user.pic)} className={"w-44 h-44 object-cover mask " + user.design.profile_pic_shape} /> | ||
<Image src={downloadImageUser(user.pic)} className={"w-44 h-44 object-cover mask " + user.design.profile_pic_shape} /> | ||
<div className="flex items-center mx-auto text-center"> | ||
<h2 className="flex items-center text-4xl font-black" style={{ color: textColorSolid }}> | ||
{user.displayname} | ||
{ | ||
user.account_type == "premium" && ( | ||
<div className="tooltip" data-tip="Premium"> | ||
<lucide.BadgeCheck className="ml-1" /> | ||
</div> | ||
) | ||
} | ||
{ | ||
user.account_type == "staff" && ( | ||
<div className="tooltip tooltip-primary tooltip-left z-50" data-tip="Staff"> | ||
<lucide.ShieldCheck className="ml-1" /> | ||
</div> | ||
) | ||
} | ||
{user.account_type == "premium" && ( | ||
<div className="tooltip" data-tip="Premium"> | ||
<lucide.BadgeCheck className="ml-1" /> | ||
</div> | ||
)} | ||
{user.account_type == "staff" && ( | ||
<div className="tooltip tooltip-primary tooltip-left z-50" data-tip="Staff"> | ||
<lucide.ShieldCheck className="ml-1" /> | ||
</div> | ||
)} | ||
</h2> | ||
</div> | ||
<BioCheck color={textColorSolid} bio={user?.bio || ""} /> | ||
</div> | ||
) | ||
} | ||
); | ||
}; | ||
export default BioBlock; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters