Skip to content

Commit 60897bf

Browse files
committed
empty breakdown
1 parent 30297d9 commit 60897bf

23 files changed

+214
-34
lines changed
+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.comp-icon-button {}
+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import './index.css';
2+
3+
interface IconButtonProps {
4+
btnLabel: string;
5+
onClick?: () => void;
6+
iconClass?: string;
7+
btnClass?: string; //for primary, secondary, etc. color buttons
8+
9+
}
10+
11+
const IconButton = ({ iconClass, btnLabel, onClick, btnClass }: IconButtonProps) => {
12+
return <div className={`comp-icon-button ${iconClass} ${btnClass}`} onClick={onClick}>{btnLabel}</div>
13+
}
14+
15+
export default IconButton;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.card-footer {}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import './CardFooter.css';
2+
3+
interface CardFooterProps {
4+
footerText: string;
5+
}
6+
7+
const CardFooter = ({ footerText }: CardFooterProps) => {
8+
return <div className="card-footer">{footerText}</div>
9+
}
10+
11+
export default CardFooter;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.card-header {}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import './CardHeader.css';
2+
3+
interface CardHeaderProps {
4+
headerTitle: string;
5+
infoIconContent?: string;
6+
showCopyIcon?: boolean;
7+
}
8+
9+
const CardHeader = ({ headerTitle, infoIconContent, showCopyIcon }: CardHeaderProps) => {
10+
return <div className="card-header">
11+
<div className="card-header-title">{headerTitle}</div>
12+
{infoIconContent && <div className="card-header-info-icon">{infoIconContent}</div>}
13+
{showCopyIcon && <div className="card-header-copy-icon">Copy</div>}
14+
</div>
15+
}
16+
17+
export default CardHeader;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.data-source-card {}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import CardFooter from './CardFooter';
2+
import CardHeader from './CardHeader';
3+
import './DataSourceCard.css';
4+
5+
interface DataSourceCardProps {
6+
dataSourceId: string;
7+
}
8+
9+
const labels = {
10+
infoIconContent: 'A data source is a collection of data that we want to search.',
11+
headerTitle: 'Data Source',
12+
footerText: 'Displaying 100 of 10000 records.',
13+
}
14+
15+
const DataSourceCard = ({ dataSourceId }: DataSourceCardProps) => {
16+
return <div className="data-source-card">
17+
<CardHeader headerTitle={labels.headerTitle} showCopyIcon={true} infoIconContent={labels.infoIconContent} />
18+
19+
<div className="data-source-id">{dataSourceId}</div>
20+
21+
<CardFooter footerText={labels.footerText} />
22+
</div>
23+
}
24+
25+
export default DataSourceCard;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.db-index-card {}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import CardHeader from './CardHeader';
2+
import './DbIndexCard.css';
3+
4+
interface DbIndexCardProps {
5+
dbIndexId: string;
6+
}
7+
8+
const labels = {
9+
infoIconContent: 'To search data in Redis, we must create an index.',
10+
headerTitle: 'DB Index',
11+
}
12+
13+
const DbIndexCard = ({ dbIndexId }: DbIndexCardProps) => {
14+
return <div className="db-index-card">
15+
<CardHeader headerTitle={labels.headerTitle} showCopyIcon={true} infoIconContent={labels.infoIconContent} />
16+
<div className="db-index-id">{dbIndexId}</div>
17+
</div>
18+
}
19+
20+
export default DbIndexCard;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.query-card {}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import CardHeader from './CardHeader';
2+
import './QueryCard.css';
3+
4+
interface QueryCardProps {
5+
queryId: string;
6+
query: string;
7+
}
8+
9+
const labels = {
10+
infoIconContent: 'Try different queries to see how your data changes.',
11+
headerTitle: 'Query',
12+
}
13+
14+
const QueryCard = ({ queryId, query }: QueryCardProps) => {
15+
return <div className="query-card">
16+
<CardHeader headerTitle={labels.headerTitle} showCopyIcon={true} infoIconContent={labels.infoIconContent} />
17+
<div className="query-id">{queryId}</div>
18+
<div className="query">{query}</div>
19+
</div>
20+
}
21+
22+
export default QueryCard;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.result-card {}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
import CardFooter from './CardFooter';
2+
import CardHeader from './CardHeader';
3+
import './ResultCard.css';
4+
5+
6+
interface ResultCardProps {
7+
data: any;
8+
error: any;
9+
}
10+
11+
const labels = {
12+
infoIconContent: 'A result is a collection of data that we want to search.',
13+
headerTitle: 'Result',
14+
footerText: 'No results found.',
15+
}
16+
17+
const ResultCard = ({ data, error }: ResultCardProps) => {
18+
return <div className="result-card">
19+
<CardHeader headerTitle={labels.headerTitle} showCopyIcon={true} infoIconContent={labels.infoIconContent} />
20+
21+
<div>{data}</div>
22+
<div>{error}</div>
23+
24+
<CardFooter footerText={labels.footerText} />
25+
</div>
26+
}
27+
28+
export default ResultCard;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.card-panel {}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import QueryCard from "./QueryCard";
2+
import DbIndexCard from "./DbIndexCard";
3+
import DataSourceCard from "./DataSourceCard";
4+
import ResultCard from "./ResultCard";
5+
6+
import './index.css';
7+
8+
const PgCardPanel = () => {
9+
return <div className="card-panel">
10+
<QueryCard queryId="1" query="SELECT * FROM users" />
11+
<DbIndexCard dbIndexId="1" />
12+
<DataSourceCard dataSourceId="1" />
13+
<ResultCard data="data" error="error" />
14+
</div>
15+
}
16+
17+
export default PgCardPanel;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.pg-header {}
+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import './index.css';
2+
3+
import IconButton from '@/app/components/IconButton';
4+
5+
const labels = {
6+
title: 'Redis Playground',
7+
btnRun: 'Run',
8+
btnReset: 'Reset',
9+
btnShare: 'Share',
10+
}
11+
12+
const PgHeader = () => {
13+
return <div className="pg-header">
14+
15+
<div className="pg-header-title">{labels.title}</div>
16+
<IconButton btnLabel={labels.btnRun} iconClass="fa fa-play" btnClass="pg-header-run-btn" />
17+
<IconButton btnLabel={labels.btnReset} iconClass="fa fa-refresh" />
18+
<IconButton btnLabel={labels.btnShare} iconClass="fa fa-share" />
19+
</div>
20+
}
21+
22+
export default PgHeader;
+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
.pg-container {
2+
display: flex;
3+
flex-grow: 1;
4+
background-color: #ac2c2c;
5+
font-size: var(--font-size-12);
6+
overflow: hidden;
7+
}
+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
"use client";
2+
3+
import "./Playground.css";
4+
5+
import React from "react";
6+
7+
import PgHeader from "./PgHeader";
8+
import PgCardPanel from "./PgCardPanel";
9+
10+
function Playground() {
11+
return (
12+
<div className="pg-container">
13+
<PgHeader />
14+
<PgCardPanel />
15+
</div>
16+
);
17+
}
18+
19+
export default Playground;

src/app/page.module.css

-19
This file was deleted.

src/app/page.tsx

+2-15
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,7 @@
1-
import Image from "next/image";
2-
import styles from "./page.module.css";
1+
import Playground from "./page-components/Playground";
32

43
export default function Home() {
54
return (
6-
<main className={styles.main}>
7-
8-
<div className={styles.center}>
9-
<Image
10-
className={styles.logo}
11-
src="/redis.png"
12-
alt="Redis Logo"
13-
width={250}
14-
height={79}
15-
priority
16-
/>
17-
</div>
18-
</main>
5+
<Playground />
196
);
207
}

src/app/playground/index.ts

Whitespace-only changes.

0 commit comments

Comments
 (0)