Skip to content

Commit

Permalink
Merge pull request #190 from element-hq/florianduros/fix/spinner
Browse files Browse the repository at this point in the history
InlineSpinner: fix forward ref
  • Loading branch information
florianduros authored Jun 20, 2024
2 parents 8550f5d + 7aa4bc6 commit 1633220
Showing 1 changed file with 11 additions and 12 deletions.
23 changes: 11 additions & 12 deletions src/components/InlineSpinner/InlineSpinner.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,20 @@ See the License for the specific language governing permissions and
limitations under the License.
*/

import React, { forwardRef } from "react";
import React, { SVGAttributes } from "react";
import styles from "./InlineSpinner.module.css";
import SpinnerIcon from "@vector-im/compound-design-tokens/icons/spinner.svg";

type InlineSpinnerProps = {
size?: number;
} & React.HTMLAttributes<HTMLDivElement>;
} & SVGAttributes<SVGElement>;

export const InlineSpinner = forwardRef<HTMLDivElement, InlineSpinnerProps>(
function InlineSpinner({ size = 20 }: InlineSpinnerProps) {
return (
<SpinnerIcon
className={styles.icon}
style={{ width: size, height: size }}
/>
);
},
);
export function InlineSpinner({ size = 20, ...props }: InlineSpinnerProps) {
return (
<SpinnerIcon
className={styles.icon}
style={{ width: size, height: size }}
{...props}
/>
);
}

0 comments on commit 1633220

Please sign in to comment.