PlaceholderScreens.kt

4.1 KB · raw

1package com.peachpasswords.ui.screens23import androidx.compose.foundation.clickable4import androidx.compose.foundation.layout.Arrangement5import androidx.compose.foundation.layout.Box6import androidx.compose.foundation.layout.Column7import androidx.compose.foundation.layout.fillMaxSize8import androidx.compose.foundation.layout.fillMaxWidth9import androidx.compose.foundation.layout.padding10import androidx.compose.foundation.layout.systemBarsPadding11import androidx.compose.foundation.shape.RoundedCornerShape12import androidx.compose.material3.MaterialTheme13import androidx.compose.material3.Text14import androidx.compose.runtime.Composable15import androidx.compose.ui.Alignment16import androidx.compose.ui.Modifier17import androidx.compose.ui.draw.clip18import androidx.compose.ui.graphics.Color19import androidx.compose.ui.text.font.FontStyle20import androidx.compose.ui.text.font.FontWeight21import androidx.compose.ui.text.style.TextAlign22import androidx.compose.ui.unit.dp23import androidx.compose.ui.unit.sp24import com.peachpasswords.ui.PeachNav25import com.peachpasswords.ui.theme.LocalPeachAccent26import com.peachpasswords.ui.theme.peachColors27import com.peachpasswords.ui.theme.PeachType28import com.peachpasswords.ui.theme.ShellBackground2930/**31 * Phase-1 placeholder. Each later phase replaces the matching screen with the32 * real implementation; until then these prove the shell + navigation graph work.33 */34@Composable35private fun Placeholder(36    title: String,37    subtitle: String? = null,38    actions: List<Pair<String, () -> Unit>> = emptyList(),39    onBack: (() -> Unit)? = null,40) {41    val accent = LocalPeachAccent.current42    ShellBackground {43        Column(44            modifier = Modifier45                .fillMaxSize()46                .systemBarsPadding()47                .padding(horizontal = 28.dp, vertical = 24.dp),48            verticalArrangement = Arrangement.Center,49            horizontalAlignment = Alignment.CenterHorizontally,50        ) {51            Text(52                text = title,53                color = accent,54                fontFamily = PeachType.Display,55                fontStyle = FontStyle.Italic,56                fontWeight = FontWeight.Light,57                fontSize = 34.sp,58                textAlign = TextAlign.Center,59            )60            if (subtitle != null) {61                Text(62                    text = subtitle,63                    color = peachColors.T1,64                    fontFamily = PeachType.Mono,65                    fontSize = 11.sp,66                    textAlign = TextAlign.Center,67                    modifier = Modifier.padding(top = 10.dp),68                )69            }70            actions.forEach { (label, onClick) ->71                NavButton(label, onClick, modifier = Modifier.padding(top = 14.dp))72            }73            if (onBack != null) {74                NavButton("← Back", onBack, modifier = Modifier.padding(top = 14.dp), subtle = true)75            }76        }77    }78}7980@Composable81private fun NavButton(82    label: String,83    onClick: () -> Unit,84    modifier: Modifier = Modifier,85    subtle: Boolean = false,86) {87    val accent = LocalPeachAccent.current88    Box(89        modifier = modifier90            .fillMaxWidth()91            .clip(RoundedCornerShape(12.dp))92            .clickable(onClick = onClick)93            .padding(vertical = 14.dp),94        contentAlignment = Alignment.Center,95    ) {96        Text(97            text = label,98            color = if (subtle) peachColors.T1 else accent,99            fontFamily = PeachType.Mono,100            fontSize = 13.sp,101        )102    }103}104105@Composable106fun SettingsScreenStub(onNavigate: (PeachNav) -> Unit, onBack: () -> Unit) =107    Placeholder(108        title = "Settings",109        subtitle = "PHASE 1 · SETTINGS SHELL",110        actions = listOf(111            "Sync" to { onNavigate(PeachNav.SettingsSync) },112            "Pair a device" to { onNavigate(PeachNav.ChirpPair) },113            "Codex backup" to { onNavigate(PeachNav.CodexGenerate) },114        ),115        onBack = onBack,116    )117118@Composable119fun SimpleStub(title: String, onBack: () -> Unit) =120    Placeholder(title = title, subtitle = "PHASE 1 · SHELL", onBack = onBack)