|
1 | 1 | import React, { useMemo } from "react";
|
2 |
| -import styled from "styled-components"; |
| 2 | +import styled, { css } from "styled-components"; |
3 | 3 |
|
4 |
| -import { responsiveSize } from "styles/responsiveSize"; |
5 | 4 | import { hoverShortTransitionTiming } from "styles/commonStyles";
|
| 5 | +import { landscapeStyle } from "styles/landscapeStyle"; |
| 6 | + |
| 7 | +import { Card, Radio, LinearProgress } from "@kleros/ui-components-library"; |
6 | 8 |
|
7 | 9 | import { useMeasure } from "react-use";
|
8 | 10 | import { formatEther } from "viem";
|
9 | 11 |
|
10 |
| -import { Card, Radio, LinearProgress } from "@kleros/ui-components-library"; |
| 12 | +import { isUndefined } from "utils/index"; |
11 | 13 |
|
12 | 14 | import Gavel from "svgs/icons/gavel.svg";
|
13 | 15 |
|
14 |
| -import { isUndefined } from "utils/index"; |
15 |
| - |
16 |
| -const StyledCard = styled(Card)` |
| 16 | +const StyledCard = styled(Card)<{ canBeSelected: boolean }>` |
17 | 17 | ${hoverShortTransitionTiming}
|
18 | 18 | width: 100%;
|
19 |
| - padding: ${responsiveSize(12, 24)} ${responsiveSize(8, 24)}; |
| 19 | + padding: 16px; |
20 | 20 |
|
21 |
| - &:hover { |
22 |
| - cursor: pointer; |
| 21 | + :hover { |
| 22 | + cursor: ${({ canBeSelected }) => (canBeSelected ? "pointer" : "auto")}; |
23 | 23 | }
|
| 24 | +
|
| 25 | + ${landscapeStyle( |
| 26 | + () => css` |
| 27 | + padding: 24px; |
| 28 | + ` |
| 29 | + )} |
24 | 30 | `;
|
25 | 31 |
|
26 | 32 | const WinnerLabel = styled.label<{ winner: boolean }>`
|
@@ -97,8 +103,9 @@ const OptionCard: React.FC<IOptionCard> = ({
|
97 | 103 | else if (funding > 0n) return [`Funded with ${formatEther(funding)} ETH.`, 30];
|
98 | 104 | else return ["0 ETH contributed to this option", 0];
|
99 | 105 | }, [funding, required]);
|
| 106 | + |
100 | 107 | return (
|
101 |
| - <StyledCard ref={ref} hover {...props}> |
| 108 | + <StyledCard hover {...props} {...{ canBeSelected, ref }}> |
102 | 109 | <TopContainer>
|
103 | 110 | <TextContainer>
|
104 | 111 | <BlockLabel>{text}</BlockLabel>
|
|
0 commit comments