Skip to content

Commit

Permalink
fix: android deployment
Browse files Browse the repository at this point in the history
Signed-off-by: Kimi Yap <[email protected]>
  • Loading branch information
ItsMeKimi authored and achrinza committed Jul 31, 2024
1 parent 75c14db commit 2d04c2f
Show file tree
Hide file tree
Showing 12 changed files with 160 additions and 93 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,6 @@ packages/frontend/assets/*
.\#*
.m2
dist/
packages/frontend/android/
packages/frontend/ios/
packages/frontend/dist
20 changes: 20 additions & 0 deletions packages/frontend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion packages/frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
"react-native-reanimated": "~3.10.1",
"react-native-safe-area-context": "4.10.5",
"react-native-screens": "3.31.1",
"react-native-web": "^0.19.10"
"react-native-web": "^0.19.10",
"@types/react": "~18.2.79"
}
}
6 changes: 3 additions & 3 deletions packages/frontend/src/main/component/helplines.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
(map (fn [{name :name
contact :contact
operating-hours :operating-hours}]
[:> rn/Pressable {:style {:flexDirection :row
[:> rn/Pressable {:style {:flexDirection "row"
:alignItems "center"
:justifyContent "space-between"
:padding 10}
Expand All @@ -21,9 +21,9 @@
[:> rn/Text name]
[:> rn/Text {:style {:color "#a5a5a5"}}
contact " · " operating-hours]]
[:> FontAwesome5 {:name :phone
[:> FontAwesome5 {:name "phone"
:size 24
:color :black}]]))
:color "black"}]]))
(into [:> rn/View]))])

(defn helplines [streamlined-svc-mode]
Expand Down
63 changes: 47 additions & 16 deletions packages/frontend/src/main/frontend/app.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,32 @@
[:> navigator {:initialRouteName "Home"
:screenOptions {:headerShown false}}
[:> screen {:name "Home"
:component (r/reactify-component home-screen)}]
:component (r/reactify-component home-screen)
:options {:headerShown false
:tabBarIcon #(let [{size :size
color :color} (js->clj % {:keywordize-keys true})]
(-> [:> FontAwesome5 {:name "home"
:color color
:size size}]
(r/as-element)))}}]
[:> screen {:name "SOS"
:component (r/reactify-component sos-screen)}]
:component (r/reactify-component sos-screen)
:options {:headerShown false
:tabBarIcon #(let [{size :size
color :color} (js->clj % {:keywordize-keys true})]
(-> [:> MaterialIcons {:name "sos"
:color color
:size size}]
(r/as-element)))}}]
[:> screen {:name "Resources"
:component (r/reactify-component resources-screen)}]]))
:component (r/reactify-component resources-screen)
:options {:headerShown false
:tabBarIcon #(let [{size :size
color :color} (js->clj % {:keywordize-keys true})]
(-> [:> MaterialIcons {:name "message"
:color color
:size size}]
(r/as-element)))}}]]))

(defn root []
(let [user-mode @(rf/subscribe [:user-mode])
Expand Down Expand Up @@ -60,19 +81,19 @@
(assoc :categories {:self
{:name "Self"
:color "#FFF7D6"
:image (js/require "../assets/home_explore_self.svg")}
:image (js/require "../assets/home_explore_self.png")}
:self-card
{:name "Self-Care"
:color "#DDE5FF"
:image (js/require "../assets/home_explore_self_care.svg")}
:image (js/require "../assets/home_explore_self_care.png")}
:mental-health
{:name "About Mental Health"
:color "#DEF7E5"
:image (js/require "../assets/home_explore_mental_health.svg")}
:image (js/require "../assets/home_explore_mental_health.png")}
:other
{:name "About Others"
:color "#FFE7E7"
:image (js/require "../assets/home_explore_others.svg")}})
:image (js/require "../assets/home_explore_others.png")}})
(assoc :helpline-groups {:general {:displayName "General Mental Well-being"}
:ns {:displayName "Service Helplines"}})
(assoc :helplines [{:name "Institute of Mental Health"
Expand All @@ -90,19 +111,29 @@
:operating-hours "Weekdays 9am-5pm"}])
(assoc :mindful-pause {:audio
[{:name "Breathe"
:audio-file (js/require "../assets/mindful_minutes/breathe.mp3")
;:audio-file (js/require "../assets/mindful_minutes/breathe.mp3")
:audio-file (js/require "../assets/love_wins_all.mp3") ;since I dont have the other audios yet on 290724
:icon [:> evi/MaterialIcons {:name "air"
:size "20px"
:color "#A5A5A5"}]}
:size 20
:color "#A5A5A5"}]}
{:name "Take a sip of tea"
:audio-file (js/require "../assets/mindful_minutes/sip_tea.mp3")
:icon [:> evi/SimpleLineIcons {:name "cup" :size "20px" :color "#A5A5A5"}]}
;:audio-file (js/require "../assets/mindful_minutes/sip_tea.mp3")
:audio-file (js/require "../assets/love_wins_all.mp3") ;since I dont have the other audios yet on 290724
:icon [:> evi/SimpleLineIcons {:name "cup"
:size 20
:color "#A5A5A5"}]}
{:name "Take a walk"
:audio-file "../assets/mindful_minutes/sip_tea.mp3"
:icon [:> evi/MaterialIcons {:name "directions-walk" :size "20px" :color "#A5A5A5"}]}
;:audio-file "../assets/mindful_minutes/sip_tea.mp3"
:audio-file (js/require "../assets/love_wins_all.mp3") ;since I dont have the other audios yet on 290724
:icon [:> evi/MaterialIcons {:name "directions-walk"
:size 20
:color "#A5A5A5"}]}
{:name "Look at the sky"
:audio-file "../assets/mindful_minutes/observe_sky.mp3"
:icon [:> evi/MaterialIcons {:name "cloud" :size "20px" :color "#A5A5A5"}]}]}))))
;:audio-file "../assets/mindful_minutes/observe_sky.mp3"
:audio-file (js/require "../assets/love_wins_all.mp3") ;since I dont have the other audios yet on 290724
:icon [:> evi/MaterialIcons {:name "cloud"
:size 20
:color "#A5A5A5"}]}]}))))

(rf/reg-sub
:user
Expand Down
17 changes: 12 additions & 5 deletions packages/frontend/src/main/screen/auth.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -11,23 +11,30 @@
:paddingRight 30
:minWidth 20
:borderRadius 8
:border "2px solid #2A4E4C"
:borderWidth 1
:borderColor "#2A4E4C"
:borderStyle "solid"
:textAlign "center"}

:btn-primary
{:background "#2A4E4C"
{:backgroundColor "#2A4E4C"
:color "#FFF"}

:btn-secondary
{:border "2px solid #2A4E4C"}
{;:border "2px solid #2A4E4C"
:borderRadius 8
:borderWidth 1
:borderStyle "solid"
:borderColor "#2A4E4C"}

:auth-screen
{:position "relative"
:height "100%"}

:auth-logo-container
{:justifyContent "center"
:alignItems "center"}
{:justifyContent "flex-end"
:alignItems "center"
:height "50%"}

:auth-selection
{:width "100%"
Expand Down
12 changes: 7 additions & 5 deletions packages/frontend/src/main/screen/explore.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -47,15 +47,16 @@
(filter (fn [{article-category :category}]
(= article-category category)))
(map (fn [{title :title mdText :mdText :as article}]
[:> rn/Pressable {:style {:backgroundColor :white
[:> rn/Pressable {:style {:backgroundColor "white"
:borderRadius 12
:overflow "hidden"
:marginBottom 10
;:marginBottom 10
:marginLeft 20
:marginRight 20
:height 32
:flex 1
:alignItems :center}
:alignItems "center"
:justifyContent "center"
:height 32}
:onPress #(navigation.navigate "Article" {:article article})}
[:> rn/Text {:style {:fontSize 16
:paddingLeft 10
Expand All @@ -64,5 +65,6 @@
(into [:> rn/View
[:> rn/Text {:style {:fontSize 24
:marginLeft 20
:marginRight 20}}
:marginRight 20
:marginBottom 5}}
"Articles"]]))]))
55 changes: 27 additions & 28 deletions packages/frontend/src/main/screen/home.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
["react-native" :as rn]))

(defn section [title child]
[:> rn/View {:style {:margin :10px}}
[:> rn/Text {:style {:fontWeight :bold
:color :#2A4E4C
:marginBottom :10px}}
[:> rn/View {:style {:margin 10}}
[:> rn/Text {:style {:fontWeight "bold"
:color "#2A4E4C"
:marginBottom 10}}
title]
child])

Expand All @@ -27,7 +27,7 @@
:padding 15
:width 160
:height 160
:alignItems :center}
:alignItems "center"}
:onPress #(nav.navigate "Explore" #js{:category category})}
[:> rn/Text {:style {:textAlign "right"
:fontWeight "bold"
Expand All @@ -46,76 +46,75 @@
(into [:> rn/ScrollView {:horizontal true}]))))

(defn activities [navigation]
[:> rn/Pressable {:style {:background "#FFE7E7"
:padding "15px"
[:> rn/Pressable {:style {:backgroundColor "#FFE7E7"
:padding 15
:borderRadius 6
:flexDirection "row"
:alignItems "center"
:gap 5
:minHeight "20px"}
:minHeight 20}
:onPress #(navigation.navigate "MindfulPause")}
[:> rn/Image {:style {:flex 2
:resizeMode "contain"
[:> rn/Image {:style {:flex 3
:height "100%"
:maxHeight "50px"}
:source (js/require "../assets/home_mindful_minutes.svg")}]
:maxHeight "20vh"}
:source (js/require "../assets/home_mindful_minutes.png")}]
[:> rn/View {:style {:flex 5}}
[:> rn/Text {:style {:color "#2A4E4C"
:fontWeight "bold"}}
:fontWeight :bold}}
"Overwhelmed and unable to focus?"]
[:> rn/Text {:style {:color "#2A4E4C"}}
"Take this mindful pause for a 5 minute break"]]])

(defn quote-of-the-day []
[:> rn/View {:style {:alignItems "center"
:flexDirection "row"
:background "#2A4E4C"
:padding "15px"
:backgroundColor "#2A4E4C"
:padding 15
:borderRadius 6}}
[:> evi/FontAwesome5 {:name "quote-right"
:size 24
:color "white"
:style {:paddingRight "12px"}}]
[:> rn/Text {:style {:color :white}}
:style {:paddingRight 12}}]
[:> rn/Text {:style {:color "white"}}
"Just because no one else can heal or do your inner work for you, doesn't mean you can, should, or need to do it alone."]])

(defn greeting []
(let [user-name @(rf/subscribe [:user])]
[:> rn/Text {:style {:fontSize 24
:fontWeight "bold"
:paddingLeft "15px"
:paddingRight "15px"
:paddingLeft 15
:paddingRight 15
:color "#2A4E4C"}}
"Hey, " (if (= nil user-name) "Guest", user-name) "!"]))

(defn daily-feeling-scale []
(let [feeling-rating @(rf/subscribe [:user-feeling-scale/rating])
feeling-ratings ["frown-open" "frown" "meh" "smile" "smile-beam"]]
[:> rn/View {:style {:padding :15px}}
[:> rn/View {:style {:padding 15}}
[:> rn/Text "How are you feeling today?"]
(->> feeling-ratings
(map-indexed (fn [index, icon-name]
[:> rn/Pressable {:onPress #(rf/dispatch [:user-feeling-scale/set-rating index])
:style {:borderRadius 8
:padding "10px"
:background (when (= index feeling-rating) "#B7DBD9")}}
:padding 10
:backgroundColor (when (= index feeling-rating) "#B7DBD9")}}
[:> evi/FontAwesome5 {:name icon-name
:size 32
:color "#000"}]]))

(reverse)
(into [:> rn/View {:style {:flex 1
:flexDirection "row"
:justify-content "space-around"
:padding "10px"}}]))]))
:justifyContent "space-around"
:padding 10}}]))]))

(defn home-screen-inner [{navigation :navigation}]
[:> rn/ScrollView
[:> rn/View {:style {:flex 1
:align-items :stretch
:paddingTop "50px"
:paddingLeft "5px"
:paddingRight "5px"}}
:alignItems "stretch"
:paddingTop 50
:paddingLeft 5
:paddingRight 5}}
[greeting]
[daily-feeling-scale]
[section "Quote of the day"
Expand Down
Loading

0 comments on commit 2d04c2f

Please sign in to comment.