Skip to content

Commit be27983

Browse files
author
Dominique Chuo
committed
fixes build errors
1 parent bae1153 commit be27983

File tree

4 files changed

+39
-30
lines changed

4 files changed

+39
-30
lines changed

blog/2025-01-09-welcome.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,6 @@ description: Introducing ReifyDB - a modern database designed to help developers
88

99
# Welcome to ReifyDB
1010

11-
TBD
11+
TBD
12+
13+
<!-- truncate -->

docs/getting-started/interactive-queries.mdx

Lines changed: 29 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ sidebar_position: 3
33
---
44

55
import InlineCodeBlock from '@site/src/components/InlineCodeBlock';
6+
import BrowserOnly from '@docusaurus/BrowserOnly';
67

78
# Interactive Queries
89

@@ -14,61 +15,72 @@ Learn how to query data in ReifyDB with interactive examples. You can run these
1415

1516
The most fundamental query in ReifyDB is the SELECT statement. Try running this query to see all users:
1617

17-
<InlineCodeBlock query="map {1}"/>
18+
<BrowserOnly fallback={<div>Loading editor...</div>}>
19+
{() => <InlineCodeBlock query="map {1}"/>}
20+
</BrowserOnly>
1821

1922
### Filtering with WHERE
2023

2124
You can filter results using the WHERE clause:
2225

23-
<InlineCodeBlock
24-
query="SELECT name, email
26+
<BrowserOnly fallback={<div>Loading editor...</div>}>
27+
{() => <InlineCodeBlock
28+
query="SELECT name, email
2529
FROM users
2630
WHERE email LIKE '%@example.com'"
27-
/>
31+
/>}
32+
</BrowserOnly>
2833

2934
## Joining Tables
3035

3136
ReifyDB supports various types of joins to combine data from multiple tables:
3237

33-
<InlineCodeBlock
34-
query="SELECT u.name, p.title
38+
<BrowserOnly fallback={<div>Loading editor...</div>}>
39+
{() => <InlineCodeBlock
40+
query="SELECT u.name, p.title
3541
FROM users u
3642
JOIN posts p ON u.id = p.user_id
3743
WHERE p.published = true"
38-
/>
44+
/>}
45+
</BrowserOnly>
3946

4047
## Aggregation
4148

4249
Use aggregation functions to summarize your data:
4350

44-
<InlineCodeBlock
45-
query="SELECT u.name, COUNT(p.id) as post_count
51+
<BrowserOnly fallback={<div>Loading editor...</div>}>
52+
{() => <InlineCodeBlock
53+
query="SELECT u.name, COUNT(p.id) as post_count
4654
FROM users u
4755
LEFT JOIN posts p ON u.id = p.user_id
4856
GROUP BY u.id, u.name
4957
ORDER BY post_count DESC"
50-
/>
58+
/>}
59+
</BrowserOnly>
5160

5261
## Conditional Logic
5362

5463
ReifyDB supports CASE statements for conditional logic:
5564

56-
<InlineCodeBlock
57-
query="SELECT
65+
<BrowserOnly fallback={<div>Loading editor...</div>}>
66+
{() => <InlineCodeBlock
67+
query="SELECT
5868
title,
5969
CASE
6070
WHEN published = true THEN 'Published'
6171
ELSE 'Draft'
6272
END as status
6373
FROM posts"
64-
/>
74+
/>}
75+
</BrowserOnly>
6576

6677
## Multiple Statements
6778

6879
You can run multiple SQL statements in a single execution. Each statement produces its own result table:
6980

70-
<InlineCodeBlock
71-
query={`-- Get all users
81+
<BrowserOnly fallback={<div>Loading editor...</div>}>
82+
{() => <InlineCodeBlock
83+
query={`-- Get all users
7284
SELECT * FROM users;
7385
7486
-- Get all published posts
@@ -81,7 +93,8 @@ SELECT * FROM users;
8193
FROM users u
8294
LEFT JOIN posts p ON u.id = p.user_id
8395
GROUP BY u.id, u.name;`}
84-
/>
96+
/>}
97+
</BrowserOnly>
8598

8699
## Try Your Own Queries
87100

src/components/InlineCodeBlock/index.tsx

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,7 @@ export default function InlineCodeBlock({
1717
language = 'rql',
1818
forceViewer = false
1919
}: InlineCodeBlockProps) {
20-
const [isMobile, setIsMobile] = useState(() => {
21-
// Check if we're on the server (SSR)
22-
if (typeof window === 'undefined') {
23-
return false; // Default to desktop during SSR
24-
}
25-
// Initial client-side check
26-
const hasTouch = 'ontouchstart' in window || navigator.maxTouchPoints > 0;
27-
const isSmallScreen = window.innerWidth <= 768;
28-
return hasTouch || isSmallScreen;
29-
});
20+
const [isMobile, setIsMobile] = useState(false);
3021

3122
useEffect(() => {
3223
// Check if device is mobile on mount and window resize

src/pages/index.tsx

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,11 @@ import React from 'react';
22
import Link from '@docusaurus/Link';
33
import Layout from '@theme/Layout';
44
import CodeBlock from '@theme/CodeBlock';
5+
import BrowserOnly from '@docusaurus/BrowserOnly';
56
import AnimatedText from '@site/src/components/AnimatedText';
67
import Card from '@site/src/components/Card';
7-
import InlineCodeBlock from "@components/InlineCodeBlock";
8-
import InlineViewer from "@components/InlineViewer";
8+
import InlineCodeBlock from "@site/src/components/InlineCodeBlock";
9+
import InlineViewer from "@site/src/components/InlineViewer";
910

1011
function HomepageHeader() {
1112
return (
@@ -75,7 +76,9 @@ create deferred view demo.adults {
7576
automatically update when data changes</p>
7677
</div>
7778
<div className="grid lg:grid-cols-2 gap-8">
78-
<InlineViewer query={exampleCode}/>
79+
<BrowserOnly fallback={<div>Loading...</div>}>
80+
{() => <InlineViewer query={exampleCode}/>}
81+
</BrowserOnly>
7982
<div className="grid gap-4">
8083

8184
<div className="card-clean">

0 commit comments

Comments
 (0)