Skip to content

Commit 39024a6

Browse files
committed
cleanup
1 parent 1165f45 commit 39024a6

File tree

1 file changed

+22
-49
lines changed

1 file changed

+22
-49
lines changed

Diff for: pages/new.tsx

+22-49
Original file line numberDiff line numberDiff line change
@@ -1,58 +1,31 @@
11
import type { NextPage } from 'next'
2-
import SculptureCard from "../components/sculptureCard"
3-
import firebaseApp from '../firebase/clientApp'
42
import { Sandpack } from "@codesandbox/sandpack-react";
53
import { minimalRendererIndexHTML, shaderParkStartCode, minimalRendererCSS } from '../components/spStarterTempaltes';
64

7-
import { ref, getDatabase, query, orderByChild } from 'firebase/database';
8-
import { useList } from 'react-firebase-hooks/database';
9-
10-
const database = getDatabase(firebaseApp);
11-
125
const Explore: NextPage = () => {
13-
14-
var dbRef = ref(database, 'sculptures')
15-
// const dbQuery = dbRef.orderBy("timestamp");
16-
const mostViewedPosts = query(dbRef, orderByChild('favorites'));
17-
18-
19-
// let [snapshots, loading, error] = useList(ref(database, 'sculptures'));
20-
let [snapshots, loading, error] = useList(mostViewedPosts);
21-
if(!loading && snapshots) {
22-
23-
snapshots = snapshots?.reverse().slice(0, 100);
24-
console.log(snapshots[0].val())
25-
return (
26-
// <Sandpack />
27-
<Sandpack
28-
template="static"
29-
files={{
30-
"/index.html": minimalRendererIndexHTML,
31-
"/spCode.txt": shaderParkStartCode,
32-
"/styles.css" : minimalRendererCSS
6+
return (
7+
<Sandpack
8+
template="static"
9+
files={{
10+
"/index.html": minimalRendererIndexHTML,
11+
"/spCode.txt": shaderParkStartCode,
12+
"/styles.css" : minimalRendererCSS
3313
}}
34-
options={{
35-
// visibleFiles: ["/spCode.js", "/index.html", "/style.css"],
36-
visibleFiles: ["/spCode.txt"],
37-
initMode: "immediate",
38-
activeFile: "/spCode.txt",
39-
showLineNumbers: true, // default - true
40-
showInlineErrors: true, // default - false
41-
recompileMode: 'immediate',
42-
// recompileDelay: 300,
43-
// wrapContent: true, // default - false
44-
editorHeight: 800, // default - 300
45-
editorWidthPercentage: 50, // default - 50
46-
}}
47-
/>
48-
)
49-
50-
} else {
51-
return (
52-
<span>List: Loading...</span>
53-
)
54-
}
55-
14+
options={{
15+
// visibleFiles: ["/spCode.js", "/index.html", "/style.css"],
16+
visibleFiles: ["/spCode.txt"],
17+
initMode: "immediate",
18+
activeFile: "/spCode.txt",
19+
showLineNumbers: true, // default - true
20+
showInlineErrors: true, // default - false
21+
recompileMode: 'immediate',
22+
// recompileDelay: 300,
23+
// wrapContent: true, // default - false
24+
editorHeight: 800, // default - 300
25+
editorWidthPercentage: 50, // default - 50
26+
}}
27+
/>
28+
)
5629
}
5730

5831
export default Explore

0 commit comments

Comments
 (0)