Skip to content

Commit a4644e9

Browse files
authored
Merge pull request #7 from shashi089/react-demo-document
added document in react demo app
2 parents 962f4bc + f979ac8 commit a4644e9

5 files changed

Lines changed: 637 additions & 203 deletions

File tree

examples/react-demo/src/App.css

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,18 @@
1+
html,
2+
body {
3+
height: auto;
4+
overflow-y: auto;
5+
overflow-x: hidden;
6+
margin: 0;
7+
padding: 0;
8+
}
9+
110
#root {
211
width: 100%;
3-
height: 100vh;
12+
min-height: 100vh;
413
margin: 0;
514
padding: 0;
15+
overflow: visible;
616
}
717

818
.designer-container {

examples/react-demo/src/App.tsx

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,12 @@ import 'qrlayout-ui/style.css';
55
import './App.css';
66
import { LabelList } from './features/labels/LabelList';
77
import { storage } from './services/storage';
8-
import { ArrowLeft, Tag, Users, Cpu, Home, Package, Github } from 'lucide-react';
8+
import { ArrowLeft, Tag, Users, Cpu, Home, Package, Github, BookOpen } from 'lucide-react';
99
import { EmployeeMaster } from './features/employees/EmployeeMaster';
1010
import { MachineMaster } from './features/machines/MachineMaster';
1111
import { BinMaster } from './features/storage/BinMaster';
1212
import { LandingPage } from './features/home/LandingPage';
13+
import { DocsPage } from './features/docs/DocsPage';
1314

1415
// ... (Existing SAMPLE_SCHEMAS and DEFAULT_NEW_LAYOUT remain unchanged)
1516

@@ -73,7 +74,7 @@ const DEFAULT_NEW_LAYOUT: Omit<StickerLayout, 'id'> = {
7374
elements: []
7475
};
7576

76-
type MainView = 'home' | 'labels' | 'employees' | 'machines' | 'storage';
77+
type MainView = 'home' | 'docs' | 'labels' | 'employees' | 'machines' | 'storage';
7778
type SubView = 'list' | 'designer';
7879

7980
function App() {
@@ -187,9 +188,9 @@ function App() {
187188
</h1>
188189
<div className="flex items-center gap-2">
189190
<p className="text-[10px] sm:text-xs text-gray-500 hidden sm:block">by</p>
190-
<a
191-
href="https://github.com/shashi089"
192-
target="_blank"
191+
<a
192+
href="https://github.com/shashi089"
193+
target="_blank"
193194
rel="noopener noreferrer"
194195
className="text-[10px] sm:text-xs font-medium text-blue-600 hover:text-blue-700 transition-colors"
195196
>
@@ -227,6 +228,16 @@ function App() {
227228
<Home size={18} />
228229
<span className="hidden md:inline">Home</span>
229230
</button>
231+
<button
232+
onClick={() => handleMainViewChange('docs')}
233+
className={`flex items-center gap-2 px-4 py-2 font-semibold transition-all duration-200 rounded-lg cursor-pointer ${mainView === 'docs'
234+
? 'bg-white text-blue-600 shadow-sm'
235+
: 'text-gray-600 hover:text-gray-900 hover:bg-white/50'
236+
}`}
237+
>
238+
<BookOpen size={18} />
239+
<span className="hidden sm:inline">Docs</span>
240+
</button>
230241
<button
231242
onClick={() => handleMainViewChange('labels')}
232243
className={`flex items-center gap-2 px-4 py-2 font-semibold transition-all duration-200 rounded-lg cursor-pointer ${mainView === 'labels'
@@ -267,6 +278,7 @@ function App() {
267278
<Package size={18} />
268279
<span className="hidden sm:inline">Storage</span>
269280
</button>
281+
270282
</nav>
271283
</div>
272284

@@ -312,6 +324,8 @@ function App() {
312324
<EmployeeMaster />
313325
) : mainView === 'machines' ? (
314326
<MachineMaster />
327+
) : mainView === 'docs' ? (
328+
<DocsPage />
315329
) : (
316330
<BinMaster />
317331
)}

0 commit comments

Comments
 (0)