Compare commits

..

No commits in common. "e857e4416500b7a356a6772aa0b7e825ec2e2545" and "f67201b35e4adcac27e23715a94fc76882e2b251" have entirely different histories.

2 changed files with 36 additions and 55 deletions

View file

@ -1,140 +1,120 @@
use napi_derive::napi; use napi_derive::napi;
use church_core; use church_core;
use church_core::api;
#[napi] #[napi]
pub fn get_church_name() -> String { pub fn get_church_name() -> String {
church_core::uniffi::config::get_church_name() api::get_church_name()
} }
#[napi] #[napi]
pub fn fetch_events_json() -> String { pub fn fetch_events_json() -> String {
church_core::uniffi::events::fetch_events_json() api::fetch_events_json()
} }
#[napi] #[napi]
pub fn fetch_featured_events_json() -> String { pub fn fetch_featured_events_json() -> String {
church_core::uniffi::events::fetch_featured_events_json() api::fetch_featured_events_json()
} }
#[napi] #[napi]
pub fn fetch_sermons_json() -> String { pub fn fetch_sermons_json() -> String {
church_core::uniffi::sermons::fetch_sermons_json() api::fetch_sermons_json()
} }
#[napi] #[napi]
pub fn fetch_config_json() -> String { pub fn fetch_config_json() -> String {
church_core::uniffi::config::fetch_config_json() api::fetch_config_json()
}
#[napi]
pub fn update_config_json(config_json: String) -> String {
// This one doesn't exist in uniffi yet - TODO: add it or implement here
serde_json::json!({"success": false, "error": "Not implemented yet"}).to_string()
} }
#[napi] #[napi]
pub fn get_mission_statement() -> String { pub fn get_mission_statement() -> String {
church_core::uniffi::config::get_mission_statement() api::get_mission_statement()
} }
#[napi] #[napi]
pub fn fetch_random_bible_verse_json() -> String { pub fn fetch_random_bible_verse_json() -> String {
church_core::uniffi::bible::fetch_random_bible_verse_json() api::fetch_random_bible_verse_json()
} }
#[napi] #[napi]
pub fn get_stream_live_status() -> bool { pub fn get_stream_live_status() -> bool {
church_core::uniffi::streaming::get_stream_live_status() api::get_stream_live_status()
} }
#[napi] #[napi]
pub fn get_livestream_url() -> String { pub fn get_livestream_url() -> String {
church_core::uniffi::streaming::get_livestream_url() api::get_livestream_url()
} }
#[napi] #[napi]
pub fn get_church_address() -> String { pub fn get_church_address() -> String {
church_core::uniffi::config::get_church_address() api::get_church_address()
} }
#[napi] #[napi]
pub fn get_church_physical_address() -> String { pub fn get_church_physical_address() -> String {
// This might need to be implemented in uniffi::config api::get_church_physical_address()
church_core::uniffi::config::get_church_address()
} }
#[napi] #[napi]
pub fn get_church_po_box() -> String { pub fn get_church_po_box() -> String {
// This might need to be implemented in uniffi::config - for now return empty api::get_church_po_box()
"".to_string()
} }
#[napi] #[napi]
pub fn get_contact_phone() -> String { pub fn get_contact_phone() -> String {
church_core::uniffi::config::get_contact_phone() api::get_contact_phone()
} }
#[napi] #[napi]
pub fn get_contact_email() -> String { pub fn get_contact_email() -> String {
church_core::uniffi::config::get_contact_email() api::get_contact_email()
} }
#[napi] #[napi]
pub fn get_facebook_url() -> String { pub fn get_facebook_url() -> String {
church_core::uniffi::config::get_facebook_url() api::get_facebook_url()
} }
#[napi] #[napi]
pub fn get_youtube_url() -> String { pub fn get_youtube_url() -> String {
church_core::uniffi::config::get_youtube_url() api::get_youtube_url()
} }
#[napi] #[napi]
pub fn get_instagram_url() -> String { pub fn get_instagram_url() -> String {
church_core::uniffi::config::get_instagram_url() api::get_instagram_url()
} }
#[napi] #[napi]
pub fn submit_contact_v2_json(name: String, email: String, subject: String, message: String, phone: String) -> String { pub fn submit_contact_v2_json(name: String, email: String, subject: String, message: String, phone: String) -> String {
church_core::uniffi::contact::submit_contact_v2_json(name, email, subject, message, phone) api::submit_contact_v2_json(name, email, subject, message, phone)
} }
#[napi] #[napi]
pub fn validate_contact_form_json(form_json: String) -> String { pub fn validate_contact_form_json(form_json: String) -> String {
church_core::uniffi::contact::validate_contact_form_json(form_json) api::validate_contact_form_json(form_json)
}
#[napi]
pub fn validate_event_form_json(event_json: String) -> String {
// TODO: Check if this exists in uniffi::events
serde_json::json!({"success": false, "error": "Not implemented yet"}).to_string()
}
#[napi]
pub fn validate_event_field_json(field_name: String, value: String, event_json: Option<String>) -> String {
// NAPI version has 3 params, but uniffi might only take 2 - adapt as needed
// TODO: Check uniffi::events for the correct signature
serde_json::json!({"success": false, "error": "Not implemented yet"}).to_string()
} }
#[napi] #[napi]
pub fn fetch_livestream_archive_json() -> String { pub fn fetch_livestream_archive_json() -> String {
church_core::uniffi::streaming::fetch_livestream_archive_json() api::fetch_livestream_archive_json()
} }
#[napi] #[napi]
pub fn fetch_bulletins_json() -> String { pub fn fetch_bulletins_json() -> String {
church_core::uniffi::parsing::fetch_bulletins_json() api::fetch_bulletins_json()
} }
#[napi] #[napi]
pub fn fetch_current_bulletin_json() -> String { pub fn fetch_current_bulletin_json() -> String {
church_core::uniffi::parsing::fetch_current_bulletin_json() api::fetch_current_bulletin_json()
} }
#[napi] #[napi]
pub fn fetch_bible_verse_json(query: String) -> String { pub fn fetch_bible_verse_json(query: String) -> String {
church_core::uniffi::bible::fetch_bible_verse_json(query) api::fetch_bible_verse_json(query)
} }
#[napi] #[napi]
@ -149,7 +129,7 @@ pub fn submit_event_json(
recurring_type: Option<String>, recurring_type: Option<String>,
submitter_email: Option<String> submitter_email: Option<String>
) -> String { ) -> String {
church_core::uniffi::events::submit_event_json( api::submit_event_json(
title, title,
description, description,
start_time, start_time,
@ -162,7 +142,7 @@ pub fn submit_event_json(
) )
} }
// Admin functions - these might not exist in uniffi yet // Admin functions
#[napi] #[napi]
pub fn test_admin_function() -> String { pub fn test_admin_function() -> String {
"test".to_string() "test".to_string()
@ -170,24 +150,20 @@ pub fn test_admin_function() -> String {
#[napi] #[napi]
pub fn fetch_all_schedules_json() -> String { pub fn fetch_all_schedules_json() -> String {
// TODO: Add to uniffi modules if needed api::fetch_all_schedules_json()
serde_json::json!({"success": false, "error": "Not implemented yet"}).to_string()
} }
#[napi] #[napi]
pub fn create_schedule_json(schedule_json: String) -> String { pub fn create_schedule_json(schedule_json: String) -> String {
// TODO: Add to uniffi modules if needed api::create_schedule_json(schedule_json)
serde_json::json!({"success": false, "error": "Not implemented yet"}).to_string()
} }
#[napi] #[napi]
pub fn update_schedule_json(date: String, update_json: String) -> String { pub fn update_schedule_json(date: String, update_json: String) -> String {
// TODO: Add to uniffi modules if needed api::update_schedule_json(date, update_json)
serde_json::json!({"success": false, "error": "Not implemented yet"}).to_string()
} }
#[napi] #[napi]
pub fn delete_schedule_json(date: String) -> String { pub fn delete_schedule_json(date: String) -> String {
// TODO: Add to uniffi modules if needed api::delete_schedule_json(date)
serde_json::json!({"success": false, "error": "Not implemented yet"}).to_string()
} }

View file

@ -80,7 +80,12 @@ try {
{event.formatted_time && ( {event.formatted_time && (
<div class="flex items-center space-x-2 text-gray-600 dark:text-gray-300"> <div class="flex items-center space-x-2 text-gray-600 dark:text-gray-300">
<i data-lucide="clock" class="w-4 h-4"></i> <i data-lucide="clock" class="w-4 h-4"></i>
<span class="text-sm">{event.formatted_time}</span> <span class="text-sm">{
// For multi-day events, extract just the time part
event.formatted_time.includes(' - ') && event.formatted_time.includes(',')
? event.formatted_time.split(', ').pop()
: event.formatted_time
}</span>
</div> </div>
)} )}