Skip to content

Commit

Permalink
Hide UnpaddedTitle by making it private
Browse files Browse the repository at this point in the history
  • Loading branch information
LunarX committed Sep 19, 2024
1 parent 850e306 commit e706055
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 85 deletions.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -22,19 +22,39 @@ import androidx.annotation.StringRes
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.padding
import androidx.compose.material3.Surface
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.tooling.preview.Preview
import com.infomaniak.swisstransfer.R
import com.infomaniak.swisstransfer.ui.theme.Dimens
import com.infomaniak.swisstransfer.ui.theme.Margin
import com.infomaniak.swisstransfer.ui.theme.SwissTransferTheme

@Composable
fun SettingTitle(@StringRes titleRes: Int) {
UnpaddedTitle(
Modifier.padding(horizontal = Dimens.SettingHorizontalMargin, vertical = Dimens.SettingVerticalMargin),
titleRes
)
}

@Composable
fun OptionTitle(@StringRes titleRes: Int) {
UnpaddedTitle(Modifier.padding(horizontal = Dimens.SettingHorizontalMargin, vertical = Margin.Large), titleRes)
}

@Composable
private fun UnpaddedTitle(modifier: Modifier, titleRes: Int) {
Text(
modifier = modifier,
text = stringResource(id = titleRes),
style = SwissTransferTheme.typography.bodySmallRegular,
color = SwissTransferTheme.colors.secondaryTextColor,
)
}

@Preview(name = "Light")
@Preview(name = "Dark", uiMode = Configuration.UI_MODE_NIGHT_YES or Configuration.UI_MODE_TYPE_NORMAL)
@Composable
Expand All @@ -47,3 +67,16 @@ private fun OptionTitlePreview() {
}
}
}

@Preview(name = "Light")
@Preview(name = "Dark", uiMode = Configuration.UI_MODE_NIGHT_YES or Configuration.UI_MODE_TYPE_NORMAL)
@Composable
private fun SettingTitlePreview() {
SwissTransferTheme {
Surface {
Box {
SettingTitle(titleRes = R.string.appName)
}
}
}
}

This file was deleted.

0 comments on commit e706055

Please sign in to comment.