1
mirror of https://github.com/jakejarvis/jarv.is.git synced 2025-07-19 20:45:31 -04:00

all components should accept additional classnames

This commit is contained in:
2022-01-20 12:06:05 -05:00
parent 2162e9d563
commit 7e37adabc1
22 changed files with 150 additions and 86 deletions

View File

@@ -1,4 +1,5 @@
import { memo } from "react";
import classNames from "classnames";
import styles from "./Loading.module.css";
@@ -6,9 +7,10 @@ type Props = {
width: number; // of entire container, in pixels
boxes?: number; // total number of boxes (default: 3)
timing?: number; // staggered timing between each box's pulse, in seconds (default: 0.1s)
className?: string;
};
const Loading = ({ width, boxes = 3, timing = 0.1 }: Props) => {
const Loading = ({ width, boxes = 3, timing = 0.1, className }: Props) => {
// each box is just an empty div
const divs = [];
@@ -30,7 +32,7 @@ const Loading = ({ width, boxes = 3, timing = 0.1 }: Props) => {
return (
<div
className={styles.wrapper}
className={classNames(styles.wrapper, className)}
style={{
width: `${width}px`,
height: `${width / 2}px`,