Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
underbluewaters committed Jan 28, 2025
1 parent ea4b55a commit 7e51f17
Show file tree
Hide file tree
Showing 13 changed files with 292 additions and 324 deletions.
13 changes: 10 additions & 3 deletions packages/client/src/admin/users/ProfilePhoto.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { Maybe } from "graphql/jsutils/Maybe";
import React from "react";
import Gravatar from "react-gravatar";
import md5 from "md5";
import clsx from "clsx";

// const supportsSrcSet = "srcset" in document.createElement("img");

Expand Down Expand Up @@ -33,9 +34,15 @@ export default function ProfilePhoto({
: `url("http://www.gravatar.com/avatar/${hash}?d=retro&r=g&s=200")`;
return (
<div
className={`w-full h-full inline-block ${
square ? "rounded-sm" : "rounded-full"
} ${border ? "border-2 shadow bg-white border-white" : ""}`}
role="img"
aria-label={
fullname || email || canonicalEmail ? "User photo" : undefined
}
className={clsx(
`w-full h-full inline-block`,
square ? "rounded-sm" : "rounded-full",
border ? "border-2 shadow bg-white border-white" : ""
)}
style={{
backgroundImage: bg,
backgroundSize: "cover",
Expand Down
10 changes: 9 additions & 1 deletion packages/client/src/components/Button.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
// import Color from "color";
import React, { CSSProperties, useState, useEffect } from "react";
import React, {
CSSProperties,
useState,
useEffect,
DetailedHTMLProps,
ButtonHTMLAttributes,
} from "react";
import { Link, useHistory } from "react-router-dom";
import { colord } from "colord";
import { ChevronDownIcon } from "@heroicons/react/outline";
Expand Down Expand Up @@ -39,6 +45,7 @@ export interface ButtonProps {
segmentItems?: string[];
onSegmentClick?: (index: number) => void;
"data-cy"?: string;
buttonProps?: ButtonHTMLAttributes<HTMLButtonElement>;
}

export default function Button(props: ButtonProps) {
Expand Down Expand Up @@ -184,6 +191,7 @@ export default function Button(props: ButtonProps) {
className={`${buttonClassName} ${props.buttonClassName}`}
style={style}
data-cy={cyLabel}
{...props.buttonProps}
>
{label}
{props.loading && spinner}
Expand Down
Loading

0 comments on commit 7e51f17

Please sign in to comment.