-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Rifa Achrinza <[email protected]>
- Loading branch information
Showing
3 changed files
with
94 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
(ns screen.article | ||
(:require [reagent.core :as r] | ||
["react-native" :as rn])) | ||
|
||
(defn article-screen [{{params :params} :route}] | ||
(let [{title :title sections :section} (js->clj (.-article params))] | ||
(->> sections | ||
(map (fn [{title :title body :body}] | ||
[:> rn/View | ||
[:> rn/Text {:style {:fontSize "24px" | ||
:marginTop "10px"}} | ||
title] | ||
[:> rn/Text body]])) | ||
(into [:> rn/ScrollView])))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
(ns screen.explore | ||
(:require [reagent.core :as r] | ||
["react-native" :as rn])) | ||
|
||
(defn explore-screen [{navigation :navigation route :route}] | ||
(let [category (js->clj (.-category (.-params route))) | ||
categories {:self {:name "About Self"}} | ||
articles [{:title "Know Your Personality" | ||
:category :self | ||
:sections [{:title "Lorem Ipsum" | ||
:body "Sit Amet."}]}]] | ||
[:> rn/ScrollView | ||
[:> rn/Text | ||
(categories (keyword category))]] | ||
|
||
(->> articles | ||
(filter (fn [{article-category :category}] | ||
(= article-category category))) | ||
(map (fn [{title :title :as article}] | ||
[:> rn/Pressable {:style {:background "#FFF" | ||
:borderRadius "12px" | ||
:marginBottom "10px"} | ||
:onPress #(navigation.navigate "Article" (clj->js {:article article}))} | ||
[:> rn/Text title]])) | ||
(into [:> rn/View | ||
[:> rn/Text {:style {:fontSize "24px"}} | ||
"Articles"]])))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters