Skip to content

Commit

Permalink
feat: use ui-ball loading
Browse files Browse the repository at this point in the history
  • Loading branch information
samuelint committed Jul 22, 2024
1 parent 0336481 commit 8644ce0
Show file tree
Hide file tree
Showing 7 changed files with 54 additions and 4 deletions.
1 change: 1 addition & 0 deletions webapp/.storybook/preview.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import type { Preview } from "@storybook/react";
import "@/app/globals.css";

const preview: Preview = {
parameters: {
Expand Down
1 change: 1 addition & 0 deletions webapp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
"class-variance-authority": "^0.7.0",
"clsx": "^2.1.1",
"jsdom": "^24.1.0",
"ldrs": "^1.0.2",
"lexical": "^0.16.1",
"lodash": "^4.17.21",
"lucide-react": "^0.408.0",
Expand Down
8 changes: 8 additions & 0 deletions webapp/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

23 changes: 23 additions & 0 deletions webapp/src/components/splashscreen.stories.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import type { Meta, StoryObj } from '@storybook/react';

import Splashscreen from './splashscreen';


const meta = {
title: 'Components/Splashscreen',
component: Splashscreen,
parameters: {
layout: 'centered',
backgrounds: {
default: 'light',
},
},
tags: ['autodocs'],
argTypes: {
},
} satisfies Meta<typeof Splashscreen>;

export default meta;
type Story = StoryObj<typeof meta>;

export const Default: Story = {};
11 changes: 7 additions & 4 deletions webapp/src/components/splashscreen.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
import { ThreeDotsLoading } from '@/components/ui/loading';
import { HelixLoading } from '@/components/ui/loading';

export default function Splashscreen() {
return (
<div className="flex flex-col items-center justify-center gap-4 fixed inset-0 backdrop-filter backdrop-blur-sm z-50">
<p>Loading</p>
<ThreeDotsLoading />
<div className="flex flex-col items-center justify-center gap-6 fixed inset-0 backdrop-filter backdrop-blur-sm z-50">
<div className='flex flex-col'>
<h1 className='text-3xl font-medium tracking-tighter'>Launching Assistant</h1>
<p>Please wait</p>
</div>
<HelixLoading />
</div>
);

Expand Down
13 changes: 13 additions & 0 deletions webapp/src/components/ui/loading.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
import { Loader2 } from 'lucide-react';
import { cn } from '@/lib/utils';

import { helix } from 'ldrs';

helix.register();



interface Props {
className?: string
Expand All @@ -20,6 +25,14 @@ function Dot({ className }: Props) {
return <span className={cn('bg-gray-900 dark:bg-gray-50 h-1 w-1 rounded-full inline-block', className)} />;
}

export function HelixLoading() {
return <l-helix
size="45"
speed="2.5"
color="black"
></l-helix>;
}

export function SpinnerLoading ({ className }: Props) {
return (
<Loader2 className={cn('animate-spin', className)} />
Expand Down
1 change: 1 addition & 0 deletions webapp/tailwind.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ const config = {
'./components/**/*.{ts,tsx}',
'./app/**/*.{ts,tsx}',
'./src/**/*.{ts,tsx}',

],
prefix: '',
theme: {
Expand Down

0 comments on commit 8644ce0

Please sign in to comment.