Skip to content

Commit

Permalink
Fix rebase error
Browse files Browse the repository at this point in the history
  • Loading branch information
JunichiSugiura committed Dec 18, 2024
1 parent 666c86b commit 6a8ceca
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 51 deletions.
74 changes: 26 additions & 48 deletions packages/keychain/src/components/connect/CreateSession.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Container, Content, Footer } from "components/layout";
import { BigNumberish, shortString } from "starknet";
import { ControllerError } from "utils/connection";
import { Button, HStack, VStack, Text, Checkbox } from "@chakra-ui/react";
import { Button, HStack, Text, Checkbox } from "@chakra-ui/react";
import { useCallback, useEffect, useMemo, useState } from "react";
import { useConnection } from "hooks/connection";
import { ControllerErrorAlert } from "components/ErrorAlert";
Expand Down Expand Up @@ -113,6 +113,29 @@ export function CreateSession({
)}
</Content>
<Footer>
<div className="flex items-center text-sm text-muted-foreground py-4 gap-2">
<div className="font-medium">Expires in </div>
<Select
value={duration.toString()}
onValueChange={(val) => setDuration(BigInt(val))}
>
<SelectTrigger className="w-28">
<SelectValue
defaultValue={(60 * 60 * 24).toString()}
placeholder="1 HR"
/>
</SelectTrigger>

<SelectContent>
<SelectItem value={(60 * 60).toString()}>1 HR</SelectItem>
<SelectItem value={(60 * 60 * 24).toString()}>24 HRS</SelectItem>
<SelectItem value={(60 * 60 * 24 * 7).toString()}>
1 WEEK
</SelectItem>
</SelectContent>
</Select>
</div>

{!policies?.verified && (
<HStack
p={3}
Expand Down Expand Up @@ -142,6 +165,7 @@ export function CreateSession({
{error && isControllerError(error) && (
<ControllerErrorAlert error={error} />
)}

<HStack spacing={4} width="full">
<Button onClick={() => onConnect()} isDisabled={isConnecting} px={10}>
Skip
Expand All @@ -159,53 +183,7 @@ export function CreateSession({
</Button>
</HStack>

{!error && (
<div className="flex flex-col">
<div className="flex items-center text-sm text-muted-foreground py-4 gap-2">
<div className="font-medium">Expires in </div>
<Select
value={duration.toString()}
onValueChange={(val) => setDuration(BigInt(val))}
>
<SelectTrigger className="w-28">
<SelectValue
defaultValue={(60 * 60 * 24).toString()}
placeholder="1 HR"
/>
</SelectTrigger>

<SelectContent>
<SelectItem value={(60 * 60).toString()}>1 HR</SelectItem>
<SelectItem value={(60 * 60 * 24).toString()}>
24 HRS
</SelectItem>
<SelectItem value={(60 * 60 * 24 * 7).toString()}>
1 WEEK
</SelectItem>
</SelectContent>
</Select>
</div>

<VStack spacing={4} width="full">
<Button
colorScheme="colorful"
isDisabled={isDisabled || isConnecting}
isLoading={isConnecting}
onClick={() => onCreateSession()}
width="full"
>
{isUpdate ? "update" : "create"} session
</Button>
<Button
onClick={() => onConnect()}
isDisabled={isConnecting}
width="full"
>
Skip
</Button>
</VStack>
</div>
)}
{!error && <div className="flex flex-col"></div>}
</Footer>
</Container>
);
Expand Down
6 changes: 3 additions & 3 deletions packages/ui-next/src/components/primitives/select.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@ const SelectTrigger = React.forwardRef<
<SelectPrimitive.Trigger
ref={ref}
className={cn(
"flex h-9 w-full items-center justify-between whitespace-nowrap rounded-md bg-secondary px-3 py-2 text-xs font-bold placeholder:text-muted-foreground focus:outline-none disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",
"flex h-9 w-full items-center justify-between whitespace-nowrap rounded-md bg-secondary px-3 py-2 text-xs font-bold text-foreground placeholder:text-muted-foreground focus:outline-none disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",
className,
)}
{...props}
>
{children}
<SelectPrimitive.Icon asChild>
<CaratIcon variant="down" />
<CaratIcon variant="down" className="text-muted-foreground" />
</SelectPrimitive.Icon>
</SelectPrimitive.Trigger>
));
Expand Down Expand Up @@ -123,7 +123,7 @@ const SelectItem = React.forwardRef<
<SelectPrimitive.Item
ref={ref}
className={cn(
"relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-2 pr-8 text-xs outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
"relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-2 pr-8 text-xs text-muted-foreground outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
className,
)}
{...props}
Expand Down

0 comments on commit 6a8ceca

Please sign in to comment.