Skip to content

Database diagrams editor that allows you to visualize and design your DB with a single query.

remove diagrams from navbar + buckle (#490)

Guy Ben-Aharon1b0f293c8796
diff --git a/src/globals.css b/src/globals.css
index cd78f914..d815a92c 100644
--- a/src/globals.css
+++ b/src/globals.css
@@ -73,3 +73,64 @@
@apply dark:group-hover:bg-slate-900 group-hover:bg-slate-100 group-hover:ring-[0.5px] rounded-md cursor-pointer;
}
}
+
+.gradient-background {
+ /* Fallback: Set a background color. */
+ background-color: #f46b24;
+
+ /* Create the gradient. */
+ background-image: linear-gradient(
+ 45deg,
+ #2e6579 20%,
+ #4fafca 20%,
+ #4fafca 40%,
+ #6dc630 40%,
+ #6dc630 60%,
+ #f9dc3a 60%,
+ #f9dc3a 80%,
+ #f46b24 80%
+ );
+
+ /* Set the background size and repeat properties. */
+ background-size: 100%;
+ background-repeat: repeat;
+
+ /* Use the text as a mask for the background. */
+ /* This will show the gradient as a text color rather than element bg. */
+ /* -webkit-background-clip: text;
+ -webkit-text-fill-color: transparent; */
+
+ /* Animate the text when loading the element. */
+ /* This animates it on page load and when hovering out. */
+ animation: rainbow-text-simple-animation-rev 0.75s ease forwards;
+}
+
+.gradient-background:hover {
+ animation: rainbow-text-simple-animation 0.5s ease-in forwards;
+}
+
+@keyframes rainbow-text-simple-animation-rev {
+ 0% {
+ background-size: 650%;
+ }
+ 40% {
+ background-size: 650%;
+ }
+ 100% {
+ background-size: 100%;
+ }
+}
+
+/* Move the background and make it larger. */
+/* Animation shown when hovering over the text. */
+@keyframes rainbow-text-simple-animation {
+ 0% {
+ background-size: 100%;
+ }
+ 80% {
+ background-size: 650%;
+ }
+ 100% {
+ background-size: 650%;
+ }
+}
diff --git a/src/i18n/locales/bn.ts b/src/i18n/locales/bn.ts
index 85d12db4..787a6928 100644
--- a/src/i18n/locales/bn.ts
+++ b/src/i18n/locales/bn.ts
@@ -102,7 +102,6 @@ export const bn: LanguageTranslation = {
last_saved: 'সর্বশেষ সংরক্ষণ',
saved: 'সংরক্ষিত',
- diagrams: 'ডায়াগ্রাম',
loading_diagram: 'ডায়াগ্রাম লোড হচ্ছে...',
deselect_all: 'সব নির্বাচন সরান',
select_all: 'সব নির্বাচন করুন',
diff --git a/src/i18n/locales/de.ts b/src/i18n/locales/de.ts
index a683e769..5d0f61f2 100644
--- a/src/i18n/locales/de.ts
+++ b/src/i18n/locales/de.ts
@@ -103,7 +103,6 @@ export const de: LanguageTranslation = {
last_saved: 'Zuletzt gespeichert',
saved: 'Gespeichert',
- diagrams: 'Diagramme',
loading_diagram: 'Diagramm wird geladen...',
deselect_all: 'Alles abwählen',
select_all: 'Alles auswählen',
diff --git a/src/i18n/locales/en.ts b/src/i18n/locales/en.ts
index ea6950a0..e2e7a612 100644
--- a/src/i18n/locales/en.ts
+++ b/src/i18n/locales/en.ts
@@ -101,7 +101,6 @@ export const en = {
last_saved: 'Last saved',
saved: 'Saved',
- diagrams: 'Diagrams',
loading_diagram: 'Loading diagram...',
deselect_all: 'Deselect All',
select_all: 'Select All',
diff --git a/src/i18n/locales/es.ts b/src/i18n/locales/es.ts
index f37d866f..b6d8cf5a 100644
--- a/src/i18n/locales/es.ts
+++ b/src/i18n/locales/es.ts
@@ -93,7 +93,6 @@ export const es: LanguageTranslation = {
last_saved: 'Último guardado',
saved: 'Guardado',
- diagrams: 'Diagramas',
loading_diagram: 'Cargando diagrama...',
deselect_all: 'Deseleccionar todo',
select_all: 'Seleccionar todo',
diff --git a/src/i18n/locales/fr.ts b/src/i18n/locales/fr.ts
index db2c825b..d9737ba6 100644
--- a/src/i18n/locales/fr.ts
+++ b/src/i18n/locales/fr.ts
@@ -92,7 +92,6 @@ export const fr: LanguageTranslation = {
last_saved: 'Dernière sauvegarde',
saved: 'Enregistré',
- diagrams: 'Diagrammes',
loading_diagram: 'Chargement du diagramme...',
deselect_all: 'Tout désélectionner',
select_all: 'Tout sélectionner',
diff --git a/src/i18n/locales/gu.ts b/src/i18n/locales/gu.ts
index bf02d765..9b951cd5 100644
--- a/src/i18n/locales/gu.ts
+++ b/src/i18n/locales/gu.ts
@@ -102,7 +102,6 @@ export const gu: LanguageTranslation = {
last_saved: 'છેલ્લે સાચવ્યું',
saved: 'સાચવ્યું',
- diagrams: 'ડાયાગ્રામ',
loading_diagram: 'ડાયાગ્રામ લોડ થઈ રહ્યું છે...',
deselect_all: 'બધાને ડીસેલેક્ટ કરો',
select_all: 'બધા પસંદ કરો',
diff --git a/src/i18n/locales/hi.ts b/src/i18n/locales/hi.ts
index ab550936..76deed82 100644
--- a/src/i18n/locales/hi.ts
+++ b/src/i18n/locales/hi.ts
@@ -102,7 +102,6 @@ export const hi: LanguageTranslation = {
last_saved: 'अंतिम सहेजा गया',
saved: 'सहेजा गया',
- diagrams: 'आरेख',
loading_diagram: 'आरेख लोड हो रहा है...',
deselect_all: 'सभी को अचयनित करें',
select_all: 'सभी को चुनें',
diff --git a/src/i18n/locales/id_ID.ts b/src/i18n/locales/id_ID.ts
index d0adf23a..750f8081 100644
--- a/src/i18n/locales/id_ID.ts
+++ b/src/i18n/locales/id_ID.ts
@@ -101,7 +101,6 @@ export const id_ID: LanguageTranslation = {
last_saved: 'Terakhir disimpan',
saved: 'Tersimpan',
- diagrams: 'Diagram',
loading_diagram: 'Memuat diagram...',
deselect_all: 'Batalkan Semua',
select_all: 'Pilih Semua',
diff --git a/src/i18n/locales/ja.ts b/src/i18n/locales/ja.ts
index 8a204f47..d2eee480 100644
--- a/src/i18n/locales/ja.ts
+++ b/src/i18n/locales/ja.ts
@@ -104,7 +104,6 @@ export const ja: LanguageTranslation = {
last_saved: '最後に保存された',
saved: '保存されました',
- diagrams: 'ダイアグラム',
loading_diagram: 'ダイアグラムを読み込み中...',
deselect_all: 'すべての選択を解除',
select_all: 'すべてを選択',
diff --git a/src/i18n/locales/ko_KR.ts b/src/i18n/locales/ko_KR.ts
index 44f5d7a9..80cc8bb2 100644
--- a/src/i18n/locales/ko_KR.ts
+++ b/src/i18n/locales/ko_KR.ts
@@ -101,7 +101,6 @@ export const ko_KR: LanguageTranslation = {
last_saved: '최근 저장일시: ',
saved: '저장됨',
- diagrams: '다이어그램',
loading_diagram: '다이어그램 로딩중...',
deselect_all: '모두 선택 해제',
select_all: '모두 선택',
diff --git a/src/i18n/locales/mr.ts b/src/i18n/locales/mr.ts
index ff106f9a..286af692 100644
--- a/src/i18n/locales/mr.ts
+++ b/src/i18n/locales/mr.ts
@@ -102,7 +102,6 @@ export const mr: LanguageTranslation = {
last_saved: 'शेवटचे जतन केले',
saved: 'जतन केले',
- diagrams: 'आरेख',
loading_diagram: 'आरेख लोड करत आहे...',
deselect_all: 'सर्व निवड रद्द करा',
select_all: 'सर्व निवडा',
diff --git a/src/i18n/locales/ne.ts b/src/i18n/locales/ne.ts
index 4c2adc92..ffaebdef 100644
--- a/src/i18n/locales/ne.ts
+++ b/src/i18n/locales/ne.ts
@@ -101,7 +101,6 @@ export const ne: LanguageTranslation = {
last_saved: 'अन्तिम सुरक्षित',
saved: 'सुरक्षित',
- diagrams: 'डायाग्रामहरू',
loading_diagram: 'डायाग्राम लोड हुँदैछ...',
deselect_all: 'सबै चयन हटाउनुहोस्',
select_all: 'सबै चयन गर्नुहोस्',
diff --git a/src/i18n/locales/pt_BR.ts b/src/i18n/locales/pt_BR.ts
index 20d163a2..dd44318a 100644
--- a/src/i18n/locales/pt_BR.ts
+++ b/src/i18n/locales/pt_BR.ts
@@ -102,7 +102,6 @@ export const pt_BR: LanguageTranslation = {
last_saved: 'Última vez salvo',
saved: 'Salvo',
- diagrams: 'Diagramas',
loading_diagram: 'Carregando diagrama...',
deselect_all: 'Desmarcar Todos',
select_all: 'Selecionar Todos',
diff --git a/src/i18n/locales/ru.ts b/src/i18n/locales/ru.ts
index 451749a1..eeffb9a9 100644
--- a/src/i18n/locales/ru.ts
+++ b/src/i18n/locales/ru.ts
@@ -102,7 +102,6 @@ export const ru: LanguageTranslation = {
last_saved: 'Последнее сохранение',
saved: 'Сохранено',
- diagrams: 'Диаграммы',
loading_diagram: 'Загрузка диаграммы...',
deselect_all: 'Отменить выбор всех',
select_all: 'Выбрать все',
diff --git a/src/i18n/locales/te.ts b/src/i18n/locales/te.ts
index e376510a..0f3985bb 100644
--- a/src/i18n/locales/te.ts
+++ b/src/i18n/locales/te.ts
@@ -102,7 +102,6 @@ export const te: LanguageTranslation = {
last_saved: 'చివరిగా సేవ్ చేయబడిన',
saved: 'సేవ్ చేయబడింది',
- diagrams: 'చిత్రాలు',
loading_diagram: 'చిత్రం లోడ్ అవుతోంది...',
deselect_all: 'అన్ని ఎంచుకోకుండా ఉంచు',
select_all: 'అన్ని ఎంచుకోండి',
diff --git a/src/i18n/locales/tr.ts b/src/i18n/locales/tr.ts
index 4ef11254..9a92487e 100644
--- a/src/i18n/locales/tr.ts
+++ b/src/i18n/locales/tr.ts
@@ -102,8 +102,6 @@ export const tr: LanguageTranslation = {
last_saved: 'Son kaydedilen',
saved: 'Kaydedildi',
- diagrams: 'Diyagramlar',
-
loading_diagram: 'Diyagram yükleniyor...',
deselect_all: 'Hepsini Seçme',
select_all: 'Hepsini Seç',
diff --git a/src/i18n/locales/uk.ts b/src/i18n/locales/uk.ts
index 6ae3a34b..b7bd8955 100644
--- a/src/i18n/locales/uk.ts
+++ b/src/i18n/locales/uk.ts
@@ -102,7 +102,6 @@ export const uk: LanguageTranslation = {
last_saved: 'Востаннє збережено',
saved: 'Збережено',
- diagrams: 'Діаграми',
loading_diagram: 'Діаграма завантаження...',
deselect_all: 'Зняти вибір із усіх',
select_all: 'Вибрати усі',
diff --git a/src/i18n/locales/vi.ts b/src/i18n/locales/vi.ts
index 4250b3d1..edaeb6f2 100644
--- a/src/i18n/locales/vi.ts
+++ b/src/i18n/locales/vi.ts
@@ -101,7 +101,6 @@ export const vi: LanguageTranslation = {
last_saved: 'Đã lưu lần cuối',
saved: 'Đã lưu',
- diagrams: 'Sơ đồ',
loading_diagram: 'Đang tải sơ đồ...',
deselect_all: 'Bỏ chọn tất cả',
select_all: 'Chọn tất cả',
diff --git a/src/i18n/locales/zh_CN.ts b/src/i18n/locales/zh_CN.ts
index 34533ddf..b8ad1cb0 100644
--- a/src/i18n/locales/zh_CN.ts
+++ b/src/i18n/locales/zh_CN.ts
@@ -98,7 +98,6 @@ export const zh_CN: LanguageTranslation = {
last_saved: '上次保存时间:',
saved: '已保存',
- diagrams: '关系图',
loading_diagram: '加载关系图...',
deselect_all: '取消全选',
select_all: '全选',
diff --git a/src/i18n/locales/zh_TW.ts b/src/i18n/locales/zh_TW.ts
index 24b8c3ce..1553e25a 100644
--- a/src/i18n/locales/zh_TW.ts
+++ b/src/i18n/locales/zh_TW.ts
@@ -98,7 +98,6 @@ export const zh_TW: LanguageTranslation = {
last_saved: '上次儲存於',
saved: '已儲存',
- diagrams: '圖表',
loading_diagram: '正在載入圖表...',
deselect_all: '取消所有選取',
select_all: '全選',
diff --git a/src/pages/editor-page/top-navbar/diagram-name.tsx b/src/pages/editor-page/top-navbar/diagram-name.tsx
index 72342706..c5d87aa1 100644
--- a/src/pages/editor-page/top-navbar/diagram-name.tsx
+++ b/src/pages/editor-page/top-navbar/diagram-name.tsx
@@ -1,11 +1,9 @@
import React, { useCallback, useEffect, useState } from 'react';
-import { Label } from '@/components/label/label';
import { Button } from '@/components/button/button';
import { Check } from 'lucide-react';
import { Input } from '@/components/input/input';
import { useChartDB } from '@/hooks/use-chartdb';
import { useClickAway, useKeyPressEvent } from 'react-use';
-import { useBreakpoint } from '@/hooks/use-breakpoint';
import { DiagramIcon } from '@/components/diagram-icon/diagram-icon';
import { useTranslation } from 'react-i18next';
import { cn } from '@/lib/utils';
@@ -22,7 +20,6 @@ export const DiagramName: React.FC<DiagramNameProps> = () => {
const { diagramName, updateDiagramName, currentDiagram } = useChartDB();
const { t } = useTranslation();
- const { isMd: isDesktop } = useBreakpoint('md');
const [editMode, setEditMode] = useState(false);
const [editedDiagramName, setEditedDiagramName] =
React.useState(diagramName);
@@ -54,7 +51,7 @@ export const DiagramName: React.FC<DiagramNameProps> = () => {
<div className="group">
<div
className={cn(
- 'flex flex-1 flex-row items-center justify-center px-2 py-1',
+ 'flex flex-1 flex-row items-center justify-center px-2 py-1 whitespace-nowrap',
{
'text-editable': !editMode,
}
@@ -64,9 +61,6 @@ export const DiagramName: React.FC<DiagramNameProps> = () => {
databaseType={currentDiagram.databaseType}
databaseEdition={currentDiagram.databaseEdition}
/>
- <div className="flex">
- {isDesktop ? <Label>{t('diagrams')}/</Label> : null}
- </div>
<div className="flex flex-row items-center gap-1">
{editMode ? (
<>
diff --git a/src/pages/editor-page/top-navbar/last-saved.tsx b/src/pages/editor-page/top-navbar/last-saved.tsx
index 54772646..4dbebff5 100644
--- a/src/pages/editor-page/top-navbar/last-saved.tsx
+++ b/src/pages/editor-page/top-navbar/last-saved.tsx
@@ -74,7 +74,7 @@ const timeAgolocaleFromLanguage = async (
export const LastSaved: React.FC<LastSavedProps> = () => {
const { currentDiagram } = useChartDB();
const { t, i18n } = useTranslation();
- const { isMd: isDesktop } = useBreakpoint('md');
+ const { isLg: isDesktop } = useBreakpoint('lg');
const [language, setLanguage] = useState<string>('en_US');
useEffect(() => {
@@ -93,7 +93,10 @@ export const LastSaved: React.FC<LastSavedProps> = () => {
return (
<Tooltip>
<TooltipTrigger>
- <Badge variant="secondary" className="flex gap-1">
+ <Badge
+ variant="secondary"
+ className="flex gap-1 whitespace-nowrap"
+ >
{isDesktop ? t('last_saved') : t('saved')}
<TimeAgo
datetime={currentDiagram.updatedAt}
diff --git a/src/pages/editor-page/top-navbar/top-navbar.tsx b/src/pages/editor-page/top-navbar/top-navbar.tsx
index 71201044..c999e54b 100644
--- a/src/pages/editor-page/top-navbar/top-navbar.tsx
+++ b/src/pages/editor-page/top-navbar/top-navbar.tsx
@@ -201,11 +201,28 @@ export const TopNavbar: React.FC<TopNavbarProps> = () => {
setShowDependenciesOnCanvas(!showDependenciesOnCanvas);
}, [showDependenciesOnCanvas, setShowDependenciesOnCanvas]);
+ const openBuckleWaitlist = useCallback(() => {
+ window.open('https://waitlist.buckle.dev', '_blank');
+ }, []);
+
+ const renderGetBuckleButton = useCallback(() => {
+ return (
+ <button
+ className="gradient-background relative inline-flex items-center justify-center overflow-hidden rounded-lg p-0.5 text-base text-gray-700 focus:outline-none focus:ring-0"
+ onClick={openBuckleWaitlist}
+ >
+ <span className="relative inline-flex items-center justify-center whitespace-nowrap rounded-md bg-background px-2 py-0.5 font-primary text-xs font-semibold text-foreground md:text-sm">
+ Get Buckle 🎁
+ </span>
+ </button>
+ );
+ }, [openBuckleWaitlist]);
+
const emojiAI = '✨';
return (
<nav className="flex flex-col justify-between border-b px-3 md:h-12 md:flex-row md:items-center md:px-4">
- <div className="flex flex-1 flex-col justify-between gap-x-3 md:flex-row md:justify-normal">
+ <div className="flex flex-1 flex-col justify-between gap-x-1 md:flex-row md:justify-normal">
<div className="flex items-center justify-between pt-[8px] font-primary md:py-[10px]">
<a
href="https://chartdb.io"
@@ -224,6 +241,7 @@ export const TopNavbar: React.FC<TopNavbarProps> = () => {
</a>
{!isDesktop ? (
<div className="flex items-center gap-2">
+ {renderGetBuckleButton()}
{renderStars()}
<LanguageNav />
</div>
@@ -575,6 +593,7 @@ export const TopNavbar: React.FC<TopNavbarProps> = () => {
<>
<DiagramName />
<div className="hidden flex-1 items-center justify-end gap-2 sm:flex">
+ {renderGetBuckleButton()}
<LastSaved />
{renderStars()}
<LanguageNav />