Skip to content

Commit

Permalink
fix client size and add scrim types
Browse files Browse the repository at this point in the history
  • Loading branch information
lowtorola committed Jan 11, 2025
1 parent bf84589 commit b3b79bd
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 6 deletions.
13 changes: 10 additions & 3 deletions frontend/src/components/ResponsiveIframe.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,13 @@ import { isPresent } from "utils/utilTypes";

interface ResponsiveIframeProps {
url: string;
className?: string;
}

const ResponsiveIframe: React.FC<ResponsiveIframeProps> = ({ url }) => {
const ResponsiveIframe: React.FC<ResponsiveIframeProps> = ({
url,
className = "",
}) => {
const containerRef = useRef<HTMLDivElement>(null);
const [dimensions, setDimensions] = useState({
width: "100%",
Expand All @@ -27,10 +31,13 @@ const ResponsiveIframe: React.FC<ResponsiveIframeProps> = ({ url }) => {
return () => {
window.removeEventListener("resize", updateDimensions);
};
}, []);
}, [
containerRef.current?.getBoundingClientRect().width,
containerRef.current?.getBoundingClientRect().height,
]);

return (
<div ref={containerRef} className="h-full w-full">
<div ref={containerRef} className={`h-full w-full ${className}`}>
<iframe
src={url}
style={{
Expand Down
5 changes: 5 additions & 0 deletions frontend/src/components/tables/scrimmaging/InboxTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,11 @@ const InboxTable: React.FC<InboxTableProps> = ({ inboxPage, handlePage }) => {
/>
),
},
{
header: "Type",
key: "type",
value: (req) => (req.is_ranked ? "Ranked" : "Unranked"),
},
{
header: "Player Order",
key: "player_order",
Expand Down
5 changes: 5 additions & 0 deletions frontend/src/components/tables/scrimmaging/OutboxTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,11 @@ const OutboxTable: React.FC<OutboxTableProps> = ({
/>
),
},
{
header: "Type",
key: "type",
value: (req) => (req.is_ranked ? "Ranked" : "Unranked"),
},
{
header: "Player Order",
key: "player_order",
Expand Down
6 changes: 3 additions & 3 deletions frontend/src/views/Client.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@ const Client: React.FC = () => {
}, [matches]);

return (
<div className="flex h-full w-full flex-col gap-2 p-6">
<div className="flex w-full flex-1 flex-col items-center gap-4 md:flex-row md:gap-2">
<div className="flex h-full min-h-screen w-full flex-col gap-2 p-6">
<div className="flex max-h-min w-full flex-1 flex-col items-center gap-4 md:flex-row md:gap-2">
<SelectMenu
loading={matches.isLoading || userTeam.isLoading}
className="w-full md:max-w-96"
Expand All @@ -101,7 +101,7 @@ const Client: React.FC = () => {
/>
</div>

<ResponsiveIframe url={clientUrl ?? ""} />
<ResponsiveIframe url={clientUrl ?? ""} className="flex flex-1" />
</div>
);
};
Expand Down

0 comments on commit b3b79bd

Please sign in to comment.