Skip to content

Commit

Permalink
chore: fix ui libs types
Browse files Browse the repository at this point in the history
  • Loading branch information
valpinkman authored and gre committed Sep 28, 2023
1 parent 8d9edf6 commit 7084b9f
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export const ChartCardDefault = (args: typeof ChartCardDefaultArgs): JSX.Element
const [rangeRequest, setRangeRequest] = useState("24h");

const refreshChart = useCallback(
(request) => {
(request: any) => {
if (request && request.range) {
const { range } = request;
setRangeRequest(range);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ export const BaseInputRenderSideExempleStory = () => {
value={value}
onChange={onChange}
renderLeft={renderLeft}
// @ts-expect-error inconsistenties in props
renderRight={renderRight}
placeholder={"test"}
disabled={disabled}
Expand Down
4 changes: 2 additions & 2 deletions libs/ui/packages/react/src/components/Table/Table.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -465,10 +465,10 @@ const CustomRowContainer = styled(Table.RowContainer).attrs<{ onClick: () => voi
`;

export const CustomRows: StoryTemplate<Props<BalanceElement>> = args => {
const [selectedRowIndex, setSelectedRowIndex] = useState(null);
const [selectedRowIndex, setSelectedRowIndex] = useState<number | undefined>();

const renderRow = useCallback(
(rowIndex, children) => (
(rowIndex: number, children?: React.ReactNode) => (
<CustomRowContainer rowIndex={rowIndex} onClick={() => setSelectedRowIndex(rowIndex)}>
{children}
</CustomRowContainer>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ export const RenderSideExemple = (): JSX.Element => {
error={error}
onChange={setValue}
renderLeft={renderLeft}
// @ts-expect-error inconsistencie in props
renderRight={renderRight}
placeholder={"test"}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ const steps = [
*/
estimatedTime?: number;
},
{
{
status: ItemStatus;
title: string;
renderBody?: (isDisplayed?: boolean) => ReactNode;
Expand Down Expand Up @@ -69,9 +69,12 @@ const defaultItems: Item[] = [
title: "step's {title} prop",
renderBody: () => (
<Flex flexDirection="column" flex={1} border="1px solid" borderColor="neutral.c100" p={3}>
{/* @ts-expect-error children props issue */}
<BodyText>{`This box is the React node returned by the step's {renderBody} prop`}</BodyText>
<Divider my={6} text="`Divider` component" />
{/* @ts-expect-error children props issue */}
<SubtitleText>This subtitle text component is `VerticalTimeline.SubtitleText`</SubtitleText>
{/* @ts-expect-error children props issue */}
<BodyText>This body text component is `VerticalTimeline.BodyText`</BodyText>
<ContinueOnDevice
Icon={({ size }) => (
Expand All @@ -88,6 +91,7 @@ const defaultItems: Item[] = [
estimatedTime: 120,
renderBody: () => (
<Flex flexDirection="column">
{/* @ts-expect-error children props issue */}
<BodyText>
{`Your PIN can be 4 to 8 digits long. Anyone with access to your Nano and to your PIN can also access all your crypto and NFT assets.`}
</BodyText>
Expand All @@ -106,12 +110,16 @@ const defaultItems: Item[] = [
estimatedTime: 300,
renderBody: () => (
<Flex flexDirection="column">
{/* @ts-expect-error children props issue */}
<SubtitleText>{`Generate a new phrase`}</SubtitleText>
{/* @ts-expect-error children props issue */}
<BodyText>
{`Your device will generate a new secret recovery phrase. For your eyes only.`}
</BodyText>
<Divider text="OR" my={6} />
{/* @ts-expect-error children props issue */}
<SubtitleText>{`Restore using Secret Recovery Phrase`}</SubtitleText>
{/* @ts-expect-error children props issue */}
<BodyText>
{`Make sure to use a Phrase generated by a Ledger for the guaranteed security of your assets. `}
</BodyText>
Expand All @@ -123,6 +131,7 @@ const defaultItems: Item[] = [
title: "Software check",
renderBody: () => (
<Flex flexDirection="column">
{/* @ts-expect-error children props issue */}
<BodyText>{`We'll verify whether your Nano is genuine. This should be quick and easy!`}</BodyText>
</Flex>
),
Expand All @@ -132,13 +141,15 @@ const defaultItems: Item[] = [
title: "Install apps",
renderBody: () => (
<Flex flexDirection="column">
{/* @ts-expect-error children props issue */}
<BodyText>{`Installing apps`}</BodyText>
</Flex>
),
},
{
status: "inactive",
title: "Nano is ready",
// @ts-expect-error children props issue
renderBody: () => <BodyText>Almost there ...</BodyText>,
},
];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ const Routes = ({
export const Breadcrumb = (args: Props): JSX.Element => {
const [route, setRoute] = useState("apps/swap/confirm");

const onChange = useCallback(value => setRoute(value.join("/")), [setRoute]);
const onChange = useCallback((value: string[]) => setRoute(value.join("/")), [setRoute]);
const segments = useMemo(() => {
const paths = route.split("/");

Expand Down
2 changes: 1 addition & 1 deletion libs/ui/packages/react/src/components/tabs/Tabs/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export interface TabContent {
title: string;
disabled?: boolean;
badge?: string | number;
Component: React.ReactFragment;
Component: React.ReactNode;
}

export type Props = React.PropsWithChildren<{
Expand Down

0 comments on commit 7084b9f

Please sign in to comment.