Skip to content

Commit

Permalink
Create Controller ui tweaks (#1232)
Browse files Browse the repository at this point in the history
* Create Controller ui tweaks

* Update snapshots
  • Loading branch information
tarrencev authored Jan 3, 2025
1 parent 6e528c5 commit 91a2d36
Show file tree
Hide file tree
Showing 13 changed files with 31 additions and 11 deletions.
7 changes: 6 additions & 1 deletion .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ jobs:
steps:
- uses: actions/checkout@v4

- uses: docker/setup-qemu-action@v3

- uses: docker/setup-buildx-action@v3

- uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
Expand All @@ -36,7 +40,7 @@ jobs:
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=sha,format=long
type=sha,format=short
type=ref,event=branch
type=ref,event=pr
type=raw,value=latest,enable={{is_default_branch}}
Expand All @@ -48,3 +52,4 @@ jobs:
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
platforms: linux/amd64,linux/arm64
8 changes: 8 additions & 0 deletions Dockerfile.storybook
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,13 @@ RUN Xvfb :99 -screen 0 1280x1024x24 2>/dev/null &

WORKDIR /app

# Copy package files for installation
COPY package.json pnpm-lock.yaml ./
COPY packages/keychain/package.json ./packages/keychain/
COPY packages/ui-next/package.json ./packages/ui-next/

# Install dependencies
RUN pnpm install --frozen-lockfile

# Default command that can be overridden
CMD ["bash"]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -74,13 +74,15 @@ export function CreateControllerView({
isLoading={validation.status === "validating"}
disabled={isLoading}
onClear={onUsernameClear}
style={{ position: "relative", zIndex: 1 }}
/>
</Box>

<StatusTray
username={usernameField.value}
validation={validation}
error={error}
style={{ position: "relative", zIndex: 0 }}
/>
</Content>

Expand Down
19 changes: 12 additions & 7 deletions packages/keychain/src/components/connect/create/StatusTray.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,19 @@ import { ExternalIcon } from "@cartridge/ui-next";
import { useMemo } from "react";
import { Link } from "react-router-dom";

interface StatusTrayProps {
username: string;
validation: ValidationState;
error?: Error;
style?: React.CSSProperties;
}

export function StatusTray({
username,
validation,
error,
}: {
username: string;
validation: ValidationState;
error?: Error;
}) {
style,
}: StatusTrayProps) {
const isError = validation.status === "invalid" || error;
const isTimeoutError = error?.message?.includes(
"The operation either timed out or was not allowed",
Expand All @@ -34,11 +38,12 @@ export function StatusTray({
alignItems="flex-start"
bg="solid.secondary"
py="8px"
marginTop="-1rem"
paddingTop="15px"
marginTop="-11px"
paddingTop="12px"
backgroundColor={isError ? "red.500" : "solid.secondary"}
borderBottomRadius="4px"
divider={<Divider borderColor="darkGray.800" opacity="0.1" />}
style={style}
>
<Text
fontFamily="Inter"
Expand Down
2 changes: 1 addition & 1 deletion packages/ui-next/src/components/primitives/input.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const Input = React.forwardRef<HTMLInputElement, InputProps>(
<input
type={type}
className={cn(
"flex h-10 w-full rounded-md border border-input bg-quaternary px-4 py-3.5 text-md ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",
"flex h-10 w-full rounded-md border border-input bg-quaternary px-4 py-3.5 text-md ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50",
className,
)}
ref={ref}
Expand Down
4 changes: 2 additions & 2 deletions scripts/update-storybook-snapshot.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ docker run \
--rm \
-v "$(pwd)":/app \
-v /app/node_modules \
-it \
ghcr.io/cartridge-gg/controller/storybook-env:sha-b6d96629787539de6f5e464aafedafd4eb3ffcc7 \
--ipc=host \
storybook-env \
bash -c "
pnpm install --frozen-lockfile && \
pnpm test:storybook:update
Expand Down

0 comments on commit 91a2d36

Please sign in to comment.