Skip to content

armgit / dub

Public Imported from GitHub
0

The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.

fix loading-dots

Steven Tey0b2f627dd6d1
diff --git a/apps/web/package.json b/apps/web/package.json
index a8702febad..dee24c8935 100644
--- a/apps/web/package.json
+++ b/apps/web/package.json
@@ -12,15 +12,11 @@
},
"dependencies": {
"@boxyhq/saml-jackson": "^1.11.3",
+ "@dub/ui": "workspace:*",
+ "@dub/utils": "workspace:*",
"@next-auth/prisma-adapter": "^1.0.5",
"@planetscale/database": "^1.7.0",
"@prisma/client": "^5.2.0",
- "@radix-ui/react-accordion": "^1.0.1",
- "@radix-ui/react-dialog": "1.0.3",
- "@radix-ui/react-navigation-menu": "^1.1.2",
- "@radix-ui/react-popover": "1.0.5",
- "@radix-ui/react-switch": "^1.0.1",
- "@radix-ui/react-tooltip": "^1.0.2",
"@react-email/components": "^0.0.7",
"@sindresorhus/slugify": "^2.2.1",
"@splinetool/react-spline": "^2.2.3",
@@ -56,7 +52,6 @@
"github-slugger": "^2.0.0",
"html-escaper": "^3.0.3",
"js-cookie": "^3.0.5",
- "@dub/utils": "workspace:*",
"lucide-react": "^0.269.0",
"ms": "^2.1.3",
"nanoid": "^5.0.1",
@@ -92,7 +87,6 @@
"tailwind-scrollbar-hide": "^1.1.7",
"tailwindcss-radix": "^2.8.0",
"topojson-client": "^3.1.0",
- "@dub/ui": "workspace:*",
"unsplash-js": "^7.0.18",
"use-debounce": "^8.0.4",
"vaul": "^0.6.8"
diff --git a/packages/tailwind-config/tailwind.config.ts b/packages/tailwind-config/tailwind.config.ts
index b6a271af59..33c412fa39 100644
--- a/packages/tailwind-config/tailwind.config.ts
+++ b/packages/tailwind-config/tailwind.config.ts
@@ -53,8 +53,10 @@ const config: Config = {
"accordion-up": "accordion-up 300ms cubic-bezier(0.87, 0, 0.13, 1)",
// Custom wiggle animation
wiggle: "wiggle 0.75s infinite",
- // Custom spinner animation
+ // Custom spinner animation (for loading-spinner)
spinner: "spinner 1.2s linear infinite",
+ // Custom blink animation (for loading-dots)
+ blink: "blink 1.4s infinite both",
},
keyframes: {
// Modal
@@ -138,7 +140,7 @@ const config: Config = {
"60%": { transform: "translateX(2px) rotate(1.6deg)" },
"75%": { transform: "translateX(-1px) rotate(-0.8deg)" },
},
- // Custom spinner animation
+ // Custom spinner animation (for loading-spinner)
spinner: {
"0%": {
opacity: "1",
@@ -147,6 +149,18 @@ const config: Config = {
opacity: "0",
},
},
+ // Custom blink animation (for loading-dots)
+ blink: {
+ "0%": {
+ opacity: "0.2",
+ },
+ "20%": {
+ opacity: "1",
+ },
+ "100%": {
+ opacity: "0.2",
+ },
+ },
},
colors: {
brown: {
diff --git a/packages/ui/package.json b/packages/ui/package.json
index 830d00e016..2dfdc7907d 100644
--- a/packages/ui/package.json
+++ b/packages/ui/package.json
@@ -1,7 +1,7 @@
{
"name": "@dub/ui",
"description": "UI components for Dub.co",
- "version": "0.0.3",
+ "version": "0.0.4",
"sideEffects": [
"**/*.css"
],
diff --git a/packages/ui/src/icons/loading-dots.css b/packages/ui/src/icons/loading-dots.css
deleted file mode 100644
index 3a45d66530..0000000000
--- a/packages/ui/src/icons/loading-dots.css
+++ /dev/null
@@ -1,40 +0,0 @@
-.loading-dots {
- display: inline-flex;
- align-items: center;
-}
-
-.loading-dots .spacer {
- margin-right: 2px;
-}
-
-.loading-dots span {
- animation-name: blink;
- animation-duration: 1.4s;
- animation-iteration-count: infinite;
- animation-fill-mode: both;
- width: 5px;
- height: 5px;
- border-radius: 50%;
- display: inline-block;
- margin: 0 1px;
-}
-
-.loading-dots span:nth-of-type(2) {
- animation-delay: 0.2s;
-}
-
-.loading-dots span:nth-of-type(3) {
- animation-delay: 0.4s;
-}
-
-@keyframes blink {
- 0% {
- opacity: 0.2;
- }
- 20% {
- opacity: 1;
- }
- 100% {
- opacity: 0.2;
- }
-}
diff --git a/packages/ui/src/icons/loading-dots.tsx b/packages/ui/src/icons/loading-dots.tsx
index 6b582c7a8a..d0b7cc44e4 100644
--- a/packages/ui/src/icons/loading-dots.tsx
+++ b/packages/ui/src/icons/loading-dots.tsx
@@ -1,13 +1,21 @@
-import "./loading-dots.css";
-
-const LoadingDots = () => {
+export default function LoadingDots() {
return (
- <span className="loading-dots">
- <span />
- <span />
- <span />
+ <span className="inline-flex items-center">
+ {[...Array(3)].map((_, i) => (
+ <span
+ key={i}
+ style={{
+ animationDelay: `${0.2 * i}s`,
+ backgroundColor: "black",
+ width: "5px",
+ height: "5px",
+ borderRadius: "50%",
+ display: "inline-block",
+ margin: "0 1px",
+ }}
+ className="animate-blink"
+ />
+ ))}
</span>
);
-};
-
-export default LoadingDots;
+}
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 77acd2f9d0..bf3cc93413 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -52,24 +52,6 @@ importers:
'@prisma/client':
specifier: ^5.2.0
version: 5.2.0([email protected])
- '@radix-ui/react-accordion':
- specifier: ^1.0.1
- '@radix-ui/react-dialog':
- specifier: 1.0.3
- '@radix-ui/react-navigation-menu':
- specifier: ^1.1.2
- '@radix-ui/react-popover':
- specifier: 1.0.5
- '@radix-ui/react-switch':
- specifier: ^1.0.1
- '@radix-ui/react-tooltip':
- specifier: ^1.0.2
'@react-email/components':
specifier: ^0.0.7
version: 0.0.7