diff --git a/web/src/components/InfoCard.tsx b/web/src/components/InfoCard.tsx index ab1525f9..6dbd480d 100644 --- a/web/src/components/InfoCard.tsx +++ b/web/src/components/InfoCard.tsx @@ -1,7 +1,6 @@ +import clsx from "clsx"; import React from "react"; -import { responsiveSize } from "styles/responsiveSize"; import InfoCircle from "svgs/icons/info-circle.svg"; -import { cn } from "src/utils"; interface IInfoCard { msg: string; @@ -11,12 +10,11 @@ interface IInfoCard { const InfoCard: React.FC = ({ msg, className }) => { return (
{msg} diff --git a/web/src/components/InformationCards/ItemInformationCard/index.tsx b/web/src/components/InformationCards/ItemInformationCard/index.tsx index 49341e66..84ea2da1 100644 --- a/web/src/components/InformationCards/ItemInformationCard/index.tsx +++ b/web/src/components/InformationCards/ItemInformationCard/index.tsx @@ -4,7 +4,6 @@ import Skeleton from "react-loading-skeleton"; import AliasDisplay from "components/RegistryInfo/AliasDisplay"; import ActionButton from "components/ActionButton"; import { mapFromSubgraphStatus } from "components/RegistryCard/StatusBanner"; -import { responsiveSize } from "styles/responsiveSize"; import { Policies } from "../RegistryInformationCard/Policies"; import FieldsDisplay from "./FieldsDisplay"; import StatusDisplay from "../StatusDisplay"; @@ -61,10 +60,7 @@ const ItemInformationCard: React.FC = ({
-
+
{registerer?.id ? (
diff --git a/web/src/components/InformationCards/RegistryInformationCard/Policies.tsx b/web/src/components/InformationCards/RegistryInformationCard/Policies.tsx index 0f9f3d5b..fe298d42 100644 --- a/web/src/components/InformationCards/RegistryInformationCard/Policies.tsx +++ b/web/src/components/InformationCards/RegistryInformationCard/Policies.tsx @@ -1,7 +1,5 @@ import React from "react"; -import { responsiveSize } from "styles/responsiveSize"; - import Skeleton from "react-loading-skeleton"; import PolicyIcon from "svgs/icons/policy.svg"; @@ -26,14 +24,13 @@ export const Policies: React.FC = ({ policyURI, isItem }) => {

Make sure you read and understand the Policies

-
+
{!isItem ? ( <> {parentRegistryDetails ? ( diff --git a/web/src/components/InformationCards/RegistryInformationCard/TopInfo.tsx b/web/src/components/InformationCards/RegistryInformationCard/TopInfo.tsx index 2b6d2d5d..f55f78a0 100644 --- a/web/src/components/InformationCards/RegistryInformationCard/TopInfo.tsx +++ b/web/src/components/InformationCards/RegistryInformationCard/TopInfo.tsx @@ -4,14 +4,13 @@ import Skeleton from "react-loading-skeleton"; import { RegistryDetails } from "context/RegistryDetailsContext"; import StatusDisplay from "../StatusDisplay"; import { DEFAULT_CHAIN, SUPPORTED_CHAINS } from "src/consts/chains"; -import { responsiveSize } from "src/styles/responsiveSize"; -import { cn, isUndefined } from "src/utils"; +import { isUndefined } from "src/utils"; import { DEFAULT_LIST_LOGO } from "src/consts"; import { getIpfsUrl } from "utils/getIpfsUrl"; import { shortenAddress } from "utils/shortenAddress"; import { Link } from "react-router-dom"; +import clsx from "clsx"; -const landscapeColumnGapCalc = "lg:gap-x-[calc(24px+(32-24)*(min(max(100vw,900px),1250px)-900px)/(1250-900))]"; interface ITopInfo extends Pick< RegistryDetails, @@ -33,11 +32,8 @@ const TopInfo: React.FC = ({ const [imageSrc, setImageSrc] = useState(getIpfsUrl(logoURI ?? "")); useEffect(() => setImageSrc(getIpfsUrl(logoURI ?? "")), [logoURI]); return ( -
-
+
+
{isUndefined(logoURI) ? ( @@ -60,10 +56,9 @@ const TopInfo: React.FC = ({ )}
{id !== "" ? ( diff --git a/web/src/components/InformationCards/RegistryInformationCard/index.tsx b/web/src/components/InformationCards/RegistryInformationCard/index.tsx index 38f7c1e6..013cb3ba 100644 --- a/web/src/components/InformationCards/RegistryInformationCard/index.tsx +++ b/web/src/components/InformationCards/RegistryInformationCard/index.tsx @@ -1,5 +1,4 @@ import React from "react"; -import { responsiveSize } from "styles/responsiveSize"; import { Card, Copiable } from "@kleros/ui-components-library"; import AliasDisplay from "components/RegistryInfo/AliasDisplay"; import { mapFromSubgraphStatus } from "components/RegistryCard/StatusBanner"; @@ -71,11 +70,8 @@ const RegistryInformationCard: React.FC = ({ registryAddress: parentRegistryAddress, }} /> -
-
+
+
Submitted by: diff --git a/web/src/components/ItemCard/index.tsx b/web/src/components/ItemCard/index.tsx index 1aa13682..e0bc4347 100644 --- a/web/src/components/ItemCard/index.tsx +++ b/web/src/components/ItemCard/index.tsx @@ -1,17 +1,13 @@ import React from "react"; import { Button, Card } from "@kleros/ui-components-library"; import { useNavigateAndScrollTop } from "hooks/useNavigateAndScrollTop"; -import { responsiveSize } from "styles/responsiveSize"; import StatusBanner, { mapFromSubgraphStatus } from "../RegistryCard/StatusBanner"; import ArrowIcon from "svgs/icons/arrow.svg"; import { ItemDetailsFragment } from "src/graphql/graphql"; import ItemField from "./ItemField"; -import { cn } from "src/utils"; import clsx from "clsx"; -const landscapeGridColsCalc = - "lg:grid-cols-[1fr_calc(150px+(180-150)*(min(max(100vw,900px),1250px)-900px)/(1250-900))_max-content]"; -const landscapeGapCalc = "lg:gap-[calc(16px+(36-16)*(min(max(100vw,900px),1250px)-900px)/(1250-900))]"; +const landscapeGridColsCalc = "lg:grid-cols-[1fr_var(--spacing-fluid-150-180-900)_max-content]"; interface IItemCard extends ItemDetailsFragment {} @@ -28,19 +24,17 @@ const ItemCard: React.FC = ({ id, status, disputed, props }) => { onClick={() => navigateAndScrollTop(`/lists/item/${id?.toString()}`)} >
{sortedProps.map((prop) => prop.isIdentifier && )} diff --git a/web/src/components/RegistryCard/RegistryInfo.tsx b/web/src/components/RegistryCard/RegistryInfo.tsx index 2df62fad..3e27de44 100644 --- a/web/src/components/RegistryCard/RegistryInfo.tsx +++ b/web/src/components/RegistryCard/RegistryInfo.tsx @@ -1,5 +1,4 @@ import React, { useEffect, useState } from "react"; -import { responsiveSize } from "styles/responsiveSize"; import Skeleton from "react-loading-skeleton"; import { Button } from "@kleros/ui-components-library"; import ArrowIcon from "svgs/icons/arrow.svg"; @@ -19,7 +18,7 @@ interface IListInfo { } const landscapeGridColsCalc = - "lg:grid-cols-[auto_1fr_calc(80px+(100-80)*(min(max(100vw,900px),1250px)-900px)/(1250-900))_calc(100px+(150-100)*(min(max(100vw,900px),1250px)-900px)/(1250-900))_max-content]"; + "lg:grid-cols-[auto_1fr_var(--spacing-fluid-80-100-900)_var(--spacing-fluid-100-150-900)_max-content]"; const ListInfo: React.FC = ({ title, totalItems, logoURI, status, isListView = false }) => { const [imageLoaded, setImageLoaded] = useState(false); @@ -35,7 +34,7 @@ const ListInfo: React.FC = ({ title, totalItems, logoURI, status, isL className={cn( "flex flex-col justify-center items-center gap-2 h-[calc(100%-45px)]", isListView && [ - "grid grid-cols-[21px_max-content_1fr_max-content] grid-rows-[repeat(3,min-content)] gap-y-4", + "grid grid-cols-[21px_max-content_1fr_max-content] grid-rows-[repeat(3,min-content)] gap-y-4 gap-x-fluid-8-24-900", "w-full h-max lg:h-16 p-4", "[&_img]:col-span-4", "lg:justify-between lg:grid-rows-[1fr] lg:px-8 lg:py-0", @@ -43,7 +42,6 @@ const ListInfo: React.FC = ({ title, totalItems, logoURI, status, isL landscapeGridColsCalc, ] )} - style={{ columnGap: isListView ? responsiveSize(8, 24, 900) : undefined }} > {!imageLoaded ? ( = ({ title, text, subtext, icon: Icon, color, ...props }) => { return ( -
+
(
@@ -11,17 +10,13 @@ export const HistorySkeletonCard = () => (
); -export const SkeletonRegistryCard = () => ( -
- -
-); +export const SkeletonRegistryCard = () => ; export const SkeletonJustificationCard = () => (
- + - +
); diff --git a/web/src/global.css b/web/src/global.css index 0b49e432..dd81383b 100644 --- a/web/src/global.css +++ b/web/src/global.css @@ -24,6 +24,61 @@ --max-width-landscape: 87.5rem; --shadow-custom: 0px 2px 3px rgba(0, 0, 0, 0.06); --leading-18px: 18px; + + /* + * Spacing utils for custom sizing + * Default max screen width is 1250px + * Default min screen width is 375px + */ + --spacing-scale-8-32-300: calc(8px + (32 - 8) * (100vw - 300px) / (1250 - 300)); + --spacing-scale-300-424-300: calc(300px + (424 - 300) * (100vw - 300px) / (1250 - 300)); + + /* + * Spacing utils for responsive resizing + * Default max screen width is 1250px + * Default min screen width is 375px + */ + --spacing-fluid-0-16: clamp(0px, calc(0px + (16 - 0) * (100vw - 375px) / (1250 - 375)), 16px); + --spacing-fluid-0-108: clamp(0px, calc(0px + (108 - 0) * (100vw - 375px) / (1250 - 375)), 108px); + --spacing-fluid-0-132: clamp(0px, calc(0px + (132 - 0) * (100vw - 375px) / (1250 - 375)), 132px); + --spacing-fluid-4-8: clamp(4px, calc(4px + (8 - 4) * (100vw - 375px) / (1250 - 375)), 8px); + --spacing-fluid-6-8-300: clamp(6px, calc(6px + (8 - 6) * (100vw - 300px) / (1250 - 300)), 8px); + --spacing-fluid-8-16: clamp(8px, calc(8px + (16 - 8) * (100vw - 375px) / (1250 - 375)), 16px); + --spacing-fluid-8-24: clamp(8px, calc(8px + (24 - 8) * (100vw - 375px) / (1250 - 375)), 24px); + --spacing-fluid-8-24-900: clamp(8px, calc(8px + (24 - 8) * (100vw - 900px) / (1250 - 900)), 24px); + --spacing-fluid-8-32-300: clamp(8px, calc(8px + (32 - 8) * (100vw - 300px) / (1250 - 300)), 32px); + --spacing-fluid-10-130: clamp(10px, calc(10px + (130 - 10) * (100vw - 375px) / (1250 - 375)), 130px); + --spacing-fluid-12-32-300: clamp(12px, calc(12px + (32 - 12) * (100vw - 300px) / (1250 - 300)), 32px); + --spacing-fluid-12-32-900: clamp(12px, calc(12px + (32 - 12) * (100vw - 900px) / (1250 - 900)), 32px); + --spacing-fluid-16-24: clamp(16px, calc(16px + (24 - 16) * (100vw - 375px) / (1250 - 375)), 24px); + --spacing-fluid-16-30: clamp(16px, calc(16px + (30 - 16) * (100vw - 375px) / (1250 - 375)), 30px); + --spacing-fluid-16-36-900: clamp(16px, calc(16px + (36 - 16) * (100vw - 900px) / (1250 - 900)), 36px); + --spacing-fluid-16-54: clamp(16px, calc(16px + (54 - 16) * (100vw - 375px) / (1250 - 375)), 54px); + --spacing-fluid-20-24: clamp(20px, calc(20px + (24 - 20) * (100vw - 375px) / (1250 - 375)), 24px); + --spacing-fluid-20-28: clamp(20px, calc(20px + (28 - 20) * (100vw - 375px) / (1250 - 375)), 28px); + --spacing-fluid-24-28: clamp(24px, calc(24px + (28 - 24) * (100vw - 375px) / (1250 - 375)), 28px); + --spacing-fluid-24-32: clamp(24px, calc(24px + (32 - 24) * (100vw - 375px) / (1250 - 375)), 32px); + --spacing-fluid-24-48: clamp(24px, calc(24px + (48 - 24) * (100vw - 375px) / (1250 - 375)), 48px); + --spacing-fluid-24-32-900: clamp(24px, calc(24px + (32 - 24) * (100vw - 900px) / (1250 - 900)), 32px); + --spacing-fluid-24-136: clamp(24px, calc(24px + (136 - 24) * (100vw - 375px) / (1250 - 375)), 136px); + --spacing-fluid-25-65: clamp(25px, calc(25px + (65 - 25) * (100vw - 375px) / (1250 - 375)), 65px); + --spacing-fluid-32-24: clamp(24px, calc(32px + (24 - 32) * (100vw - 375px) / (1250 - 375)), 32px); + --spacing-fluid-32-80: clamp(32px, calc(32px + (80 - 32) * (100vw - 375px) / (1250 - 375)), 80px); + --spacing-fluid-60-80: clamp(60px, calc(60px + (80 - 60) * (100vw - 375px) / (1250 - 375)), 80px); + --spacing-fluid-68-40: clamp(40px, calc(68px + (40 - 68) * (100vw - 375px) / (1250 - 375)), 68px); + --spacing-fluid-76-96: clamp(76px, calc(76px + (96 - 76) * (100vw - 375px) / (1250 - 375)), 96px); + --spacing-fluid-80-100-900: clamp(80px, calc(80px + (100 - 80) * (100vw - 900px) / (1250 - 900)), 100px); + --spacing-fluid-100-130: clamp(100px, calc(100px + (130 - 100) * (100vw - 375px) / (1250 - 375)), 130px); + --spacing-fluid-100-150-900: clamp(100px, calc(100px + (150 - 100) * (100vw - 900px) / (1250 - 900)), 150px); + --spacing-fluid-100-160: clamp(100px, calc(100px + (160 - 100) * (100vw - 375px) / (1250 - 375)), 160px); + --spacing-fluid-150-72: clamp(72px, calc(150px + (72 - 150) * (100vw - 375px) / (1250 - 375)), 150px); + --spacing-fluid-150-180-900: clamp(150px, calc(150px + (180 - 150) * (100vw - 900px) / (1250 - 900)), 180px); + --spacing-fluid-200-720: clamp(200px, calc(200px + (720 - 200) * (100vw - 375px) / (1250 - 375)), 720px); + --spacing-fluid-270-296: clamp(270px, calc(270px + (296 - 270) * (100vw - 375px) / (1250 - 375)), 296px); + --spacing-fluid-300-480: clamp(300px, calc(300px + (480 - 300) * (100vw - 375px) / (1250 - 375)), 480px); + --spacing-fluid-300-424-300: clamp(300px, calc(300px + (424 - 300) * (100vw - 300px) / (1250 - 300)), 424px); + --spacing-fluid-342-618: clamp(342px, calc(342px + (618 - 342) * (100vw - 375px) / (1250 - 375)), 618px); + --spacing-fluid-442-700-900: clamp(442px, calc(442px + (700 - 442) * (100vw - 900px) / (1250 - 900)), 700px); } .dark { diff --git a/web/src/layout/Header/DesktopHeader.tsx b/web/src/layout/Header/DesktopHeader.tsx index f62a409a..b22c373c 100644 --- a/web/src/layout/Header/DesktopHeader.tsx +++ b/web/src/layout/Header/DesktopHeader.tsx @@ -8,8 +8,6 @@ import KlerosSolutionsIcon from "svgs/menu-icons/kleros-solutions.svg"; import { DEFAULT_CHAIN } from "consts/chains"; import { useLockOverlayScroll } from "hooks/useLockOverlayScroll"; -import { responsiveSize } from "styles/responsiveSize"; - import ConnectWallet from "components/ConnectWallet"; import LightButton from "components/LightButton"; import OverlayPortal from "components/OverlayPortal"; @@ -44,7 +42,7 @@ const DesktopHeader: React.FC = () => {
-
+
void; } -const landscapeWidthCalc = "lg:w-[calc(300px+(480-300)*(min(max(100vw,375px),1250px)-375px)/(1250-375))]"; - const DappList: React.FC = ({ toggleIsDappListOpen }) => { const containerRef = useRef(null); useClickAway(containerRef, () => toggleIsDappListOpen()); @@ -97,17 +93,16 @@ const DappList: React.FC = ({ toggleIsDappListOpen }) => { "border border-klerosUIComponentsStroke rounded-[3px]", "bg-klerosUIComponentsWhiteBackground shadow-custom", "[&_svg]:visible", - "lg:mt-16 lg:top-0 lg:left-0 lg:right-auto lg:transform-none lg:translate-x-0 lg:max-h-[80vh]", - landscapeWidthCalc + "lg:w-fluid-300-480 lg:mt-16 lg:top-0 lg:left-0 lg:right-auto lg:transform-none lg:translate-x-0 lg:max-h-[80vh]" )} >

Kleros Solutions

{ITEMS.map((item) => { return ; diff --git a/web/src/layout/Header/navbar/Menu/Settings/Notifications/FormContactDetails/index.tsx b/web/src/layout/Header/navbar/Menu/Settings/Notifications/FormContactDetails/index.tsx index df4bde52..f5efb5ee 100644 --- a/web/src/layout/Header/navbar/Menu/Settings/Notifications/FormContactDetails/index.tsx +++ b/web/src/layout/Header/navbar/Menu/Settings/Notifications/FormContactDetails/index.tsx @@ -6,8 +6,6 @@ import { Button } from "@kleros/ui-components-library"; import { EMAIL_REGEX } from "consts/index"; -import { responsiveSize } from "styles/responsiveSize"; - import { ISettings } from "../../../../index"; import EmailVerificationInfo from "./EmailVerificationInfo"; @@ -72,11 +70,7 @@ const FormContactDetails: React.FC = ({ toggleIsSettingsOpen }) => { }; return ( -
+ {/* = ({ toggleIsSettingsOpen }) => { const containerRef = useRef(null); const location = useLocation(); @@ -37,7 +34,7 @@ const Settings: React.FC = ({ toggleIsSettingsOpen }) => { return (
= ({ toggleIsSettingsOpen }) => { >
Settings
div:first-child]:px-scale-8-32-300")} items={[TABS[0], { ...TABS[1], content: }]} />
diff --git a/web/src/layout/Header/navbar/Product.tsx b/web/src/layout/Header/navbar/Product.tsx index 9f210ed5..a559f315 100644 --- a/web/src/layout/Header/navbar/Product.tsx +++ b/web/src/layout/Header/navbar/Product.tsx @@ -2,8 +2,6 @@ import clsx from "clsx"; import React, { useState } from "react"; import Skeleton from "react-loading-skeleton"; -import { responsiveSize } from "styles/responsiveSize"; - interface IProduct { text: string; url: string; @@ -19,11 +17,10 @@ const Product: React.FC = ({ text, url, Icon }) => { target="_blank" rel="noopener noreferrer" className={clsx( - "flex flex-col items-center pt-4 pb-7 px-2 max-w-[100px] rounded-[3px] gap-2", + "flex flex-col items-center pt-4 pb-7 px-2 max-w-[100px] w-fluid-100-130 rounded-[3px] gap-2", "cursor-pointer bg-klerosUIComponentsLightBackground hover:bg-light-grey dark:hover:bg-klerosUIComponentsLightGrey", "hover:transition-[transform_0.15s,background-color_0.3s] hover:scale-[1.02]" )} - style={{ width: responsiveSize(100, 130) }} > {typeof Icon === "string" ? ( <> diff --git a/web/src/pages/AllLists/index.tsx b/web/src/pages/AllLists/index.tsx index fa97a59f..85187839 100644 --- a/web/src/pages/AllLists/index.tsx +++ b/web/src/pages/AllLists/index.tsx @@ -10,7 +10,7 @@ import ItemDisplay from "./ItemDisplay"; import Breadcrumb from "./StyledBreadcrumb"; import clsx from "clsx"; -const landscapePaddingCalc = "lg:p-[48px_calc(0px+(132-0)*(min(max(100vw,375px),1250px)-375px)/(1250-375))_60px]"; +const landscapePaddingCalc = "lg:p-[48px_var(--spacing-fluid-0-132)_60px]"; const AllLists: React.FC = () => (
{ @@ -20,12 +19,8 @@ const Header: React.FC = () => { return (
- -

Attachment File

{" "} + +

Attachment File

{" "}