-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8 from MahmoudMabrok/feat/events
feat: add event api and ui
- Loading branch information
Showing
12 changed files
with
320 additions
and
69 deletions.
There are no files selected for viewing
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
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
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
67 changes: 67 additions & 0 deletions
67
composeApp/src/commonMain/kotlin/tools/mo3ta/githubactivity/components/UserEventsData.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,67 @@ | ||
package tools.mo3ta.githubactivity.components | ||
|
||
import androidx.compose.foundation.border | ||
import androidx.compose.foundation.layout.Arrangement | ||
import androidx.compose.foundation.layout.Column | ||
import androidx.compose.foundation.layout.ExperimentalLayoutApi | ||
import androidx.compose.foundation.layout.FlowRow | ||
import androidx.compose.foundation.layout.Spacer | ||
import androidx.compose.foundation.layout.fillMaxWidth | ||
import androidx.compose.foundation.layout.padding | ||
import androidx.compose.foundation.layout.size | ||
import androidx.compose.foundation.layout.wrapContentSize | ||
import androidx.compose.foundation.shape.RoundedCornerShape | ||
import androidx.compose.material3.MaterialTheme | ||
import androidx.compose.material3.Text | ||
import androidx.compose.runtime.Composable | ||
import androidx.compose.ui.Alignment | ||
import androidx.compose.ui.Modifier | ||
import androidx.compose.ui.unit.dp | ||
import tools.mo3ta.githubactivity.model.UserEvents | ||
|
||
|
||
@OptIn(ExperimentalLayoutApi::class) | ||
@Composable | ||
fun UserEventsData(events: UserEvents?) { | ||
events?.let { | ||
Column( | ||
modifier = Modifier | ||
.fillMaxWidth() | ||
.border(2.dp, MaterialTheme.colorScheme.primary, RoundedCornerShape(4.dp)) | ||
.padding(horizontal = 8.dp, vertical = 16.dp), | ||
horizontalAlignment = Alignment.CenterHorizontally | ||
) { | ||
Text("UserEvents") | ||
|
||
Spacer(modifier = Modifier.size(16.dp)) | ||
|
||
FlowRow( | ||
modifier = Modifier.fillMaxWidth(), | ||
horizontalArrangement = Arrangement.SpaceEvenly, | ||
verticalArrangement = Arrangement.Center | ||
) { | ||
LabeledData( | ||
"Total Push", | ||
events.pullRequestOpened.toString(), | ||
modifier = Modifier.wrapContentSize() | ||
) | ||
LabeledData( | ||
"PR created", | ||
events.pullRequestOpened.toString(), | ||
modifier = Modifier.wrapContentSize() | ||
) | ||
LabeledData( | ||
"PR Approved", | ||
events.pullRequestApproved.toString(), | ||
modifier = Modifier.wrapContentSize() | ||
) | ||
LabeledData( | ||
"Review Comments", | ||
events.reviewCommentAdded.toString(), | ||
modifier = Modifier.wrapContentSize() | ||
) | ||
} | ||
} | ||
|
||
} | ||
} |
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
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
Oops, something went wrong.