commit 9b97a712c95dbfe5d7f544adf6d3e7a23be004b3 Author: Marek Piasecki Date: Mon Jan 9 10:15:16 2023 +0100 Sketch of needed components diff --git a/router_tag.imba b/router_tag.imba new file mode 100644 index 0000000..550bac6 --- /dev/null +++ b/router_tag.imba @@ -0,0 +1,39 @@ +require('pro-router') + +tag router + def render + <{ view }> + +tag switch + prop key + prop disabled + + css cursor:pointer + + def render + + +tag ref < a + prop view + prop target + prop go + + def render + + + def active? + R.to_path == link + + get link do #link ||= go || url + + #tu skonczylem: + + def url + if target + let attributes = L.reduce L.concat({}, target), do |map, el| + map[el:type] = el:id + map + R.to_path view, L.defaults attributes || {}, R:safe_params + +tag not_found + def render do "Page not found :/"