diff --git a/packages/react-app/src/collapsable-block.tsx b/packages/react-app/src/collapsable-block.tsx index aded861e..89e11d90 100644 --- a/packages/react-app/src/collapsable-block.tsx +++ b/packages/react-app/src/collapsable-block.tsx @@ -66,40 +66,38 @@ export function CollapsableBlock(props: Props) { }, [props, props.children]); return ( -
-
-        
-           setVisible(!isVisible)}>
-            
-              {isVisible ? (
-                <>
-                  
-                  
-                
-              ) : (
-                <>
-                  
-                  
-                
-              )}
-            
-            
-              {isVisible ? 'Hide ' : 'Show '}
-              {props.label}
-            
-          
-          {isVisible && (
-             copyCode(content)}
-              icon={}
-              size="small"
-              label="Copy"
-              display="icon"
-            />
-          )}
-        
-        {isVisible && content ? {content} : <>}
-      
-
+
+      
+         setVisible(!isVisible)}>
+          
+            {isVisible ? (
+              <>
+                
+                
+              
+            ) : (
+              <>
+                
+                
+              
+            )}
+          
+          
+            {isVisible ? 'Hide ' : 'Show '}
+            {props.label}
+          
+        
+        {isVisible && (
+           copyCode(content)}
+            icon={}
+            size="small"
+            label="Copy"
+            display="icon"
+          />
+        )}
+      
+      {isVisible && content ? {content} : <>}
+    
); } diff --git a/packages/react-app/src/components/claim-list.tsx b/packages/react-app/src/components/claim-list.tsx index d5945192..b7daad27 100644 --- a/packages/react-app/src/components/claim-list.tsx +++ b/packages/react-app/src/components/claim-list.tsx @@ -43,7 +43,7 @@ type Props = { questData: QuestModel; newClaim: number; challengeDeposit: TokenAmountModel; - questTotalBounty?: TokenAmountModel; + questTotalBounty?: TokenAmountModel | null; }; export default function ClaimList({ @@ -134,14 +134,7 @@ export default function ClaimList({ ) : ( All available diff --git a/packages/react-app/src/components/field-input/amount-field-input.tsx b/packages/react-app/src/components/field-input/amount-field-input.tsx index b53d0e07..553689d0 100644 --- a/packages/react-app/src/components/field-input/amount-field-input.tsx +++ b/packages/react-app/src/components/field-input/amount-field-input.tsx @@ -221,7 +221,7 @@ function AmountFieldInput({ }; const amountField = ( - + {amount !== undefined && (isEdit ? ( @@ -245,7 +245,6 @@ function AmountFieldInput({ const tokenField = ( (!compact ? `margin-bottom:${GUpx(2)}` : '')}; + ${({ compact }: any) => (!compact ? `margin-bottom:${GUpx(1)}` : '')}; ${({ isLoading, wide }: any) => (isLoading || wide ? `width: 100%;` : 'max-width: 100%;')}; `; @@ -30,7 +30,7 @@ const LineStyled = styled.div` const ContentWrapperStyled = styled.div` display: flex; - align-items: center; + align-items: ${({ align }: any) => align}; ${(props: any) => (!props.compact ? 'min-height: 45px;' : '')} & > div { input { @@ -38,6 +38,7 @@ const ContentWrapperStyled = styled.div` } } flex-direction: ${({ direction }: any) => direction}; + padding-left: ${GUpx(0.5)}; `; const SkeletonWrapperStyled = styled.div` @@ -52,9 +53,10 @@ type Props = { tooltipDetail?: React.ReactNode; children: React.ReactNode; id?: string; - isLoading: boolean; + isLoading?: boolean; wide?: boolean; direction?: 'row' | 'column'; + align?: 'center' | 'baseline' | 'flex-start' | 'flex-end' | 'unset'; }; export function FieldInput({ @@ -67,6 +69,7 @@ export function FieldInput({ isLoading = false, wide = false, direction = 'row', + align = 'center', }: Props) { const theme = useTheme(); const labelComponent = label && ( @@ -86,7 +89,7 @@ export function FieldInput({ ) : ( - + {children} )} diff --git a/packages/react-app/src/components/field-input/icon-tooltip.tsx b/packages/react-app/src/components/field-input/icon-tooltip.tsx index e8fbfd35..e1c92f56 100644 --- a/packages/react-app/src/components/field-input/icon-tooltip.tsx +++ b/packages/react-app/src/components/field-input/icon-tooltip.tsx @@ -1,7 +1,7 @@ import { Help, IconQuestion, useTheme } from '@1hive/1hive-ui'; import { ReactNode } from 'react'; +import { GUpx } from 'src/utils/css.util'; import styled from 'styled-components'; -import { Outset } from '../utils/spacer-util'; // #region Styled @@ -30,12 +30,15 @@ const TooltipWrapperStyled = styled.div` const HelpWrapperStyled = styled.div` width: 16px; + display: inline-block; + margin-left: ${GUpx()}; + margin-right: ${GUpx(0.5)}; `; // #endregion type Props = { - tooltip: string; + tooltip?: string; tooltipDetail?: ReactNode; icon?: ReactNode; children?: ReactNode; @@ -44,18 +47,16 @@ type Props = { export const IconTooltip = ({ tooltip, tooltipDetail, icon, children }: Props) => { const theme = useTheme(); return ( - - - {tooltipDetail || children ? ( - - - {tooltipDetail ?? children} - - - ) : ( - {icon ?? } - )} - - + + {tooltipDetail || children ? ( + + + {tooltipDetail ?? children} + + + ) : ( + {icon ?? } + )} + ); }; diff --git a/packages/react-app/src/components/field-input/text-field-input.tsx b/packages/react-app/src/components/field-input/text-field-input.tsx index a253cc20..8cfde7b4 100644 --- a/packages/react-app/src/components/field-input/text-field-input.tsx +++ b/packages/react-app/src/components/field-input/text-field-input.tsx @@ -71,7 +71,12 @@ export default function TextFieldInput({ content={value} markdownToJsxOptions={(o: any) => ({ ...o, + wrapper: 'div', + overrides: { + p: { + component: 'div', + }, pre: { component: CollapsableBlock, props: { diff --git a/packages/react-app/src/components/modals/execute-claim-modal.tsx b/packages/react-app/src/components/modals/execute-claim-modal.tsx index cc288c73..88510341 100644 --- a/packages/react-app/src/components/modals/execute-claim-modal.tsx +++ b/packages/react-app/src/components/modals/execute-claim-modal.tsx @@ -33,7 +33,7 @@ const OpenButtonWrapperStyled = styled.div` type Props = { claim: ClaimModel; - questTotalBounty?: TokenAmountModel; + questTotalBounty?: TokenAmountModel | null; onClose?: ModalCallback; }; @@ -135,6 +135,7 @@ export default function ExecuteClaimModal({ claim, questTotalBounty, onClose = n loading || !scheduleTimeout || claim.state === ENUM_CLAIM_STATE.Challenged || + questTotalBounty || !walletAddress } /> diff --git a/packages/react-app/src/components/modals/fund-modal.tsx b/packages/react-app/src/components/modals/fund-modal.tsx index d202325a..335fa7b2 100644 --- a/packages/react-app/src/components/modals/fund-modal.tsx +++ b/packages/react-app/src/components/modals/fund-modal.tsx @@ -137,6 +137,12 @@ export default function FundModal({ quest, onClose = noop }: Props) { > + - diff --git a/packages/react-app/src/components/modals/resolve-challenge-modal.tsx b/packages/react-app/src/components/modals/resolve-challenge-modal.tsx index abf70cab..57cb69f8 100644 --- a/packages/react-app/src/components/modals/resolve-challenge-modal.tsx +++ b/packages/react-app/src/components/modals/resolve-challenge-modal.tsx @@ -25,6 +25,7 @@ import * as QuestService from '../../services/quest.service'; import { Outset } from '../utils/spacer-util'; import { DisputeModel } from '../../models/dispute.model'; import TextFieldInput from '../field-input/text-field-input'; +import { IconTooltip } from '../field-input/icon-tooltip'; // #region StyledComponents @@ -65,7 +66,7 @@ const RulingInfoStyled = styled(Info)` width: 100%; `; -const OnlySHWarn = styled(Info)` +const OnlyStackholderWarnStyled = styled(Info)` padding: ${GUpx()}; display: flex; align-items: center; @@ -198,9 +199,22 @@ export default function ResolveChallengeModal({ claim, onClose = noop }: Props) ) : ( <> Ruling in progress, please come back later... - - See dispute - + {process.env.NODE_ENV === 'production' ? ( + + See dispute + + ) : ( + + )} )} @@ -233,10 +247,10 @@ export default function ResolveChallengeModal({ claim, onClose = noop }: Props) buttons={[ {isRuled && !isStackholder && ( - + Only a stackholder of this challenge may resolve it - + )} ,