-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b3382d3
commit b7d77b1
Showing
2 changed files
with
48 additions
and
3 deletions.
There are no files selected for viewing
39 changes: 39 additions & 0 deletions
39
composeApp/src/commonMain/kotlin/component/button/IvyButton.kt
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,39 @@ | ||
package component.button | ||
|
||
import androidx.compose.foundation.layout.PaddingValues | ||
import androidx.compose.material.Button | ||
import androidx.compose.runtime.Composable | ||
import androidx.compose.ui.Modifier | ||
import androidx.compose.ui.unit.dp | ||
|
||
sealed interface ButtonStyle { | ||
data class FilledButton(val state: ButtonState) : ButtonStyle | ||
data class OutlinedButton(val state: ButtonState) : ButtonStyle | ||
} | ||
|
||
enum class ButtonState { | ||
PrimaryVariant, | ||
SecondaryVariant, | ||
Success, | ||
Error | ||
} | ||
|
||
@Composable | ||
fun IvyButton( | ||
style: ButtonStyle, | ||
modifier: Modifier = Modifier, | ||
enabled: Boolean = true, | ||
text: String? = null, | ||
icon: @Composable (() -> Unit)? = null, | ||
iconRight: @Composable (() -> Unit)? = null, | ||
onClick: () -> Unit, | ||
) { | ||
Button( | ||
modifier = modifier, | ||
enabled = enabled, | ||
contentPadding = PaddingValues(horizontal = 16.dp, vertical = 8.dp), | ||
onClick = onClick | ||
) { | ||
// TODO | ||
} | ||
} |
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