25 | {/* Header Section */}
26 |
27 |
28 |
29 | Koka Todo Demo
30 |
31 |
32 | Experience a modern Todo application built with Koka framework, supporting both single and
33 | multiple Todo list management
34 |
35 |
36 |
37 | {/* Mode Toggle Buttons */}
38 |
39 |
40 |
53 |
66 |
67 |
68 |
69 |
70 | {/* Content Section */}
71 |
72 | {mode === 'todo-app-list' ? (
73 |
74 | {Array.from({ length: count }).map((_, index) => {
75 | const todoApp$ = new TodoAppDomain(props.domain.select((app) => app.todoAppList[index]))
76 |
77 | return (
78 |
82 |
83 |
84 | #{index + 1}
85 |
86 |
87 |
88 |
89 | )
90 | })}
91 |
92 | ) : (
93 |
98 | )}
99 |
100 |
101 | {/* Footer */}
102 |
103 |
104 |
105 | 🚀 Built with Koka framework | 💡 Powered
106 | by React +{' '}
107 | Tailwind CSS
108 |
109 |
110 |
111 |
112 | )
113 | }
114 |
115 | const initialState: AppState = {
116 | todoApp: {
117 | todos: [
118 | { id: 101, text: 'Learn koka-domain framework', done: true },
119 | { id: 102, text: 'Build React todo app', done: true },
120 | { id: 103, text: 'Write comprehensive documentation', done: false },
121 | { id: 104, text: 'Add unit tests', done: false },
122 | { id: 105, text: 'Optimize performance', done: false },
123 | { id: 106, text: 'Deploy to production', done: false },
124 | ],
125 | input: '',
126 | filter: 'all',
127 | },
128 | todoAppList: [
129 | {
130 | todos: [
131 | { id: 101, text: 'Learn koka-domain framework', done: true },
132 | { id: 102, text: 'Build React todo app', done: true },
133 | { id: 103, text: 'Write comprehensive documentation', done: false },
134 | { id: 104, text: 'Add unit tests', done: false },
135 | { id: 105, text: 'Optimize performance', done: false },
136 | { id: 106, text: 'Deploy to production', done: false },
137 | ],
138 | input: '',
139 | filter: 'all',
140 | },
141 | {
142 | todos: [
143 | { id: 201, text: 'Buy groceries', done: false },
144 | { id: 202, text: 'Cook dinner', done: false },
145 | { id: 203, text: 'Clean the house', done: true },
146 | { id: 204, text: 'Do laundry', done: false },
147 | { id: 205, text: 'Take out trash', done: true },
148 | ],
149 | input: '',
150 | filter: 'undone',
151 | },
152 | {
153 | todos: [
154 | { id: 301, text: 'Read "Clean Code" book', done: true },
155 | { id: 302, text: 'Practice coding challenges', done: false },
156 | { id: 303, text: 'Learn TypeScript advanced features', done: false },
157 | { id: 304, text: 'Study design patterns', done: true },
158 | { id: 305, text: 'Contribute to open source', done: false },
159 | { id: 306, text: 'Attend tech meetup', done: false },
160 | { id: 307, text: 'Update portfolio', done: true },
161 | ],
162 | input: '',
163 | filter: 'done',
164 | },
165 | {
166 | todos: [
167 | { id: 401, text: 'Morning workout', done: true },
168 | { id: 402, text: 'Meditation session', done: false },
169 | { id: 403, text: 'Drink 8 glasses of water', done: false },
170 | { id: 404, text: 'Take vitamins', done: true },
171 | { id: 405, text: 'Go for a walk', done: false },
172 | { id: 406, text: 'Get 8 hours of sleep', done: false },
173 | ],
174 | input: '',
175 | filter: 'all',
176 | },
177 | {
178 | todos: [
179 | { id: 501, text: 'Plan weekend trip', done: false },
180 | { id: 502, text: 'Book flight tickets', done: false },
181 | { id: 503, text: 'Reserve hotel room', done: false },
182 | { id: 504, text: 'Create travel itinerary', done: false },
183 | { id: 505, text: 'Pack luggage', done: false },
184 | ],
185 | input: '',
186 | filter: 'all',
187 | },
188 | ],
189 | }
190 |
191 | const store = new Domain.Store